diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-05-20 19:56:19 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-05-26 14:32:30 -0400 |
commit | c2adae0970ca1db8adb92fb56ae3bcabd916e8bd (patch) | |
tree | 8612e3513e14cf9190ce90e59037f7eb4688ba4a /include/trace | |
parent | 0f4fc29dd68dfab9c6ddd5d087d34a5b6818cb00 (diff) |
tracing: convert irq events to use __print_symbolic
The recording of the names at trace time is inefficient. This patch
implements the softirq event recording to only record the vector
and then use the __print_symbolic interface to print out the names.
[ Impact: faster recording of softirq events ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/irq.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h index 32a9f7ef432b..683fb36a9943 100644 --- a/include/trace/events/irq.h +++ b/include/trace/events/irq.h | |||
@@ -7,6 +7,19 @@ | |||
7 | #undef TRACE_SYSTEM | 7 | #undef TRACE_SYSTEM |
8 | #define TRACE_SYSTEM irq | 8 | #define TRACE_SYSTEM irq |
9 | 9 | ||
10 | #define softirq_name(sirq) { sirq, #sirq } | ||
11 | #define show_softirq_name(val) \ | ||
12 | __print_symbolic(val, \ | ||
13 | softirq_name(HI_SOFTIRQ), \ | ||
14 | softirq_name(TIMER_SOFTIRQ), \ | ||
15 | softirq_name(NET_TX_SOFTIRQ), \ | ||
16 | softirq_name(NET_RX_SOFTIRQ), \ | ||
17 | softirq_name(BLOCK_SOFTIRQ), \ | ||
18 | softirq_name(TASKLET_SOFTIRQ), \ | ||
19 | softirq_name(SCHED_SOFTIRQ), \ | ||
20 | softirq_name(HRTIMER_SOFTIRQ), \ | ||
21 | softirq_name(RCU_SOFTIRQ)) | ||
22 | |||
10 | /** | 23 | /** |
11 | * irq_handler_entry - called immediately before the irq action handler | 24 | * irq_handler_entry - called immediately before the irq action handler |
12 | * @irq: irq number | 25 | * @irq: irq number |
@@ -87,15 +100,14 @@ TRACE_EVENT(softirq_entry, | |||
87 | 100 | ||
88 | TP_STRUCT__entry( | 101 | TP_STRUCT__entry( |
89 | __field( int, vec ) | 102 | __field( int, vec ) |
90 | __string( name, softirq_to_name[h-vec] ) | ||
91 | ), | 103 | ), |
92 | 104 | ||
93 | TP_fast_assign( | 105 | TP_fast_assign( |
94 | __entry->vec = (int)(h - vec); | 106 | __entry->vec = (int)(h - vec); |
95 | __assign_str(name, softirq_to_name[h-vec]); | ||
96 | ), | 107 | ), |
97 | 108 | ||
98 | TP_printk("softirq=%d action=%s", __entry->vec, __get_str(name)) | 109 | TP_printk("softirq=%d action=%s", __entry->vec, |
110 | show_softirq_name(__entry->vec)) | ||
99 | ); | 111 | ); |
100 | 112 | ||
101 | /** | 113 | /** |
@@ -117,15 +129,14 @@ TRACE_EVENT(softirq_exit, | |||
117 | 129 | ||
118 | TP_STRUCT__entry( | 130 | TP_STRUCT__entry( |
119 | __field( int, vec ) | 131 | __field( int, vec ) |
120 | __string( name, softirq_to_name[h-vec] ) | ||
121 | ), | 132 | ), |
122 | 133 | ||
123 | TP_fast_assign( | 134 | TP_fast_assign( |
124 | __entry->vec = (int)(h - vec); | 135 | __entry->vec = (int)(h - vec); |
125 | __assign_str(name, softirq_to_name[h-vec]); | ||
126 | ), | 136 | ), |
127 | 137 | ||
128 | TP_printk("softirq=%d action=%s", __entry->vec, __get_str(name)) | 138 | TP_printk("softirq=%d action=%s", __entry->vec, |
139 | show_softirq_name(__entry->vec)) | ||
129 | ); | 140 | ); |
130 | 141 | ||
131 | #endif /* _TRACE_IRQ_H */ | 142 | #endif /* _TRACE_IRQ_H */ |