Skip to content

Commit

Permalink
Merge branch 'perf/core' into perf/updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Deacon committed May 27, 2015
2 parents b3eac02 + 66eb579 commit d06f23e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions include/linux/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ struct pmu {
* Free pmu-private AUX data structures
*/
void (*free_aux) (void *aux); /* optional */

/*
* Filter events for PMU-specific reasons.
*/
int (*filter_match) (struct perf_event *event); /* optional */
};

/**
Expand Down
8 changes: 7 additions & 1 deletion kernel/events/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1506,11 +1506,17 @@ static int __init perf_workqueue_init(void)

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
event_filter_match(struct perf_event *event)
{
return (event->cpu == -1 || event->cpu == smp_processor_id())
&& perf_cgroup_match(event);
&& perf_cgroup_match(event) && pmu_filter_match(event);
}

static void
Expand Down

0 comments on commit d06f23e

Please sign in to comment.