aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2010-05-24 04:23:15 -0400
committerSteven Rostedt <rostedt@goodmis.org>2010-06-28 17:12:48 -0400
commit363d0f6490f319d0dd69b7ec7503c5f6cbab36d9 (patch)
tree296c3759da30cedc9d05ef129dfa6c21538ed36b
parent8728fe501ed562c1b46dde3c195eadec77bca033 (diff)
tracing: Convert some timer events to DEFINE_EVENT
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>
-rw-r--r--include/trace/events/timer.h80
1 files changed, 32 insertions, 48 deletions
diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h
index 9496b965d62a..c624126a9c8a 100644
--- a/include/trace/events/timer.h
+++ b/include/trace/events/timer.h
@@ -8,11 +8,7 @@
8#include <linux/hrtimer.h> 8#include <linux/hrtimer.h>
9#include <linux/timer.h> 9#include <linux/timer.h>
10 10
11/** 11DECLARE_EVENT_CLASS(timer_class,
12 * timer_init - called when the timer is initialized
13 * @timer: pointer to struct timer_list
14 */
15TRACE_EVENT(timer_init,
16 12
17 TP_PROTO(struct timer_list *timer), 13 TP_PROTO(struct timer_list *timer),
18 14
@@ -30,6 +26,17 @@ TRACE_EVENT(timer_init,
30); 26);
31 27
32/** 28/**
29 * timer_init - called when the timer is initialized
30 * @timer: pointer to struct timer_list
31 */
32DEFINE_EVENT(timer_class, timer_init,
33
34 TP_PROTO(struct timer_list *timer),
35
36 TP_ARGS(timer)
37);
38
39/**
33 * timer_start - called when the timer is started 40 * timer_start - called when the timer is started
34 * @timer: pointer to struct timer_list 41 * @timer: pointer to struct timer_list
35 * @expires: the timers expiry time 42 * @expires: the timers expiry time
@@ -94,42 +101,22 @@ TRACE_EVENT(timer_expire_entry,
94 * NOTE: Do NOT derefernce timer in TP_fast_assign. The pointer might 101 * NOTE: Do NOT derefernce timer in TP_fast_assign. The pointer might
95 * be invalid. We solely track the pointer. 102 * be invalid. We solely track the pointer.
96 */ 103 */
97TRACE_EVENT(timer_expire_exit, 104DEFINE_EVENT(timer_class, timer_expire_exit,
98 105
99 TP_PROTO(struct timer_list *timer), 106 TP_PROTO(struct timer_list *timer),
100 107
101 TP_ARGS(timer), 108 TP_ARGS(timer)
102
103 TP_STRUCT__entry(
104 __field(void *, timer )
105 ),
106
107 TP_fast_assign(
108 __entry->timer = timer;
109 ),
110
111 TP_printk("timer=%p", __entry->timer)
112); 109);
113 110
114/** 111/**
115 * timer_cancel - called when the timer is canceled 112 * timer_cancel - called when the timer is canceled
116 * @timer: pointer to struct timer_list 113 * @timer: pointer to struct timer_list
117 */ 114 */
118TRACE_EVENT(timer_cancel, 115DEFINE_EVENT(timer_class, timer_cancel,
119 116
120 TP_PROTO(struct timer_list *timer), 117 TP_PROTO(struct timer_list *timer),
121 118
122 TP_ARGS(timer), 119 TP_ARGS(timer)
123
124 TP_STRUCT__entry(
125 __field( void *, timer )
126 ),
127
128 TP_fast_assign(
129 __entry->timer = timer;
130 ),
131
132 TP_printk("timer=%p", __entry->timer)
133); 120);
134 121
135/** 122/**
@@ -224,14 +211,7 @@ TRACE_EVENT(hrtimer_expire_entry,
224 (unsigned long long)ktime_to_ns((ktime_t) { .tv64 = __entry->now })) 211 (unsigned long long)ktime_to_ns((ktime_t) { .tv64 = __entry->now }))
225 ); 212 );
226 213
227/** 214DECLARE_EVENT_CLASS(hrtimer_class,
228 * hrtimer_expire_exit - called immediately after the hrtimer callback returns
229 * @timer: pointer to struct hrtimer
230 *
231 * When used in combination with the hrtimer_expire_entry tracepoint we can
232 * determine the runtime of the callback function.
233 */
234TRACE_EVENT(hrtimer_expire_exit,
235 215
236 TP_PROTO(struct hrtimer *hrtimer), 216 TP_PROTO(struct hrtimer *hrtimer),
237 217
@@ -249,24 +229,28 @@ TRACE_EVENT(hrtimer_expire_exit,
249); 229);
250 230
251/** 231/**
252 * hrtimer_cancel - called when the hrtimer is canceled 232 * hrtimer_expire_exit - called immediately after the hrtimer callback returns
253 * @hrtimer: pointer to struct hrtimer 233 * @timer: pointer to struct hrtimer
234 *
235 * When used in combination with the hrtimer_expire_entry tracepoint we can
236 * determine the runtime of the callback function.
254 */ 237 */
255TRACE_EVENT(hrtimer_cancel, 238DEFINE_EVENT(hrtimer_class, hrtimer_expire_exit,
256 239
257 TP_PROTO(struct hrtimer *hrtimer), 240 TP_PROTO(struct hrtimer *hrtimer),
258 241
259 TP_ARGS(hrtimer), 242 TP_ARGS(hrtimer)
243);
260 244
261 TP_STRUCT__entry( 245/**
262 __field( void *, hrtimer ) 246 * hrtimer_cancel - called when the hrtimer is canceled
263 ), 247 * @hrtimer: pointer to struct hrtimer
248 */
249DEFINE_EVENT(hrtimer_class, hrtimer_cancel,
264 250
265 TP_fast_assign( 251 TP_PROTO(struct hrtimer *hrtimer),
266 __entry->hrtimer = hrtimer;
267 ),
268 252
269 TP_printk("hrtimer=%p", __entry->hrtimer) 253 TP_ARGS(hrtimer)
270); 254);
271 255
272/** 256/**