summaryrefslogtreecommitdiffstats
path: root/kernel/events
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-07-07 08:58:23 +0200
committerIngo Molnar <mingo@kernel.org>2016-07-07 08:58:23 +0200
commit3ebe3bd8fbd51b5e04e93c7f3fb90bd096a86344 (patch)
tree41b67e7a92f1935b1d5acdc714de1b13f657b7af /kernel/events
parentc50f62454f4b489422333cb2e31401d87456bfa1 (diff)
parent2c81a6477081966fe80b8c6daa68459bca896774 (diff)
downloadlinux-3ebe3bd8fbd51b5e04e93c7f3fb90bd096a86344.tar.bz2
Merge branch 'perf/urgent' into perf/core, to pick up fixes before merging new changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/events')
-rw-r--r--kernel/events/core.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 9345028f2a82..79dae188a987 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -1686,12 +1686,33 @@ static bool is_orphaned_event(struct perf_event *event)
return event->state == PERF_EVENT_STATE_DEAD;
}
-static inline int pmu_filter_match(struct perf_event *event)
+static inline int __pmu_filter_match(struct perf_event *event)
{
struct pmu *pmu = event->pmu;
return pmu->filter_match ? pmu->filter_match(event) : 1;
}
+/*
+ * Check whether we should attempt to schedule an event group based on
+ * PMU-specific filtering. An event group can consist of HW and SW events,
+ * potentially with a SW leader, so we must check all the filters, to
+ * determine whether a group is schedulable:
+ */
+static inline int pmu_filter_match(struct perf_event *event)
+{
+ struct perf_event *child;
+
+ if (!__pmu_filter_match(event))
+ return 0;
+
+ list_for_each_entry(child, &event->sibling_list, group_entry) {
+ if (!__pmu_filter_match(child))
+ return 0;
+ }
+
+ return 1;
+}
+
static inline int
event_filter_match(struct perf_event *event)
{
@@ -7575,7 +7596,7 @@ static void perf_event_free_bpf_prog(struct perf_event *event)
prog = event->tp_event->prog;
if (prog) {
event->tp_event->prog = NULL;
- bpf_prog_put(prog);
+ bpf_prog_put_rcu(prog);
}
}