diff options
author | Stephane Eranian <eranian@google.com> | 2011-03-23 11:03:06 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-03-23 11:07:22 -0400 |
commit | 68cacd29167b1926d237bd1b153aa2a990201729 (patch) | |
tree | d4359e9e0a1fa88b569e0c8a20aede435d916fee /include/linux/perf_event.h | |
parent | ce2d17ca7f85dcade62cd608601a0d52ccdaf0e6 (diff) |
perf_events: Fix stale ->cgrp pointer in update_cgrp_time_from_cpuctx()
This patch solves a stale pointer problem in
update_cgrp_time_from_cpuctx(). The cpuctx->cgrp
was not cleared on all possible event exit paths,
including:
close()
perf_release()
perf_release_kernel()
list_del_event()
This patch fixes list_del_event() to clear cpuctx->cgrp
when there are no cgroup events left in the context.
[ This second version makes the code compile when
CONFIG_CGROUP_PERF is not enabled. We unconditionally define
perf_cpu_context->cgrp. ]
Signed-off-by: Stephane Eranian <eranian@google.com>
Cc: peterz@infradead.org
Cc: perfmon2-devel@lists.sf.net
Cc: paulus@samba.org
Cc: davem@davemloft.net
LKML-Reference: <20110323150306.GA1580@quad>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r-- | include/linux/perf_event.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index f495c0147240..311b4dc785a1 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -938,9 +938,7 @@ struct perf_cpu_context { | |||
938 | struct list_head rotation_list; | 938 | struct list_head rotation_list; |
939 | int jiffies_interval; | 939 | int jiffies_interval; |
940 | struct pmu *active_pmu; | 940 | struct pmu *active_pmu; |
941 | #ifdef CONFIG_CGROUP_PERF | ||
942 | struct perf_cgroup *cgrp; | 941 | struct perf_cgroup *cgrp; |
943 | #endif | ||
944 | }; | 942 | }; |
945 | 943 | ||
946 | struct perf_output_handle { | 944 | struct perf_output_handle { |