tracing: Convert softirq events to DEFINE_EVENT
authorLi Zefan <lizf@cn.fujitsu.com>
Thu, 26 Nov 2009 07:04:31 +0000 (15:04 +0800)
committerIngo Molnar <mingo@elte.hu>
Thu, 26 Nov 2009 08:14:03 +0000 (09:14 +0100)
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>
include/trace/events/irq.h

index dcfcd44076232700f14d5a6ff68c3f5e7b8e1ef2..0e4cfb694fe70630457af67e1b1bc568f56c9b09 100644 (file)
@@ -82,18 +82,7 @@ TRACE_EVENT(irq_handler_exit,
                  __entry->irq, __entry->ret ? "handled" : "unhandled")
 );
 
-/**
- * softirq_entry - called immediately before the softirq handler
- * @h: pointer to struct softirq_action
- * @vec: pointer to first struct softirq_action in softirq_vec array
- *
- * The @h parameter, contains a pointer to the struct softirq_action
- * which has a pointer to the action handler that is called. By subtracting
- * the @vec pointer from the @h pointer, we can determine the softirq
- * number. Also, when used in combination with the softirq_exit tracepoint
- * we can determine the softirq latency.
- */
-TRACE_EVENT(softirq_entry,
+DECLARE_EVENT_CLASS(softirq,
 
        TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
 
@@ -111,6 +100,24 @@ TRACE_EVENT(softirq_entry,
                  show_softirq_name(__entry->vec))
 );
 
+/**
+ * softirq_entry - called immediately before the softirq handler
+ * @h: pointer to struct softirq_action
+ * @vec: pointer to first struct softirq_action in softirq_vec array
+ *
+ * The @h parameter, contains a pointer to the struct softirq_action
+ * which has a pointer to the action handler that is called. By subtracting
+ * the @vec pointer from the @h pointer, we can determine the softirq
+ * number. Also, when used in combination with the softirq_exit tracepoint
+ * we can determine the softirq latency.
+ */
+DEFINE_EVENT(softirq, softirq_entry,
+
+       TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
+
+       TP_ARGS(h, vec)
+);
+
 /**
  * softirq_exit - called immediately after the softirq handler returns
  * @h: pointer to struct softirq_action
@@ -122,22 +129,11 @@ TRACE_EVENT(softirq_entry,
  * combination with the softirq_entry tracepoint we can determine the softirq
  * latency.
  */
-TRACE_EVENT(softirq_exit,
+DEFINE_EVENT(softirq, softirq_exit,
 
        TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
 
-       TP_ARGS(h, vec),
-
-       TP_STRUCT__entry(
-               __field(        int,    vec                     )
-       ),
-
-       TP_fast_assign(
-               __entry->vec = (int)(h - vec);
-       ),
-
-       TP_printk("vec=%d [action=%s]", __entry->vec,
-                 show_softirq_name(__entry->vec))
+       TP_ARGS(h, vec)
 );
 
 #endif /*  _TRACE_IRQ_H */