From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <peterz@infradead.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>,
Mathieu Desnoyers <compudj@krystal.dyndns.org>,
Lai Jiangshan <laijs@cn.fujitsu.com>,
Li Zefan <lizf@cn.fujitsu.com>, Christoph Hellwig <hch@lst.de>,
Wu Fengguang <fengguang.wu@intel.com>
Subject: [PATCH 2/2 v2] tracing: Add extract out softirq names used by irq trace events
Date: Fri, 26 Feb 2010 00:38:33 -0500 [thread overview]
Message-ID: <20100226054125.508188403@goodmis.org> (raw)
In-Reply-To: 20100226053831.050130780@goodmis.org
[-- Attachment #1: irq-events-v2.patch --]
[-- Type: text/plain, Size: 3049 bytes --]
The irq trace events that map the softirq vectors to strings
shows up in the format files as names. To allow binary parsers to
be able to convert these names to their actual numbers, this patch
extracts those enums.
In doing this, we also change the way the softirq names are defined.
This gives us a tight coupling between the names and what is exported
as well as used by the __print_symbolic() macro.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
include/linux/interrupt.h | 29 ++++++++++++++++++-----------
include/trace/events/irq.h | 22 ++++++++++------------
2 files changed, 28 insertions(+), 23 deletions(-)
Index: linux-trace.git/include/trace/events/irq.h
===================================================================
--- linux-trace.git.orig/include/trace/events/irq.h 2010-02-25 21:47:57.000000000 -0500
+++ linux-trace.git/include/trace/events/irq.h 2010-02-25 23:06:16.000000000 -0500
@@ -7,19 +7,15 @@
#include <linux/tracepoint.h>
#include <linux/interrupt.h>
-#define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq }
+#define C(sirq) \
+ TRACE_SYMBOL_PARSE(#sirq, sirq##_SOFTIRQ, sizeof(sirq##_SOFTIRQ))
+
+EXTRACT_TRACE_SYMBOLS(softirqs, SOFTIRQ_NAMES);
+
+#undef C
+#define C(sirq) { sirq##_SOFTIRQ, #sirq }
#define show_softirq_name(val) \
- __print_symbolic(val, \
- softirq_name(HI), \
- softirq_name(TIMER), \
- softirq_name(NET_TX), \
- softirq_name(NET_RX), \
- softirq_name(BLOCK), \
- softirq_name(BLOCK_IOPOLL), \
- softirq_name(TASKLET), \
- softirq_name(SCHED), \
- softirq_name(HRTIMER), \
- softirq_name(RCU))
+ __print_symbolic(val, SOFTIRQ_NAMES)
/**
* irq_handler_entry - called immediately before the irq action handler
@@ -136,6 +132,8 @@ DEFINE_EVENT(softirq, softirq_exit,
TP_ARGS(h, vec)
);
+#undef C
+
#endif /* _TRACE_IRQ_H */
/* This part must be outside protection */
Index: linux-trace.git/include/linux/interrupt.h
===================================================================
--- linux-trace.git.orig/include/linux/interrupt.h 2010-02-25 21:47:49.000000000 -0500
+++ linux-trace.git/include/linux/interrupt.h 2010-02-25 21:54:59.000000000 -0500
@@ -338,21 +338,28 @@ static inline int disable_irq_wake(unsig
al. should be converted to tasklets, not to softirqs.
*/
+#define SOFTIRQ_NAMES \
+ C(HI), \
+ C(TIMER), \
+ C(NET_TX), \
+ C(NET_RX), \
+ C(BLOCK), \
+ C(BLOCK_IOPOLL), \
+ C(TASKLET), \
+ C(SCHED), \
+ C(HRTIMER), \
+ /* Preferable RCU should always be the last softirq */ \
+ C(RCU)
+
+#undef C
+#define C(name) name##_SOFTIRQ
+
enum
{
- HI_SOFTIRQ=0,
- TIMER_SOFTIRQ,
- NET_TX_SOFTIRQ,
- NET_RX_SOFTIRQ,
- BLOCK_SOFTIRQ,
- BLOCK_IOPOLL_SOFTIRQ,
- TASKLET_SOFTIRQ,
- SCHED_SOFTIRQ,
- HRTIMER_SOFTIRQ,
- RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */
-
+ SOFTIRQ_NAMES,
NR_SOFTIRQS
};
+#undef C
/* map softirq index to softirq name. update 'softirq_to_name' in
* kernel/softirq.c when adding a new softirq.
prev parent reply other threads:[~2010-02-26 5:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-26 5:38 [PATCH 0/2 v2] [RFC] tracing: Showing symbols for TRACE_EVENT Steven Rostedt
2010-02-26 5:38 ` [PATCH 1/2 v2] tracing: Add EXTRACT_TRACE_SYMBOL() macro Steven Rostedt
2010-02-27 11:52 ` Frederic Weisbecker
2010-02-26 5:38 ` Steven Rostedt [this message]
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=20100226054125.508188403@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=compudj@krystal.dyndns.org \
--cc=fengguang.wu@intel.com \
--cc=fweisbec@gmail.com \
--cc=hch@lst.de \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=mingo@elte.hu \
--cc=peterz@infradead.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