Commit aac4de46 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'perf-core-2024-01-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

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
parents 0bdf0621 fdd04102
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -16,3 +16,9 @@ Description:
		Example output in powerpc:
		grep . /sys/bus/event_source/devices/cpu/caps/*
		/sys/bus/event_source/devices/cpu/caps/pmu_name:POWER9

		The "branch_counter_nr" in the supported platform exposes the
		maximum number of counters which can be shown in the u64 counters
		of PERF_SAMPLE_BRANCH_COUNTERS, while the "branch_counter_width"
		exposes the width of each counter. Both of them can be used by
		the perf tool to parse the logged counters in each branch.
+1 −1
Original line number Diff line number Diff line
@@ -2312,7 +2312,7 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
			struct cpu_hw_events *cpuhw;
			cpuhw = this_cpu_ptr(&cpu_hw_events);
			power_pmu_bhrb_read(event, cpuhw);
			perf_sample_save_brstack(&data, event, &cpuhw->bhrb_stack);
			perf_sample_save_brstack(&data, event, &cpuhw->bhrb_stack, NULL);
		}

		if (event->attr.sample_type & PERF_SAMPLE_DATA_SRC &&
+1 −1
Original line number Diff line number Diff line
@@ -940,7 +940,7 @@ static int amd_pmu_v2_handle_irq(struct pt_regs *regs)
			continue;

		if (has_branch_stack(event))
			perf_sample_save_brstack(&data, event, &cpuc->lbr_stack);
			perf_sample_save_brstack(&data, event, &cpuc->lbr_stack, NULL);

		if (perf_event_overflow(event, &data, regs))
			x86_pmu_stop(event, 0);
+3 −0
Original line number Diff line number Diff line
@@ -287,6 +287,9 @@ static int perf_ibs_init(struct perf_event *event)
	if (config & ~perf_ibs->config_mask)
		return -EINVAL;

	if (has_branch_stack(event))
		return -EOPNOTSUPP;

	ret = validate_group(event);
	if (ret)
		return ret;
+2 −2
Original line number Diff line number Diff line
@@ -601,7 +601,7 @@ int x86_pmu_hw_config(struct perf_event *event)
		}
	}

	if (event->attr.branch_sample_type & PERF_SAMPLE_BRANCH_CALL_STACK)
	if (branch_sample_call_stack(event))
		event->attach_state |= PERF_ATTACH_TASK_DATA;

	/*
@@ -1702,7 +1702,7 @@ int x86_pmu_handle_irq(struct pt_regs *regs)
		perf_sample_data_init(&data, 0, event->hw.last_period);

		if (has_branch_stack(event))
			perf_sample_save_brstack(&data, event, &cpuc->lbr_stack);
			perf_sample_save_brstack(&data, event, &cpuc->lbr_stack, NULL);

		if (perf_event_overflow(event, &data, regs))
			x86_pmu_stop(event, 0);
Loading