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

Steven Rostedt
2009-03-12T22:45:08Z

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