public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tracing/irq: use softirq_to_name instead of __print_symbolic
@ 2009-06-01  8:52 Li Zefan
  2009-06-01 14:36 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Li Zefan @ 2009-06-01  8:52 UTC (permalink / raw)
  To: Steven Rostedt, Frederic Weisbecker; +Cc: Ingo Molnar, LKML

| commit c2adae0970ca1db8adb92fb56ae3bcabd916e8bd
| Author: Steven Rostedt <srostedt@redhat.com>
| Date:   Wed May 20 19:56:19 2009 -0400
|
|    tracing: convert irq events to use __print_symbolic
|
|    The recording of the names at trace time is inefficient. This patch
|    implements the softirq event recording to only record the vector
|    and then use the __print_symbolic interface to print out the names.
|
|    [ Impact: faster recording of softirq events ]

It's great to boost recording of softirq events, but why not simply
use softirq_to_name in TP_printk()?

The above commit has 2 flaws:

  - we waste memory defining local static struct trace_print_flags array
    in each softirq TRACE_EVENT
  - if someone adds/removes a softirq, he may not know show_softirq_name()
    needs to be updated

Another issue with the above commit, that the output of softirq events
becomes:

  X-1701  [000]  1595.220739: softirq_entry: softirq=1 action=TIMER_SOFTIRQ

Compared to the original output:

  X-1701  [000]  1595.220739: softirq_entry: softirq=1 action=TIMER

[ Impact: reserve the original output format of softirq events ]

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 include/trace/events/irq.h |   17 ++---------------
 1 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h
index 683fb36..2ff9998 100644
--- a/include/trace/events/irq.h
+++ b/include/trace/events/irq.h
@@ -7,19 +7,6 @@
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM irq
 
-#define softirq_name(sirq) { sirq, #sirq }
-#define show_softirq_name(val)						\
-	__print_symbolic(val,						\
-			 softirq_name(HI_SOFTIRQ),			\
-			 softirq_name(TIMER_SOFTIRQ),			\
-			 softirq_name(NET_TX_SOFTIRQ),			\
-			 softirq_name(NET_RX_SOFTIRQ),			\
-			 softirq_name(BLOCK_SOFTIRQ),			\
-			 softirq_name(TASKLET_SOFTIRQ),			\
-			 softirq_name(SCHED_SOFTIRQ),			\
-			 softirq_name(HRTIMER_SOFTIRQ),			\
-			 softirq_name(RCU_SOFTIRQ))
-
 /**
  * irq_handler_entry - called immediately before the irq action handler
  * @irq: irq number
@@ -107,7 +94,7 @@ TRACE_EVENT(softirq_entry,
 	),
 
 	TP_printk("softirq=%d action=%s", __entry->vec,
-		  show_softirq_name(__entry->vec))
+		  softirq_to_name[__entry->vec])
 );
 
 /**
@@ -136,7 +123,7 @@ TRACE_EVENT(softirq_exit,
 	),
 
 	TP_printk("softirq=%d action=%s", __entry->vec,
-		  show_softirq_name(__entry->vec))
+		  softirq_to_name[__entry->vec])
 );
 
 #endif /*  _TRACE_IRQ_H */
-- 
1.5.4.rc3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-06-02  1:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-01  8:52 [PATCH] tracing/irq: use softirq_to_name instead of __print_symbolic Li Zefan
2009-06-01 14:36 ` Christoph Hellwig
2009-06-01 15:06   ` Steven Rostedt
2009-06-02  1:31     ` Li Zefan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox