summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-05 11:44:39 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-05 11:44:39 -0800
commit9d9cc4aa004edc996ce560e57b1154f658681c05 (patch)
tree30b71e1aa3363083855edc22447c52585d04d224 /kernel
parentc84e6d01eed16afa41a1c4ad9a6bd6a8bfe67af0 (diff)
parentfb7df12d645cfba6a76a45fdcc7e3f7fbbcda661 (diff)
downloadlinux-9d9cc4aa004edc996ce560e57b1154f658681c05.tar.bz2
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar: "Various fixes: - synchronize kernel and tooling headers - cgroup support fix - two tooling fixes" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: tools/headers: Synchronize kernel ABI headers perf/cgroup: Fix perf cgroup hierarchy support perf tools: Unwind properly location after REJECT perf symbols: Fix memory corruption because of zero length symbols
Diffstat (limited to 'kernel')
-rw-r--r--kernel/events/core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 9d93db81fa36..10cdb9c26b5d 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -901,9 +901,11 @@ list_update_cgroup_event(struct perf_event *event,
cpuctx_entry = &cpuctx->cgrp_cpuctx_entry;
/* cpuctx->cgrp is NULL unless a cgroup event is active in this CPU .*/
if (add) {
+ struct perf_cgroup *cgrp = perf_cgroup_from_task(current, ctx);
+
list_add(cpuctx_entry, this_cpu_ptr(&cgrp_cpuctx_list));
- if (perf_cgroup_from_task(current, ctx) == event->cgrp)
- cpuctx->cgrp = event->cgrp;
+ if (cgroup_is_descendant(cgrp->css.cgroup, event->cgrp->css.cgroup))
+ cpuctx->cgrp = cgrp;
} else {
list_del(cpuctx_entry);
cpuctx->cgrp = NULL;