From: Li Zefan <lizf@cn.fujitsu.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/9] tracing: Convert softirq events to DEFINE_EVENT
Date: Thu, 26 Nov 2009 15:04:31 +0800 [thread overview]
Message-ID: <4B0E287F.4030708@cn.fujitsu.com> (raw)
In-Reply-To: <4B0E2807.4060102@cn.fujitsu.com>
Use TRACE_EVENT_TEMPLATE 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
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
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 dcfcd44..f8a94d7 100644
--- a/include/trace/events/irq.h
+++ b/include/trace/events/irq.h
@@ -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,
+TRACE_EVENT_TEMPLATE(softirq,
TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
@@ -112,6 +101,24 @@ TRACE_EVENT(softirq_entry,
);
/**
+ * 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
* @vec: pointer to first struct softirq_action in softirq_vec array
@@ -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 */
--
1.6.3
next prev parent reply other threads:[~2009-11-26 7:04 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-26 7:02 [PATCH 0/9] tracing: Convert some trace events to DEFINE_TRACE Li Zefan
2009-11-26 7:03 ` [PATCH 1/9] tracing: Convert module refcnt events to DEFINE_EVENT Li Zefan
2009-11-26 8:42 ` [tip:perf/core] " tip-bot for Li Zefan
2009-11-26 7:04 ` [PATCH 2/9] tracing: Convert some kmem " Li Zefan
2009-11-26 7:24 ` Pekka Enberg
2009-11-26 7:38 ` Steven Rostedt
2009-11-26 7:57 ` Ingo Molnar
2009-11-26 8:29 ` Steven Rostedt
2009-11-26 8:16 ` [tip:perf/core] events: Rename TRACE_EVENT_TEMPLATE() to DECLARE_EVENT_CLASS() tip-bot for Ingo Molnar
2009-11-26 8:33 ` Steven Rostedt
2009-11-26 8:40 ` Ingo Molnar
2009-11-26 14:45 ` Steven Rostedt
2009-11-26 17:55 ` Frederic Weisbecker
2009-11-26 18:12 ` Ingo Molnar
2009-11-26 19:12 ` Steven Rostedt
2009-11-26 19:20 ` Ingo Molnar
2009-11-26 19:44 ` Steven Rostedt
2009-11-26 19:47 ` Steven Rostedt
2009-11-26 23:13 ` Frederic Weisbecker
2009-11-27 3:52 ` Steven Rostedt
2009-11-26 8:42 ` [tip:perf/core] tracing: Convert some kmem events to DEFINE_EVENT tip-bot for Li Zefan
2009-11-26 12:34 ` [tip:perf/core] tracing: Fix kmem event exports tip-bot for Ingo Molnar
2009-11-26 7:04 ` Li Zefan [this message]
2009-11-26 8:43 ` [tip:perf/core] tracing: Convert softirq events to DEFINE_EVENT tip-bot for Li Zefan
2009-11-26 7:05 ` [PATCH 4/9] tracing: Convert some workqueue " Li Zefan
2009-11-26 8:43 ` [tip:perf/core] " tip-bot for Li Zefan
2009-11-26 7:05 ` [PATCH 5/9] tracing: Convert some power " Li Zefan
2009-11-26 8:43 ` [tip:perf/core] " tip-bot for Li Zefan
2009-11-26 7:06 ` [PATCH 6/9] tracing: Convert some block " Li Zefan
2009-11-26 8:36 ` Jens Axboe
2009-11-26 8:44 ` Ingo Molnar
2009-11-26 8:47 ` Jens Axboe
2009-11-26 8:50 ` Ingo Molnar
2009-11-26 8:52 ` Jens Axboe
2009-11-26 8:43 ` [tip:perf/core] " tip-bot for Li Zefan
2009-11-26 7:06 ` [PATCH 7/9] tracing: Convert some jbd2 " Li Zefan
2009-11-26 8:44 ` [tip:perf/core] " tip-bot for Li Zefan
2009-11-26 7:07 ` [PATCH 8/9] tracing: Convert some ext4 events to DEFINE_TRACE Li Zefan
2009-11-26 8:44 ` [tip:perf/core] " tip-bot for Li Zefan
2009-11-26 7:08 ` [PATCH 9/9] tracing: Restore original format of sched events Li Zefan
2009-11-26 8:44 ` [tip:perf/core] " tip-bot for Li Zefan
2009-11-26 7:32 ` [PATCH 0/9] tracing: Convert some trace events to DEFINE_TRACE Steven Rostedt
2009-11-26 7:59 ` Ingo Molnar
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=4B0E287F.4030708@cn.fujitsu.com \
--to=lizf@cn.fujitsu.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
/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