All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V10 1/4] perf/x86/intel: Apply static call for drain_pebs
@ 2025-01-21 15:23 kan.liang
  2025-01-21 15:23 ` [PATCH V10 2/4] perf/x86/intel: Avoid disable PMU if !cpuc->enabled in sample read kan.liang
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: kan.liang @ 2025-01-21 15:23 UTC (permalink / raw)
  To: peterz, mingo, acme, namhyung, irogers, adrian.hunter,
	linux-kernel, linux-perf-users
  Cc: ak, eranian, dapeng1.mi, Kan Liang, stable

From: "Peter Zijlstra (Intel)" <peterz@infradead.org>

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: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
---

New for V10

 arch/x86/events/intel/core.c | 2 +-
 arch/x86/events/intel/ds.c   | 2 +-
 arch/x86/events/perf_event.h | 1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index 2a2824e9c50d..4daa45ae9bd2 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -3066,7 +3066,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;
 
 		/*
diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
index ba74e1198328..322963b02a91 100644
--- a/arch/x86/events/intel/ds.c
+++ b/arch/x86/events/intel/ds.c
@@ -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);
 }
 
 /*
diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h
index 31c2771545a6..084e9196b458 100644
--- a/arch/x86/events/perf_event.h
+++ b/arch/x86/events/perf_event.h
@@ -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)
 {
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2025-02-05  9:38 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-21 15:23 [PATCH V10 1/4] perf/x86/intel: Apply static call for drain_pebs kan.liang
2025-01-21 15:23 ` [PATCH V10 2/4] perf/x86/intel: Avoid disable PMU if !cpuc->enabled in sample read kan.liang
2025-02-03 12:48   ` [tip: perf/core] " tip-bot2 for Kan Liang
2025-02-05  9:38   ` tip-bot2 for Kan Liang
2025-01-21 15:23 ` [PATCH V10 3/4] perf: Avoid the read if the count is already updated kan.liang
2025-02-03 12:48   ` [tip: perf/core] " tip-bot2 for Peter Zijlstra (Intel)
2025-02-05  9:38   ` tip-bot2 for Peter Zijlstra (Intel)
2025-01-21 15:23 ` [PATCH V10 4/4] perf/x86/intel: Support PEBS counters snapshotting kan.liang
2025-01-27 15:51   ` Peter Zijlstra
2025-01-27 16:15     ` Liang, Kan
2025-02-04 21:09     ` Liang, Kan
2025-02-03 12:48   ` [tip: perf/core] " tip-bot2 for Kan Liang
2025-02-05  9:38   ` tip-bot2 for Kan Liang
2025-02-03 12:48 ` [tip: perf/core] perf/x86/intel: Apply static call for drain_pebs tip-bot2 for Peter Zijlstra (Intel)
2025-02-05  9:38 ` tip-bot2 for Peter Zijlstra (Intel)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.