All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Peter Xu <peterx@redhat.com>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	"Michael S . Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/5] i8259: use DEBUG_IRQ_COUNT always
Date: Fri, 15 Dec 2017 08:25:28 -0300	[thread overview]
Message-ID: <eb873259-38f2-4345-7d82-1f844417eb76@amsat.org> (raw)
In-Reply-To: <20171210063819.14892-3-peterx@redhat.com>

On 12/10/2017 03:38 AM, Peter Xu wrote:
> It's not really scary to even enable it forever.  After all it's i8259,
> and it's even not the kernel one.
> 
> Then we can remove quite a few of lines to make it cleaner.  And "info
> irq" will always work for it.
> 
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
>  hw/intc/i8259.c | 18 +-----------------
>  1 file changed, 1 insertion(+), 17 deletions(-)
> 
> diff --git a/hw/intc/i8259.c b/hw/intc/i8259.c
> index f12e0b27f1..20c9d0a58b 100644
> --- a/hw/intc/i8259.c
> +++ b/hw/intc/i8259.c
> @@ -36,7 +36,6 @@
>  //#define DEBUG_PIC
>  
>  //#define DEBUG_IRQ_LATENCY
> -//#define DEBUG_IRQ_COUNT
>  
>  #define TYPE_I8259 "isa-i8259"
>  #define PIC_CLASS(class) OBJECT_CLASS_CHECK(PICClass, (class), TYPE_I8259)
> @@ -52,12 +51,8 @@ typedef struct PICClass {
>      DeviceRealize parent_realize;
>  } PICClass;
>  
> -#if defined(DEBUG_PIC) || defined(DEBUG_IRQ_COUNT)
>  static int irq_level[16];
> -#endif
> -#ifdef DEBUG_IRQ_COUNT
>  static uint64_t irq_count[16];
> -#endif

I'll be so happy once this device get QOMified...

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

>  #ifdef DEBUG_IRQ_LATENCY
>  static int64_t irq_time[16];
>  #endif
> @@ -128,24 +123,17 @@ static void pic_set_irq(void *opaque, int irq, int level)
>  {
>      PICCommonState *s = opaque;
>      int mask = 1 << irq;
> -
> -#if defined(DEBUG_PIC) || defined(DEBUG_IRQ_COUNT) || \
> -    defined(DEBUG_IRQ_LATENCY)
>      int irq_index = s->master ? irq : irq + 8;
> -#endif
>  
>      trace_pic_set_irq(s->master, irq, level);
>  
> -#if defined(DEBUG_PIC) || defined(DEBUG_IRQ_COUNT)
>      if (level != irq_level[irq_index]) {
>          irq_level[irq_index] = level;
> -#ifdef DEBUG_IRQ_COUNT
>          if (level == 1) {
>              irq_count[irq_index]++;
>          }
> -#endif
>      }
> -#endif
> +
>  #ifdef DEBUG_IRQ_LATENCY
>      if (level) {
>          irq_time[irq_index] = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
> @@ -253,12 +241,8 @@ static bool pic_get_statistics(InterruptStatsProvider *obj,
>      PICCommonState *s = PIC_COMMON(obj);
>  
>      if (s->master) {
> -#ifdef DEBUG_IRQ_COUNT
>          *irq_counts = irq_count;
>          *nb_irqs = ARRAY_SIZE(irq_count);
> -#else
> -        return false;
> -#endif
>      } else {
>          *irq_counts = NULL;
>          *nb_irqs = 0;
> 

  reply	other threads:[~2017-12-15 11:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-10  6:38 [Qemu-devel] [PATCH 0/5] i8259: cleanups and enhancements Peter Xu
2017-12-10  6:38 ` [Qemu-devel] [PATCH 1/5] i8259: convert DPRINTFs into trace Peter Xu
2017-12-15 11:22   ` Philippe Mathieu-Daudé
2017-12-10  6:38 ` [Qemu-devel] [PATCH 2/5] i8259: use DEBUG_IRQ_COUNT always Peter Xu
2017-12-15 11:25   ` Philippe Mathieu-Daudé [this message]
2017-12-10  6:38 ` [Qemu-devel] [PATCH 3/5] i8259: generalize statistics into common code Peter Xu
2017-12-15 11:28   ` Philippe Mathieu-Daudé
2017-12-16  3:13     ` Peter Xu
2017-12-10  6:38 ` [Qemu-devel] [PATCH 4/5] kvm-i8259: support "info pic" and "info irq" Peter Xu
2017-12-15 11:30   ` Philippe Mathieu-Daudé
2017-12-10  6:38 ` [Qemu-devel] [PATCH 5/5] i8259: move TYPE_INTERRUPT_STATS_PROVIDER upper Peter Xu
2017-12-15 11:30   ` Philippe Mathieu-Daudé
2017-12-19 13:09 ` [Qemu-devel] [PATCH 0/5] i8259: cleanups and enhancements Paolo Bonzini

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=eb873259-38f2-4345-7d82-1f844417eb76@amsat.org \
    --to=f4bug@amsat.org \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.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.