[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/5] i8259: use DEBUG_IRQ_COUNT always
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH 2/5] i8259: use DEBUG_IRQ_COUNT always |
Date: |
Fri, 15 Dec 2017 08:25:28 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 |
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 <address@hidden>
> ---
> 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é <address@hidden>
> #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;
>
- [Qemu-devel] [PATCH 0/5] i8259: cleanups and enhancements, Peter Xu, 2017/12/10
- [Qemu-devel] [PATCH 1/5] i8259: convert DPRINTFs into trace, Peter Xu, 2017/12/10
- [Qemu-devel] [PATCH 2/5] i8259: use DEBUG_IRQ_COUNT always, Peter Xu, 2017/12/10
- Re: [Qemu-devel] [PATCH 2/5] i8259: use DEBUG_IRQ_COUNT always,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH 3/5] i8259: generalize statistics into common code, Peter Xu, 2017/12/10
- [Qemu-devel] [PATCH 4/5] kvm-i8259: support "info pic" and "info irq", Peter Xu, 2017/12/10
- [Qemu-devel] [PATCH 5/5] i8259: move TYPE_INTERRUPT_STATS_PROVIDER upper, Peter Xu, 2017/12/10
- Re: [Qemu-devel] [PATCH 0/5] i8259: cleanups and enhancements, Paolo Bonzini, 2017/12/19