All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Baron <jbaron@redhat.com>
To: mingo@elte.hu, rostedt@goodmis.org
Cc: linux-kernel@vger.kernel.org, acme@ghostprotocols.net,
	fweisbec@gmail.com, fche@redhat.com, peterz@infradead.org,
	compudj@krystal.dyndns.org
Subject: Re: [Patch 1/2] tracepoints for softirq entry/exit - add softirq-to-name array
Date: Mon, 16 Mar 2009 14:58:48 -0400	[thread overview]
Message-ID: <20090316185848.GA3111@redhat.com> (raw)
In-Reply-To: <20090312183336.GB3352@redhat.com>

hi,

I've update both patches to incorporate changes that were suggested - 
I've shortened the softirq string name and made it 'const'. Below is a
re-spun patch 1/2.

thanks,

-Jason


Signed-off-by: Jason Baron <jbaron@redhat.com>


---

 include/linux/interrupt.h |    6 ++++++
 kernel/softirq.c          |    8 +++++++-
 2 files changed, 13 insertions(+), 1 deletions(-)


diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index e7bcfd7..dd3ff3f 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -258,6 +258,12 @@ enum
 	NR_SOFTIRQS
 };
 
+/* map softirq index to softirq name. update 'softirq_to_name' in
+ * kernel/softirq.c when adding a new softirq.
+ */
+#define MAX_SOFTIRQ_NAME_LEN 10
+extern const char softirq_to_name[NR_SOFTIRQS][MAX_SOFTIRQ_NAME_LEN];
+
 /* softirq mask and active fields moved to irq_cpustat_t in
  * asm/hardirq.h to get better cache usage.  KAO
  */
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 40ff3cf..8f3ae57 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -53,6 +53,11 @@ static struct softirq_action softirq_vec[NR_SOFTIRQS] __cacheline_aligned_in_smp
 
 static DEFINE_PER_CPU(struct task_struct *, ksoftirqd);
 
+const char softirq_to_name[NR_SOFTIRQS][MAX_SOFTIRQ_NAME_LEN] = {
+	"HI", "TIMER", "NET_TX", "NET_RX", "BLOCK", "TASKLET", "SCHED",
+	"HRTIMER", "RCU"
+};
+
 /*
  * we cannot loop indefinitely here to avoid userspace starvation,
  * but we also don't want to introduce a worst case 1/HZ latency
@@ -209,9 +214,10 @@ restart:
 			h->action(h);
 
 			if (unlikely(prev_count != preempt_count())) {
-				printk(KERN_ERR "huh, entered softirq %td %p"
+				printk(KERN_ERR "huh, entered softirq %td %s %p"
 				       "with preempt_count %08x,"
 				       " exited with %08x?\n", h - softirq_vec,
+				       softirq_to_name[h - softirq_vec],
 				       h->action, prev_count, preempt_count());
 				preempt_count() = prev_count;
 			}



      parent reply	other threads:[~2009-03-16 19:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-12 18:33 [Patch 1/2] tracepoints for softirq entry/exit - add softirq-to-name array Jason Baron
2009-03-12 18:45 ` Frederic Weisbecker
2009-03-12 22:44   ` Steven Rostedt
2009-03-13  4:02 ` [tip:tracing/ftrace] tracing: " Jason Baron
2009-03-14  2:53 ` [Patch 1/2] " Mathieu Desnoyers
2009-03-16 18:58 ` Jason Baron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090316185848.GA3111@redhat.com \
    --to=jbaron@redhat.com \
    --cc=acme@ghostprotocols.net \
    --cc=compudj@krystal.dyndns.org \
    --cc=fche@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.