All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Stefan Weil <weil@mail.berlios.de>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] Add support for CPU_LOG_INT (MIPS targets)
Date: Tue, 14 Oct 2008 21:54:29 +0200	[thread overview]
Message-ID: <20081014195429.GA28076@hall.aurel32.net> (raw)
In-Reply-To: <48F4D60A.9050309@mail.berlios.de>

On Tue, Oct 14, 2008 at 07:25:30PM +0200, Stefan Weil wrote:
> Aurelien Jarno schrieb:
> > On Thu, Oct 02, 2008 at 10:04:26PM +0200, Stefan Weil wrote:
> >   
> > ...
> >> Add interrupt logging for MIPS targets.
> >>
> >> Signed-off-by: Stefan Weil <weil@mail.berlios.de> 
> >>
> >> Index: hw/mips_int.c
> >> ===================================================================
> >> --- hw/mips_int.c	(Revision 5400)
> >> +++ hw/mips_int.c	(Arbeitskopie)
> >> @@ -1,6 +1,7 @@
> >>  #include "hw.h"
> >>  #include "mips.h"
> >>  #include "cpu.h"
> >> +#include "qemu-log.h"
> >>  
> >>  /* Raise IRQ to CPU if necessary. It must be called every time the active
> >>     IRQ may change */
> >> @@ -12,10 +13,28 @@
> >>          !(env->hflags & MIPS_HFLAG_DM)) {
> >>          if ((env->CP0_Status & env->CP0_Cause & CP0Ca_IP_mask) &&
> >>              !(env->interrupt_request & CPU_INTERRUPT_HARD)) {
> >> +            if (loglevel & CPU_LOG_INT) {
> >> +                fprintf(logfile, "%s: cpu_interrupt (0x%08x,0x%08x)\n", __func__,
> >> +                  env->CP0_Status & env->CP0_Cause & CP0Ca_IP_mask,
> >> +                  env->interrupt_request);
> >> +                cpu_dump_state(env, logfile, fprintf, 0);
> >> +            }
> >>              cpu_interrupt(env, CPU_INTERRUPT_HARD);
> >> -	}
> >> -    } else
> >> +        } else {
> >> +            if (loglevel & CPU_LOG_INT) {
> >> +                fprintf(logfile, "%s: no interrupt (0x%08x,0x%08x)\n", __func__,
> >> +                  env->CP0_Status & env->CP0_Cause & CP0Ca_IP_mask,
> >> +                  env->interrupt_request);
> >> +                cpu_dump_state(env, logfile, fprintf, 0);
> >> +            }
> >>     
> >
> > I am not sure we really want to log this case, as no interrupt are
> > actually triggered (disabled interrupt, already processing an
> > interrupt, etc.)
> >   
> Well, I added this code to debug a real problem, not just for fun.
> It helps to see who triggers this code, even when interrupts are
> disabled at that moment.
> 

Then if you want to see the interrupts in all cases, what about 
adding it directly to cpu_mips_irq_request()? The resulting code would
be cleaner.


-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

      reply	other threads:[~2008-10-14 19:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-02 20:04 [Qemu-devel] [PATCH] Add support for CPU_LOG_INT (MIPS targets) Stefan Weil
2008-10-14  9:58 ` Aurelien Jarno
2008-10-14 17:25   ` Stefan Weil
2008-10-14 19:54     ` Aurelien Jarno [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=20081014195429.GA28076@hall.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    --cc=weil@mail.berlios.de \
    /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.