]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
tracing: Convert some timer events to DEFINE_EVENT
authorLi Zefan <lizf@cn.fujitsu.com>
Mon, 24 May 2010 08:23:15 +0000 (16:23 +0800)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 28 Jun 2010 21:12:48 +0000 (17:12 -0400)
Use DECLARE_EVENT_CLASS, and save ~2.3K:

   text    data     bss     dec     hex filename
7018823 2031888 7251132 16301843         f8bf13 vmlinux.o.orig
7016727 2031696 7251132 16299555         f8b623 vmlinux.o

5 events are converted:

  timer_class:   timer_init, timer_expire_exit, timer_cancel
  hrtimer_class: hrtimer_init, hrtimer_cancel

No change in functionality.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <4BFA3773.3060200@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
include/trace/events/timer.h

index 9496b965d62ad9dd39929ccc7e471c7fcf2d374a..c624126a9c8a6fb889fe596ea261f649236d51a7 100644 (file)
@@ -8,11 +8,7 @@
 #include <linux/hrtimer.h>
 #include <linux/timer.h>
 
-/**
- * timer_init - called when the timer is initialized
- * @timer:     pointer to struct timer_list
- */
-TRACE_EVENT(timer_init,
+DECLARE_EVENT_CLASS(timer_class,
 
        TP_PROTO(struct timer_list *timer),
 
@@ -29,6 +25,17 @@ TRACE_EVENT(timer_init,
        TP_printk("timer=%p", __entry->timer)
 );
 
+/**
+ * timer_init - called when the timer is initialized
+ * @timer:     pointer to struct timer_list
+ */
+DEFINE_EVENT(timer_class, timer_init,
+
+       TP_PROTO(struct timer_list *timer),
+
+       TP_ARGS(timer)
+);
+
 /**
  * timer_start - called when the timer is started
  * @timer:     pointer to struct timer_list
@@ -94,42 +101,22 @@ TRACE_EVENT(timer_expire_entry,
  * NOTE: Do NOT derefernce timer in TP_fast_assign. The pointer might
  * be invalid. We solely track the pointer.
  */
-TRACE_EVENT(timer_expire_exit,
+DEFINE_EVENT(timer_class, timer_expire_exit,
 
        TP_PROTO(struct timer_list *timer),
 
-       TP_ARGS(timer),
-
-       TP_STRUCT__entry(
-               __field(void *, timer   )
-       ),
-
-       TP_fast_assign(
-               __entry->timer  = timer;
-       ),
-
-       TP_printk("timer=%p", __entry->timer)
+       TP_ARGS(timer)
 );
 
 /**
  * timer_cancel - called when the timer is canceled
  * @timer:     pointer to struct timer_list
  */
-TRACE_EVENT(timer_cancel,
+DEFINE_EVENT(timer_class, timer_cancel,
 
        TP_PROTO(struct timer_list *timer),
 
-       TP_ARGS(timer),
-
-       TP_STRUCT__entry(
-               __field( void *,        timer   )
-       ),
-
-       TP_fast_assign(
-               __entry->timer  = timer;
-       ),
-
-       TP_printk("timer=%p", __entry->timer)
+       TP_ARGS(timer)
 );
 
 /**
@@ -224,14 +211,7 @@ TRACE_EVENT(hrtimer_expire_entry,
                  (unsigned long long)ktime_to_ns((ktime_t) { .tv64 = __entry->now }))
  );
 
-/**
- * hrtimer_expire_exit - called immediately after the hrtimer callback returns
- * @timer:     pointer to struct hrtimer
- *
- * When used in combination with the hrtimer_expire_entry tracepoint we can
- * determine the runtime of the callback function.
- */
-TRACE_EVENT(hrtimer_expire_exit,
+DECLARE_EVENT_CLASS(hrtimer_class,
 
        TP_PROTO(struct hrtimer *hrtimer),
 
@@ -249,24 +229,28 @@ TRACE_EVENT(hrtimer_expire_exit,
 );
 
 /**
- * hrtimer_cancel - called when the hrtimer is canceled
- * @hrtimer:   pointer to struct hrtimer
+ * hrtimer_expire_exit - called immediately after the hrtimer callback returns
+ * @timer:     pointer to struct hrtimer
+ *
+ * When used in combination with the hrtimer_expire_entry tracepoint we can
+ * determine the runtime of the callback function.
  */
-TRACE_EVENT(hrtimer_cancel,
+DEFINE_EVENT(hrtimer_class, hrtimer_expire_exit,
 
        TP_PROTO(struct hrtimer *hrtimer),
 
-       TP_ARGS(hrtimer),
+       TP_ARGS(hrtimer)
+);
 
-       TP_STRUCT__entry(
-               __field( void *,        hrtimer )
-       ),
+/**
+ * hrtimer_cancel - called when the hrtimer is canceled
+ * @hrtimer:   pointer to struct hrtimer
+ */
+DEFINE_EVENT(hrtimer_class, hrtimer_cancel,
 
-       TP_fast_assign(
-               __entry->hrtimer        = hrtimer;
-       ),
+       TP_PROTO(struct hrtimer *hrtimer),
 
-       TP_printk("hrtimer=%p", __entry->hrtimer)
+       TP_ARGS(hrtimer)
 );
 
 /**