Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 3e9a8b2

Browse files
Kan LiangPeter Zijlstra
authored andcommitted
perf/x86: Support filter_match callback
Implement filter_match callback for X86, which check whether an event is schedulable on the current CPU. Signed-off-by: Kan Liang <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Andi Kleen <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 58ae30c commit 3e9a8b2

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

arch/x86/events/core.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2641,6 +2641,14 @@ static int x86_pmu_aux_output_match(struct perf_event *event)
26412641
return 0;
26422642
}
26432643

2644+
static int x86_pmu_filter_match(struct perf_event *event)
2645+
{
2646+
if (x86_pmu.filter_match)
2647+
return x86_pmu.filter_match(event);
2648+
2649+
return 1;
2650+
}
2651+
26442652
static struct pmu pmu = {
26452653
.pmu_enable = x86_pmu_enable,
26462654
.pmu_disable = x86_pmu_disable,
@@ -2668,6 +2676,8 @@ static struct pmu pmu = {
26682676
.check_period = x86_pmu_check_period,
26692677

26702678
.aux_output_match = x86_pmu_aux_output_match,
2679+
2680+
.filter_match = x86_pmu_filter_match,
26712681
};
26722682

26732683
void arch_perf_update_userpage(struct perf_event *event,

arch/x86/events/perf_event.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,7 @@ struct x86_pmu {
879879

880880
int (*aux_output_match) (struct perf_event *event);
881881

882+
int (*filter_match)(struct perf_event *event);
882883
/*
883884
* Hybrid support
884885
*

0 commit comments

Comments
 (0)