Commit d06f23e7 authored by Will Deacon's avatar Will Deacon

Merge branch 'perf/core' into perf/updates

parents b3eac026 66eb579e
...@@ -304,6 +304,11 @@ struct pmu { ...@@ -304,6 +304,11 @@ struct pmu {
* Free pmu-private AUX data structures * Free pmu-private AUX data structures
*/ */
void (*free_aux) (void *aux); /* optional */ void (*free_aux) (void *aux); /* optional */
/*
* Filter events for PMU-specific reasons.
*/
int (*filter_match) (struct perf_event *event); /* optional */
}; };
/** /**
......
...@@ -1506,11 +1506,17 @@ static int __init perf_workqueue_init(void) ...@@ -1506,11 +1506,17 @@ static int __init perf_workqueue_init(void)
core_initcall(perf_workqueue_init); core_initcall(perf_workqueue_init);
static inline int pmu_filter_match(struct perf_event *event)
{
struct pmu *pmu = event->pmu;
return pmu->filter_match ? pmu->filter_match(event) : 1;
}
static inline int static inline int
event_filter_match(struct perf_event *event) event_filter_match(struct perf_event *event)
{ {
return (event->cpu == -1 || event->cpu == smp_processor_id()) return (event->cpu == -1 || event->cpu == smp_processor_id())
&& perf_cgroup_match(event); && perf_cgroup_match(event) && pmu_filter_match(event);
} }
static void static void
......
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