Commit 3e9a8b21 authored by Kan Liang's avatar Kan Liang Committed by Peter Zijlstra

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: default avatarKan Liang <kan.liang@linux.intel.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: default avatarAndi Kleen <ak@linux.intel.com>
Link: https://lkml.kernel.org/r/1618237865-33448-20-git-send-email-kan.liang@linux.intel.com
parent 58ae30c2
...@@ -2641,6 +2641,14 @@ static int x86_pmu_aux_output_match(struct perf_event *event) ...@@ -2641,6 +2641,14 @@ static int x86_pmu_aux_output_match(struct perf_event *event)
return 0; return 0;
} }
static int x86_pmu_filter_match(struct perf_event *event)
{
if (x86_pmu.filter_match)
return x86_pmu.filter_match(event);
return 1;
}
static struct pmu pmu = { static struct pmu pmu = {
.pmu_enable = x86_pmu_enable, .pmu_enable = x86_pmu_enable,
.pmu_disable = x86_pmu_disable, .pmu_disable = x86_pmu_disable,
...@@ -2668,6 +2676,8 @@ static struct pmu pmu = { ...@@ -2668,6 +2676,8 @@ static struct pmu pmu = {
.check_period = x86_pmu_check_period, .check_period = x86_pmu_check_period,
.aux_output_match = x86_pmu_aux_output_match, .aux_output_match = x86_pmu_aux_output_match,
.filter_match = x86_pmu_filter_match,
}; };
void arch_perf_update_userpage(struct perf_event *event, void arch_perf_update_userpage(struct perf_event *event,
......
...@@ -879,6 +879,7 @@ struct x86_pmu { ...@@ -879,6 +879,7 @@ struct x86_pmu {
int (*aux_output_match) (struct perf_event *event); int (*aux_output_match) (struct perf_event *event);
int (*filter_match)(struct perf_event *event);
/* /*
* Hybrid support * Hybrid support
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment