Messages in this thread | | | Date | Wed, 23 Mar 2011 12:36:01 +0100 | From | Ingo Molnar <> | Subject | Re: [PATCH] perf_events: fix cgrp stale pointer in update_cgrp_time_from_cpuctx() |
| |
* Stephane Eranian <eranian@google.com> wrote:
> - if (is_cgroup_event(event)) > + if (is_cgroup_event(event)) { > ctx->nr_cgroups--; > + cpuctx = __get_cpu_context(ctx); > + /* > + * if there are no more cgroup events > + * then clear cgrp to avoid stale pointer > + * in update_cgrp_time_from_cpuctx() > + */ > + if (!ctx->nr_cgroups) > + cpuctx->cgrp = NULL; > + }
The ->cgrp pointer does not exist on !CGROUPS kernels. I suspect the cleanest approach would be to make those two cgrp fields available unconditionally in struct perf_event.
Thanks,
Ingo
| |