diff options
author | Ingo Molnar <mingo@kernel.org> | 2018-03-24 09:21:47 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-03-24 09:21:47 +0100 |
commit | 7054e4e0b165ba74562adef96a6b1c53fb9600a4 (patch) | |
tree | 4b0a313a032f0522d277ed8d8bac63d0dc2e9a94 /kernel/events | |
parent | 5701dd1e87d5b3e72226a6cc9b83ef740b4a3dd0 (diff) | |
parent | c917e0f259908e75bd2a65877e25f9d90c22c848 (diff) | |
download | linux-7054e4e0b165ba74562adef96a6b1c53fb9600a4.tar.gz linux-7054e4e0b165ba74562adef96a6b1c53fb9600a4.tar.bz2 linux-7054e4e0b165ba74562adef96a6b1c53fb9600a4.zip |
Merge branch 'perf/urgent' into perf/core, to pick up fixes
With the cherry-picked perf/urgent commit merged separately we can now
merge all the fixes without conflicts.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/events')
-rw-r--r-- | kernel/events/core.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index 74a6e8f12a3c..7517b4fb3ef4 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -724,9 +724,15 @@ static inline void __update_cgrp_time(struct perf_cgroup *cgrp) static inline void update_cgrp_time_from_cpuctx(struct perf_cpu_context *cpuctx) { - struct perf_cgroup *cgrp_out = cpuctx->cgrp; - if (cgrp_out) - __update_cgrp_time(cgrp_out); + struct perf_cgroup *cgrp = cpuctx->cgrp; + struct cgroup_subsys_state *css; + + if (cgrp) { + for (css = &cgrp->css; css; css = css->parent) { + cgrp = container_of(css, struct perf_cgroup, css); + __update_cgrp_time(cgrp); + } + } } static inline void update_cgrp_time_from_event(struct perf_event *event) @@ -754,6 +760,7 @@ perf_cgroup_set_timestamp(struct task_struct *task, { struct perf_cgroup *cgrp; struct perf_cgroup_info *info; + struct cgroup_subsys_state *css; /* * ctx->lock held by caller @@ -764,8 +771,12 @@ perf_cgroup_set_timestamp(struct task_struct *task, return; cgrp = perf_cgroup_from_task(task, ctx); - info = this_cpu_ptr(cgrp->info); - info->timestamp = ctx->timestamp; + + for (css = &cgrp->css; css; css = css->parent) { + cgrp = container_of(css, struct perf_cgroup, css); + info = this_cpu_ptr(cgrp->info); + info->timestamp = ctx->timestamp; + } } static DEFINE_PER_CPU(struct list_head, cgrp_cpuctx_list); |