public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Baron <jbaron@redhat.com>
To: Joe Perches <joe@perches.com>
Cc: Youquan Song <youquan.song@intel.com>,
	linux-kernel@vger.kernel.org, hpa@linux.intel.com,
	suresh.b.siddha@intel.com, arjan@linux.intel.com, trenn@suse.de,
	kent.liu@intel.com, chaohong.guo@intel.com,
	Youquan Song <youquan.song@linux.intel.com>
Subject: Re: [PATCH 2/2] apic: Add print error interrupt reason
Date: Thu, 6 Jan 2011 17:13:03 -0500	[thread overview]
Message-ID: <20110106221302.GC12913@redhat.com> (raw)
In-Reply-To: <1294288492.12561.46.camel@Joe-Laptop>

On Wed, Jan 05, 2011 at 08:34:51PM -0800, Joe Perches wrote:
> On Thu, 2011-01-06 at 11:28 +0800, Youquan Song wrote:
> > End user worry about the error interrupt information and intend to know what
> > kind of error interrupts are generated, so this patch add printing out the
> > detail debug information of error interrupt. 
> > 
> > Signed-off-by: Youquan Song <youquan.song@intel.com>
> > ---
> >  arch/x86/kernel/apic/apic.c |   28 +++++++++++++++++++++++++++-
> >  1 files changed, 27 insertions(+), 1 deletions(-)
> > 
> > diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
> []
> > +static const char *error_interrupt_reason[] = {
> 
> static const char * const etc[]
> 
> > +	"Send CS error",
> > +	"Receive CS error",
> > +	"Send accept error",
> > +	"Receive accept error",
> > +	"Redirectable IPI",
> > +	"Send illegal vector",
> > +	"Received illegal vector",
> > +	"Illegal register address",
> > +};
> > +
> > +static void print_error_interrupt_reason(u32 reason)
> > +{
> > +	u32 i = 0;
> > +	reason = reason & 0xff;
> > +	do {
> > +		if (reason & 0x1)
> > +			pr_debug(" : %s", error_interrupt_reason[i]);
> 
> This isn't correct as it will emit <7> for each reason.
> 
> You want pr_cont surrounded by #ifdef DEBUG
> or some new #define pr_debug_cont in printk.h
> but that won't play well with dynamic_debug.
> 
> Jason?  Got a cure for this?
> 
> 

hmmm...right, we could introduce a pr_debug_cont(), but I think it would
be complex to implement, since we would have to pass a reference to
where we are continued from...the #ifdef DEBUG isn't great either, since
we need this for every pr_debug() statement which might be followed by a
pr_cont()...

perhaps, the simplest thing is just to code this explicitly as:
printk(KERN_DEBUG, blah), followed by the regular pr_cont()?

thanks,

-Jason

  reply	other threads:[~2011-01-06 22:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-06  3:28 [PATCH 0/2] apic: Fix error interrupt report at all APs Youquan Song
2011-01-06  3:28 ` [PATCH 1/2] " Youquan Song
2011-01-06  3:28   ` [PATCH 2/2] apic: Add print error interrupt reason Youquan Song
2011-01-06  4:34     ` Joe Perches
2011-01-06 22:13       ` Jason Baron [this message]
2011-01-06  9:27   ` [PATCH 1/2] apic: Fix error interrupt report at all APs Yong Wang
2011-01-07  2:04     ` Youquan Song
2011-01-07  2:01       ` Suresh Siddha

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=20110106221302.GC12913@redhat.com \
    --to=jbaron@redhat.com \
    --cc=arjan@linux.intel.com \
    --cc=chaohong.guo@intel.com \
    --cc=hpa@linux.intel.com \
    --cc=joe@perches.com \
    --cc=kent.liu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=suresh.b.siddha@intel.com \
    --cc=trenn@suse.de \
    --cc=youquan.song@intel.com \
    --cc=youquan.song@linux.intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox