summaryrefslogtreecommitdiff
path: root/arch/x86/events/perf_event.h
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2022-05-10 21:22:04 +0200
committerPeter Zijlstra <peterz@infradead.org>2022-05-18 00:08:25 +0200
commit3c27b0c6ea48bc61492a138c410e262735d660ab (patch)
treefacfef5bda5b0cf88f172f5dd25309f1964e8ad9 /arch/x86/events/perf_event.h
parentbc469ddf67154a4840267132e87ce0d8b72d4952 (diff)
perf/x86/amd: Fix AMD BRS period adjustment
There's two problems with the current amd_brs_adjust_period() code: - it isn't in fact AMD specific and wil always adjust the period; - it adjusts the period, while it should only adjust the event count, resulting in repoting a short period. Fix this by using x86_pmu.limit_period, this makes it specific to the AMD BRS case and ensures only the event count is adjusted while the reported period is unmodified. Fixes: ba2fe7500845 ("perf/x86/amd: Add AMD branch sampling period adjustment") Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Diffstat (limited to 'arch/x86/events/perf_event.h')
-rw-r--r--arch/x86/events/perf_event.h18
1 files changed, 0 insertions, 18 deletions
diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h
index 3b0324584da3..21a5482bcf84 100644
--- a/arch/x86/events/perf_event.h
+++ b/arch/x86/events/perf_event.h
@@ -1254,14 +1254,6 @@ static inline void amd_pmu_brs_del(struct perf_event *event)
}
void amd_pmu_brs_sched_task(struct perf_event_context *ctx, bool sched_in);
-
-static inline s64 amd_brs_adjust_period(s64 period)
-{
- if (period > x86_pmu.lbr_nr)
- return period - x86_pmu.lbr_nr;
-
- return period;
-}
#else
static inline int amd_brs_init(void)
{
@@ -1290,11 +1282,6 @@ static inline void amd_pmu_brs_sched_task(struct perf_event_context *ctx, bool s
{
}
-static inline s64 amd_brs_adjust_period(s64 period)
-{
- return period;
-}
-
static inline void amd_brs_enable_all(void)
{
}
@@ -1324,11 +1311,6 @@ static inline void amd_brs_enable_all(void)
static inline void amd_brs_disable_all(void)
{
}
-
-static inline s64 amd_brs_adjust_period(s64 period)
-{
- return period;
-}
#endif /* CONFIG_CPU_SUP_AMD */
static inline int is_pebs_pt(struct perf_event *event)