From: tip-bot for Li Zefan <lizf@cn.fujitsu.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
rostedt@goodmis.org, lizf@cn.fujitsu.com, tglx@linutronix.de
Subject: [tip:perf/core] tracing: Convert some timer events to DEFINE_EVENT
Date: Tue, 29 Jun 2010 09:22:19 GMT [thread overview]
Message-ID: <tip-363d0f6490f319d0dd69b7ec7503c5f6cbab36d9@git.kernel.org> (raw)
In-Reply-To: <4BFA3773.3060200@cn.fujitsu.com>
Commit-ID: 363d0f6490f319d0dd69b7ec7503c5f6cbab36d9
Gitweb: http://git.kernel.org/tip/363d0f6490f319d0dd69b7ec7503c5f6cbab36d9
Author: Li Zefan <lizf@cn.fujitsu.com>
AuthorDate: Mon, 24 May 2010 16:23:15 +0800
Committer: Steven Rostedt <rostedt@goodmis.org>
CommitDate: Mon, 28 Jun 2010 17:12:48 -0400
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>
---
include/trace/events/timer.h | 80 +++++++++++++++++-------------------------
1 files changed, 32 insertions(+), 48 deletions(-)
diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h
index 9496b96..c624126 100644
--- a/include/trace/events/timer.h
+++ b/include/trace/events/timer.h
@@ -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),
@@ -30,6 +26,17 @@ TRACE_EVENT(timer_init,
);
/**
+ * 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
* @expires: the timers expiry time
@@ -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)
);
/**
next prev parent reply other threads:[~2010-06-29 9:22 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-24 8:22 [PATCH 0/8] tracing: further shrinking trace events Li Zefan
2010-05-24 8:22 ` [PATCH 1/8] tracing: Use a global field list for all syscall exit events Li Zefan
2010-06-29 9:21 ` [tip:perf/core] " tip-bot for Li Zefan
2010-05-24 8:22 ` [PATCH 2/8] tracing: Don't allocate common fields for every trace events Li Zefan
2010-06-29 9:21 ` [tip:perf/core] " tip-bot for Li Zefan
2010-05-24 8:23 ` [PATCH 3/8] tracing: Convert some timer events to DEFINE_EVENT Li Zefan
2010-06-29 9:22 ` tip-bot for Li Zefan [this message]
2010-05-24 8:23 ` [PATCH 4/8] tracing: Conver more sched " Li Zefan
2010-06-29 9:22 ` [tip:perf/core] tracing: Convert " tip-bot for Li Zefan
2010-05-24 8:24 ` [PATCH 5/8] tracing: Convert more ext4 " Li Zefan
2010-05-25 14:57 ` tytso
2010-05-25 15:02 ` Steven Rostedt
2010-05-24 8:24 ` [PATCH 6/8] tracing: Remove test of NULL define_fields callback Li Zefan
2010-06-29 9:23 ` [tip:perf/core] " tip-bot for Li Zefan
2010-05-24 8:24 ` [PATCH 7/8] tracing: Remove redundant raw_init callbacks Li Zefan
2010-06-29 9:23 ` [tip:perf/core] " tip-bot for Li Zefan
2010-05-24 8:25 ` [PATCH 8/8] tracing: Remove open-coded __trace_add_event_call() Li Zefan
2010-06-29 9:23 ` [tip:perf/core] " tip-bot for Li Zefan
2010-05-26 17:56 ` [PATCH 0/8] tracing: further shrinking trace events Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-363d0f6490f319d0dd69b7ec7503c5f6cbab36d9@git.kernel.org \
--to=lizf@cn.fujitsu.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).