diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2010-08-14 14:45:13 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2010-08-18 19:32:53 -0400 |
commit | 7ae07ea3a48d30689ee037cb136bc21f0b37d8ae (patch) | |
tree | 2cb895a0794bcb2e45a4f48ef7e93302c1f6332c /include/linux/perf_event.h | |
parent | 927c7a9e92c4f69097a6e9e086d11fc2f8a5b40b (diff) |
perf: Humanize the number of contexts
Instead of hardcoding the number of contexts for the recursions
barriers, define a cpp constant to make the code more
self-explanatory.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Stephane Eranian <eranian@google.com>
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r-- | include/linux/perf_event.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index d7e8ea690864..ae6fa6050925 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -808,6 +808,12 @@ struct perf_event_context { | |||
808 | struct rcu_head rcu_head; | 808 | struct rcu_head rcu_head; |
809 | }; | 809 | }; |
810 | 810 | ||
811 | /* | ||
812 | * Number of contexts where an event can trigger: | ||
813 | * task, softirq, hardirq, nmi. | ||
814 | */ | ||
815 | #define PERF_NR_CONTEXTS 4 | ||
816 | |||
811 | /** | 817 | /** |
812 | * struct perf_event_cpu_context - per cpu event context structure | 818 | * struct perf_event_cpu_context - per cpu event context structure |
813 | */ | 819 | */ |
@@ -821,12 +827,8 @@ struct perf_cpu_context { | |||
821 | struct mutex hlist_mutex; | 827 | struct mutex hlist_mutex; |
822 | int hlist_refcount; | 828 | int hlist_refcount; |
823 | 829 | ||
824 | /* | 830 | /* Recursion avoidance in each contexts */ |
825 | * Recursion avoidance: | 831 | int recursion[PERF_NR_CONTEXTS]; |
826 | * | ||
827 | * task, softirq, irq, nmi context | ||
828 | */ | ||
829 | int recursion[4]; | ||
830 | }; | 832 | }; |
831 | 833 | ||
832 | struct perf_output_handle { | 834 | struct perf_output_handle { |