Re: [Patch 1/2] tracepoints for softirq entry/exit - add softirq-to-namearray

From: Steven Rostedt
Date: Thu Mar 12 2009 - 18:45:10 EST



On Thu, 12 Mar 2009, Frederic Weisbecker wrote:
> > @@ -53,6 +53,12 @@ static struct softirq_action softirq_vec[NR_SOFTIRQS] __cacheline_aligned_in_smp
> >
> > static DEFINE_PER_CPU(struct task_struct *, ksoftirqd);
> >
> > +char *softirq_to_name[NR_SOFTIRQS] = {
> > + "HI_SOFTIRQ", "TIMER_SOFTIRQ", "NET_TX_SOFTIRQ", "NET_RX_SOFTIRQ",
> > + "BLOCK_SOFTIRQ", "TASKLET_SOFTIRQ", "SCHED_SOFTIRQ", "HRTIMER_SOFTIRQ",
> > + "RCU_SOFTIRQ"
> > +};
>
>
> Hi,
>
> May be you could abuse open_softirq() to append dynamically these entries:
>
> char *softirq_to_name[NR_SOFTIRQS];
>
> #define open_softirq(nr, func) \
> softirq_to_name[nr] = __stringify(nr); \
> __open_softirq(nr, func);
>
> So that it's a bit more scalable.
>

Softirqs are pretty much set. If anything, they may even disappear (if the
threaded interrupts take off). So hardcoding it should not be an issue.

-- Steve

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