perf_counter: add an event_list

I noticed that the counter_list only includes top-level counters, thus
perf_swcounter_event() will miss sw-counters in groups.

Since perf_swcounter_event() also wants an RCU safe list, create a new
event_list that includes all counters and uses RCU list ops and use call_rcu
to free the counter structure.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Peter Zijlstra
2009-03-13 12:21:36 +01:00
committed by Ingo Molnar
parent d6d020e995
commit 592903cdcb
2 changed files with 23 additions and 11 deletions

View File

@@ -187,6 +187,7 @@ struct file;
struct perf_counter {
#ifdef CONFIG_PERF_COUNTERS
struct list_head list_entry;
struct list_head event_entry;
struct list_head sibling_list;
struct perf_counter *group_leader;
const struct hw_perf_counter_ops *hw_ops;
@@ -220,6 +221,8 @@ struct perf_counter {
struct perf_data *irqdata;
struct perf_data *usrdata;
struct perf_data data[2];
struct rcu_head rcu_head;
#endif
};
@@ -243,6 +246,7 @@ struct perf_counter_context {
struct mutex mutex;
struct list_head counter_list;
struct list_head event_list;
int nr_counters;
int nr_active;
int is_active;