diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-12-11 02:38:42 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-11 09:45:49 -0500 |
commit | 04289bb9891882202d7e961c4c04d2376930e9f9 (patch) | |
tree | 13340847915efc809a62bf91b3cd45e0e0416deb /include/linux/perf_counter.h | |
parent | 9f66a3810fe0d4100972db84290f3ae4a4d77025 (diff) |
perf counters: add support for group counters
Impact: add group counters
This patch adds the "counter groups" abstraction.
Groups of counters behave much like normal 'single' counters, with a
few semantic and behavioral extensions on top of that.
A counter group is created by creating a new counter with the open()
syscall's group-leader group_fd file descriptor parameter pointing
to another, already existing counter.
Groups of counters are scheduled in and out in one atomic group, and
they are also roundrobin-scheduled atomically.
Counters that are member of a group can also record events with an
(atomic) extended timestamp that extends to all members of the group,
if the record type is set to PERF_RECORD_GROUP.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_counter.h')
-rw-r--r-- | include/linux/perf_counter.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index a2b4852e2d70..7af7d8965460 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h | |||
@@ -117,7 +117,10 @@ struct perf_data { | |||
117 | * struct perf_counter - performance counter kernel representation: | 117 | * struct perf_counter - performance counter kernel representation: |
118 | */ | 118 | */ |
119 | struct perf_counter { | 119 | struct perf_counter { |
120 | struct list_head list; | 120 | struct list_head list_entry; |
121 | struct list_head sibling_list; | ||
122 | struct perf_counter *group_leader; | ||
123 | |||
121 | int active; | 124 | int active; |
122 | #if BITS_PER_LONG == 64 | 125 | #if BITS_PER_LONG == 64 |
123 | atomic64_t count; | 126 | atomic64_t count; |
@@ -158,7 +161,8 @@ struct perf_counter_context { | |||
158 | * Protect the list of counters: | 161 | * Protect the list of counters: |
159 | */ | 162 | */ |
160 | spinlock_t lock; | 163 | spinlock_t lock; |
161 | struct list_head counters; | 164 | |
165 | struct list_head counter_list; | ||
162 | int nr_counters; | 166 | int nr_counters; |
163 | int nr_active; | 167 | int nr_active; |
164 | struct task_struct *task; | 168 | struct task_struct *task; |