Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 365590
b: refs/heads/master
c: ef824fa
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo committed Apr 10, 2013
1 parent 1688d23 commit 08a8acc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 78574cf981cd3d9ae9f6adbd466a772310ec24ff
refs/heads/master: ef824fa129b7579f56b92d466ecda2e378879806
24 changes: 16 additions & 8 deletions trunk/kernel/events/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,22 @@ perf_cgroup_match(struct perf_event *event)
struct perf_event_context *ctx = event->ctx;
struct perf_cpu_context *cpuctx = __get_cpu_context(ctx);

return !event->cgrp || event->cgrp == cpuctx->cgrp;
/* @event doesn't care about cgroup */
if (!event->cgrp)
return true;

/* wants specific cgroup scope but @cpuctx isn't associated with any */
if (!cpuctx->cgrp)
return false;

/*
* Cgroup scoping is recursive. An event enabled for a cgroup is
* also enabled for all its descendant cgroups. If @cpuctx's
* cgroup is a descendant of @event's (the test covers identity
* case), it's a match.
*/
return cgroup_is_descendant(cpuctx->cgrp->css.cgroup,
event->cgrp->css.cgroup);
}

static inline bool perf_tryget_cgroup(struct perf_event *event)
Expand Down Expand Up @@ -7509,12 +7524,5 @@ struct cgroup_subsys perf_subsys = {
.css_free = perf_cgroup_css_free,
.exit = perf_cgroup_exit,
.attach = perf_cgroup_attach,

/*
* perf_event cgroup doesn't handle nesting correctly.
* ctx->nr_cgroups adjustments should be propagated through the
* cgroup hierarchy. Fix it and remove the following.
*/
.broken_hierarchy = true,
};
#endif /* CONFIG_CGROUP_PERF */

0 comments on commit 08a8acc

Please sign in to comment.