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 --- 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 #include -#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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/