diff options
author | Jason Baron <jbaron@redhat.com> | 2009-03-12 14:33:36 -0400 |
---|---|---|
committer | Steven Rostedt <srostedt@redhat.com> | 2009-03-12 21:15:02 -0400 |
commit | 5d592b44b29a1d73e13d5c9e3426eed843bdc359 (patch) | |
tree | e26ec625e6fb5efdbbf41d0bba940a2dbac19f50 | |
parent | e447e1df2e568cd43d1918963c9f09fae85aea57 (diff) |
tracing: tracepoints for softirq entry/exit - add softirq-to-name array
Create a 'softirq_to_name' array, which is indexed by softirq #, so
that we can easily convert between the softirq index # and its name, in
order to get more meaningful output messages.
LKML-Reference: <20090312183336.GB3352@redhat.com>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
-rw-r--r-- | include/linux/interrupt.h | 5 | ||||
-rw-r--r-- | kernel/softirq.c | 9 |
2 files changed, 13 insertions, 1 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 472f11765f60..9b7e9d743476 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -258,6 +258,11 @@ enum | |||
258 | NR_SOFTIRQS | 258 | NR_SOFTIRQS |
259 | }; | 259 | }; |
260 | 260 | ||
261 | /* map softirq index to softirq name. update 'softirq_to_name' in | ||
262 | * kernel/softirq.c when adding a new softirq. | ||
263 | */ | ||
264 | extern char *softirq_to_name[NR_SOFTIRQS]; | ||
265 | |||
261 | /* softirq mask and active fields moved to irq_cpustat_t in | 266 | /* softirq mask and active fields moved to irq_cpustat_t in |
262 | * asm/hardirq.h to get better cache usage. KAO | 267 | * asm/hardirq.h to get better cache usage. KAO |
263 | */ | 268 | */ |
diff --git a/kernel/softirq.c b/kernel/softirq.c index 7571bcb71be4..9f90fdc039f4 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c | |||
@@ -53,6 +53,12 @@ static struct softirq_action softirq_vec[NR_SOFTIRQS] __cacheline_aligned_in_smp | |||
53 | 53 | ||
54 | static DEFINE_PER_CPU(struct task_struct *, ksoftirqd); | 54 | static DEFINE_PER_CPU(struct task_struct *, ksoftirqd); |
55 | 55 | ||
56 | char *softirq_to_name[NR_SOFTIRQS] = { | ||
57 | "HI_SOFTIRQ", "TIMER_SOFTIRQ", "NET_TX_SOFTIRQ", "NET_RX_SOFTIRQ", | ||
58 | "BLOCK_SOFTIRQ", "TASKLET_SOFTIRQ", "SCHED_SOFTIRQ", "HRTIMER_SOFTIRQ", | ||
59 | "RCU_SOFTIRQ" | ||
60 | }; | ||
61 | |||
56 | /* | 62 | /* |
57 | * we cannot loop indefinitely here to avoid userspace starvation, | 63 | * we cannot loop indefinitely here to avoid userspace starvation, |
58 | * but we also don't want to introduce a worst case 1/HZ latency | 64 | * but we also don't want to introduce a worst case 1/HZ latency |
@@ -209,9 +215,10 @@ restart: | |||
209 | h->action(h); | 215 | h->action(h); |
210 | 216 | ||
211 | if (unlikely(prev_count != preempt_count())) { | 217 | if (unlikely(prev_count != preempt_count())) { |
212 | printk(KERN_ERR "huh, entered softirq %td %p" | 218 | printk(KERN_ERR "huh, entered softirq %td %s %p" |
213 | "with preempt_count %08x," | 219 | "with preempt_count %08x," |
214 | " exited with %08x?\n", h - softirq_vec, | 220 | " exited with %08x?\n", h - softirq_vec, |
221 | softirq_to_name[h - softirq_vec], | ||
215 | h->action, prev_count, preempt_count()); | 222 | h->action, prev_count, preempt_count()); |
216 | preempt_count() = prev_count; | 223 | preempt_count() = prev_count; |
217 | } | 224 | } |