]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
perf/x86/intel: Apply static call for drain_pebs
authorPeter Zijlstra (Intel) <peterz@infradead.org>
Tue, 21 Jan 2025 15:23:00 +0000 (07:23 -0800)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 5 Feb 2025 09:29:45 +0000 (10:29 +0100)
The x86_pmu_drain_pebs static call was introduced in commit 7c9903c9bf71
("x86/perf, static_call: Optimize x86_pmu methods"), but it's not really
used to replace the old method.

Apply the static call for drain_pebs.

Fixes: 7c9903c9bf71 ("x86/perf, static_call: Optimize x86_pmu methods")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20250121152303.3128733-1-kan.liang@linux.intel.com
arch/x86/events/intel/core.c
arch/x86/events/intel/ds.c
arch/x86/events/perf_event.h

index 7601196d1d18e824863f4a84b5e1c0f2e4cce569..2acea83526c635421a7c59505178c6d714e99b45 100644 (file)
@@ -3076,7 +3076,7 @@ static int handle_pmi_common(struct pt_regs *regs, u64 status)
 
                handled++;
                x86_pmu_handle_guest_pebs(regs, &data);
-               x86_pmu.drain_pebs(regs, &data);
+               static_call(x86_pmu_drain_pebs)(regs, &data);
                status &= intel_ctrl | GLOBAL_STATUS_TRACE_TOPAPMI;
 
                /*
index ba74e11983280beb770cc4fdbcd404830f0d9857..322963b02a91262b5dc65f2f28442ca0b0e4ae4f 100644 (file)
@@ -957,7 +957,7 @@ static inline void intel_pmu_drain_pebs_buffer(void)
 {
        struct perf_sample_data data;
 
-       x86_pmu.drain_pebs(NULL, &data);
+       static_call(x86_pmu_drain_pebs)(NULL, &data);
 }
 
 /*
index 31c2771545a6c66f919c0b73fc0ea00080ee3672..084e9196b45828abf8ab11c89361bbbc397df14a 100644 (file)
@@ -1107,6 +1107,7 @@ extern struct x86_pmu x86_pmu __read_mostly;
 
 DECLARE_STATIC_CALL(x86_pmu_set_period, *x86_pmu.set_period);
 DECLARE_STATIC_CALL(x86_pmu_update,     *x86_pmu.update);
+DECLARE_STATIC_CALL(x86_pmu_drain_pebs,        *x86_pmu.drain_pebs);
 
 static __always_inline struct x86_perf_task_context_opt *task_context_opt(void *ctx)
 {