Merge branch 'linus' into perf/core, to fix conflicts
[linux-2.6-microblaze.git] / kernel / events / core.c
index 2551e8c..81dd57b 100644 (file)
@@ -949,9 +949,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;