summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2010-05-27 17:47:49 +0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2013-01-17 01:45:07 +0400
commite732ebc42aea321ee84514330eb3a675307fcc83 (patch)
treeb81a93b56e3c75e284504cf542c4c916e45ec789 /include
parent9cb08e9f1df7113af1cf28534d73ef3adb419017 (diff)
downloadlinux-e732ebc42aea321ee84514330eb3a675307fcc83.tar.xz
perf_events: Fix races in group composition
commit 8a49542c0554af7d0073aac0ee73ee65b807ef34 upstream. Group siblings don't pin each-other or the parent, so when we destroy events we must make sure to clean up all cross referencing pointers. In particular, for destruction of a group leader we must be able to find all its siblings and remove their reference to it. This means that detaching an event from its context must not detach it from the group, otherwise we can end up failing to clear all pointers. Solve this by clearly separating the attachment to a context and attachment to a group, and keep the group composed until we destroy the events. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/perf_event.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index eea91881fe24..c6e14329b656 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -571,6 +571,9 @@ enum perf_group_flag {
PERF_GROUP_SOFTWARE = 0x1,
};
+#define PERF_ATTACH_CONTEXT 0x01
+#define PERF_ATTACH_GROUP 0x02
+
/**
* struct perf_event - performance event kernel representation:
*/
@@ -585,6 +588,7 @@ struct perf_event {
const struct pmu *pmu;
enum perf_event_active_state state;
+ unsigned int attach_state;
atomic64_t count;
/*