lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A2396C7.3000700@cn.fujitsu.com>
Date:	Mon, 01 Jun 2009 16:52:23 +0800
From:	Li Zefan <lizf@...fujitsu.com>
To:	Steven Rostedt <rostedt@...dmis.org>,
	Frederic Weisbecker <fweisbec@...il.com>
CC:	Ingo Molnar <mingo@...e.hu>, LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] tracing/irq: use softirq_to_name instead of __print_symbolic

| commit c2adae0970ca1db8adb92fb56ae3bcabd916e8bd
| Author: Steven Rostedt <srostedt@...hat.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@...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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ