Pull performance events updates from Ingo Molnar: - Add branch stack counters ABI extension to better capture the growing amount of information the PMU exposes via branch stack sampling. There's matching tooling support. - Fix race when creating the nr_addr_filters sysfs file - Add Intel Sierra Forest and Grand Ridge intel/cstate PMU support - Add Intel Granite Rapids, Sierra Forest and Grand Ridge uncore PMU support - Misc cleanups & fixes * tag 'perf-core-2024-01-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/intel/uncore: Factor out topology_gidnid_map() perf/x86/intel/uncore: Fix NULL pointer dereference issue in upi_fill_topology() perf/x86/amd: Reject branch stack for IBS events perf/x86/intel/uncore: Support Sierra Forest and Grand Ridge perf/x86/intel/uncore: Support IIO free-running counters on GNR perf/x86/intel/uncore: Support Granite Rapids perf/x86/uncore: Use u64 to replace unsigned for the uncore offsets array perf/x86/intel/uncore: Generic uncore_get_uncores and MMIO format of SPR perf: Fix the nr_addr_filters fix perf/x86/intel/cstate: Add Grand Ridge support perf/x86/intel/cstate: Add Sierra Forest support x86/smp: Export symbol cpu_clustergroup_mask() perf/x86/intel/cstate: Cleanup duplicate attr_groups perf/core: Fix narrow startup race when creating the perf nr_addr_filters sysfs file perf/x86/intel: Support branch counters logging perf/x86/intel: Reorganize attrs and is_visible perf: Add branch_sample_call_stack perf/x86: Add PERF_X86_EVENT_NEEDS_BRANCH_STACK flag perf: Add branch stack counters
Showing the changes to include/uapi (1 of 23 files). Show all
Unified · Split
| @@ -204,6 +204,8 @@ enum perf_branch_sample_type_shift { · 203 unmodified lines | ||
| 204 | 204 | |
| 205 | 205 | PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT = 18, /* save privilege mode */ |
| 206 | 206 | |
| 207 | + PERF_SAMPLE_BRANCH_COUNTERS_SHIFT = 19, /* save occurrences of events on a branch */ | |
| 208 | + | |
| 207 | 209 | PERF_SAMPLE_BRANCH_MAX_SHIFT /* non-ABI */ |
| 208 | 210 | }; |
| 209 | 211 | |
| @@ -235,6 +237,8 @@ enum perf_branch_sample_type { · 25 unmodified lines | ||
| 235 | 237 | |
| 236 | 238 | PERF_SAMPLE_BRANCH_PRIV_SAVE = 1U << PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT, |
| 237 | 239 | |
| 240 | + PERF_SAMPLE_BRANCH_COUNTERS = 1U << PERF_SAMPLE_BRANCH_COUNTERS_SHIFT, | |
| 241 | + | |
| 238 | 242 | PERF_SAMPLE_BRANCH_MAX = 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT, |
| 239 | 243 | }; |
| 240 | 244 | |
| @@ -982,6 +986,12 @@ enum perf_event_type { · 741 unmodified lines | ||
| 982 | 986 | * { u64 nr; |
| 983 | 987 | * { u64 hw_idx; } && PERF_SAMPLE_BRANCH_HW_INDEX |
| 984 | 988 | * { u64 from, to, flags } lbr[nr]; |
| 989 | + * # | |
| 990 | + * # The format of the counters is decided by the | |
| 991 | + * # "branch_counter_nr" and "branch_counter_width", | |
| 992 | + * # which are defined in the ABI. | |
| 993 | + * # | |
| 994 | + * { u64 counters; } cntr[nr] && PERF_SAMPLE_BRANCH_COUNTERS | |
| 985 | 995 | * } && PERF_SAMPLE_BRANCH_STACK |
| 986 | 996 | * |
| 987 | 997 | * { u64 abi; # enum perf_sample_regs_abi |
| @@ -1427,6 +1437,9 @@ struct perf_branch_entry { · 439 unmodified lines | ||
| 1427 | 1437 | reserved:31; |
| 1428 | 1438 | }; |
| 1429 | 1439 | |
| 1440 | +/* Size of used info bits in struct perf_branch_entry */ | |
| 1441 | +#define PERF_BRANCH_ENTRY_INFO_BITS_MAX 33 | |
| 1442 | + | |
| 1430 | 1443 | union perf_sample_weight { |
| 1431 | 1444 | __u64 full; |
| 1432 | 1445 | #if defined(__LITTLE_ENDIAN_BITFIELD) |