diff options
| author | Li Zefan <lizf@cn.fujitsu.com> | 2009-11-26 02:04:31 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-11-26 03:14:03 -0500 |
| commit | c467307c1a812c3150b27a68c2b2d3397bb40a4f (patch) | |
| tree | c4cbb435998016afdaa9ee71497867ecbf9a5def /include/trace | |
| parent | 53d0422c2d10808fddb2c30859193bfea164c7e3 (diff) | |
tracing: Convert softirq events to DEFINE_EVENT
Use DECLARE_EVENT_CLASS to remove duplicate code:
text data bss dec hex filename
12781 952 36 13769 35c9 kernel/softirq.o.old
11981 952 32 12965 32a5 kernel/softirq.o
Two events are converted:
softirq: softirq_entry, softirq_exit
No change in functionality.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <4B0E287F.4030708@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/trace')
| -rw-r--r-- | include/trace/events/irq.h | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h index dcfcd4407623..0e4cfb694fe7 100644 --- a/include/trace/events/irq.h +++ b/include/trace/events/irq.h | |||
| @@ -82,18 +82,7 @@ TRACE_EVENT(irq_handler_exit, | |||
| 82 | __entry->irq, __entry->ret ? "handled" : "unhandled") | 82 | __entry->irq, __entry->ret ? "handled" : "unhandled") |
| 83 | ); | 83 | ); |
| 84 | 84 | ||
| 85 | /** | 85 | DECLARE_EVENT_CLASS(softirq, |
| 86 | * softirq_entry - called immediately before the softirq handler | ||
| 87 | * @h: pointer to struct softirq_action | ||
| 88 | * @vec: pointer to first struct softirq_action in softirq_vec array | ||
| 89 | * | ||
| 90 | * The @h parameter, contains a pointer to the struct softirq_action | ||
| 91 | * which has a pointer to the action handler that is called. By subtracting | ||
| 92 | * the @vec pointer from the @h pointer, we can determine the softirq | ||
| 93 | * number. Also, when used in combination with the softirq_exit tracepoint | ||
| 94 | * we can determine the softirq latency. | ||
| 95 | */ | ||
| 96 | TRACE_EVENT(softirq_entry, | ||
| 97 | 86 | ||
| 98 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | 87 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), |
| 99 | 88 | ||
| @@ -112,6 +101,24 @@ TRACE_EVENT(softirq_entry, | |||
| 112 | ); | 101 | ); |
| 113 | 102 | ||
| 114 | /** | 103 | /** |
| 104 | * softirq_entry - called immediately before the softirq handler | ||
| 105 | * @h: pointer to struct softirq_action | ||
| 106 | * @vec: pointer to first struct softirq_action in softirq_vec array | ||
| 107 | * | ||
| 108 | * The @h parameter, contains a pointer to the struct softirq_action | ||
| 109 | * which has a pointer to the action handler that is called. By subtracting | ||
| 110 | * the @vec pointer from the @h pointer, we can determine the softirq | ||
| 111 | * number. Also, when used in combination with the softirq_exit tracepoint | ||
| 112 | * we can determine the softirq latency. | ||
| 113 | */ | ||
| 114 | DEFINE_EVENT(softirq, softirq_entry, | ||
| 115 | |||
| 116 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | ||
| 117 | |||
| 118 | TP_ARGS(h, vec) | ||
| 119 | ); | ||
| 120 | |||
| 121 | /** | ||
| 115 | * softirq_exit - called immediately after the softirq handler returns | 122 | * softirq_exit - called immediately after the softirq handler returns |
| 116 | * @h: pointer to struct softirq_action | 123 | * @h: pointer to struct softirq_action |
| 117 | * @vec: pointer to first struct softirq_action in softirq_vec array | 124 | * @vec: pointer to first struct softirq_action in softirq_vec array |
| @@ -122,22 +129,11 @@ TRACE_EVENT(softirq_entry, | |||
| 122 | * combination with the softirq_entry tracepoint we can determine the softirq | 129 | * combination with the softirq_entry tracepoint we can determine the softirq |
| 123 | * latency. | 130 | * latency. |
| 124 | */ | 131 | */ |
| 125 | TRACE_EVENT(softirq_exit, | 132 | DEFINE_EVENT(softirq, softirq_exit, |
| 126 | 133 | ||
| 127 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | 134 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), |
| 128 | 135 | ||
| 129 | TP_ARGS(h, vec), | 136 | TP_ARGS(h, vec) |
| 130 | |||
| 131 | TP_STRUCT__entry( | ||
| 132 | __field( int, vec ) | ||
| 133 | ), | ||
| 134 | |||
| 135 | TP_fast_assign( | ||
| 136 | __entry->vec = (int)(h - vec); | ||
| 137 | ), | ||
| 138 | |||
| 139 | TP_printk("vec=%d [action=%s]", __entry->vec, | ||
| 140 | show_softirq_name(__entry->vec)) | ||
| 141 | ); | 137 | ); |
| 142 | 138 | ||
| 143 | #endif /* _TRACE_IRQ_H */ | 139 | #endif /* _TRACE_IRQ_H */ |
