mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-22 09:32:40 -06:00
i8259: use DEBUG_IRQ_COUNT always
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> Message-Id: <20171210063819.14892-3-peterx@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
0880a87300
commit
f260f7361c
1 changed files with 1 additions and 17 deletions
|
@ -36,7 +36,6 @@
|
||||||
//#define DEBUG_PIC
|
//#define DEBUG_PIC
|
||||||
|
|
||||||
//#define DEBUG_IRQ_LATENCY
|
//#define DEBUG_IRQ_LATENCY
|
||||||
//#define DEBUG_IRQ_COUNT
|
|
||||||
|
|
||||||
#define TYPE_I8259 "isa-i8259"
|
#define TYPE_I8259 "isa-i8259"
|
||||||
#define PIC_CLASS(class) OBJECT_CLASS_CHECK(PICClass, (class), TYPE_I8259)
|
#define PIC_CLASS(class) OBJECT_CLASS_CHECK(PICClass, (class), TYPE_I8259)
|
||||||
|
@ -52,12 +51,8 @@ typedef struct PICClass {
|
||||||
DeviceRealize parent_realize;
|
DeviceRealize parent_realize;
|
||||||
} PICClass;
|
} PICClass;
|
||||||
|
|
||||||
#if defined(DEBUG_PIC) || defined(DEBUG_IRQ_COUNT)
|
|
||||||
static int irq_level[16];
|
static int irq_level[16];
|
||||||
#endif
|
|
||||||
#ifdef DEBUG_IRQ_COUNT
|
|
||||||
static uint64_t irq_count[16];
|
static uint64_t irq_count[16];
|
||||||
#endif
|
|
||||||
#ifdef DEBUG_IRQ_LATENCY
|
#ifdef DEBUG_IRQ_LATENCY
|
||||||
static int64_t irq_time[16];
|
static int64_t irq_time[16];
|
||||||
#endif
|
#endif
|
||||||
|
@ -128,24 +123,17 @@ static void pic_set_irq(void *opaque, int irq, int level)
|
||||||
{
|
{
|
||||||
PICCommonState *s = opaque;
|
PICCommonState *s = opaque;
|
||||||
int mask = 1 << irq;
|
int mask = 1 << irq;
|
||||||
|
|
||||||
#if defined(DEBUG_PIC) || defined(DEBUG_IRQ_COUNT) || \
|
|
||||||
defined(DEBUG_IRQ_LATENCY)
|
|
||||||
int irq_index = s->master ? irq : irq + 8;
|
int irq_index = s->master ? irq : irq + 8;
|
||||||
#endif
|
|
||||||
|
|
||||||
trace_pic_set_irq(s->master, irq, level);
|
trace_pic_set_irq(s->master, irq, level);
|
||||||
|
|
||||||
#if defined(DEBUG_PIC) || defined(DEBUG_IRQ_COUNT)
|
|
||||||
if (level != irq_level[irq_index]) {
|
if (level != irq_level[irq_index]) {
|
||||||
irq_level[irq_index] = level;
|
irq_level[irq_index] = level;
|
||||||
#ifdef DEBUG_IRQ_COUNT
|
|
||||||
if (level == 1) {
|
if (level == 1) {
|
||||||
irq_count[irq_index]++;
|
irq_count[irq_index]++;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#ifdef DEBUG_IRQ_LATENCY
|
#ifdef DEBUG_IRQ_LATENCY
|
||||||
if (level) {
|
if (level) {
|
||||||
irq_time[irq_index] = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
|
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);
|
PICCommonState *s = PIC_COMMON(obj);
|
||||||
|
|
||||||
if (s->master) {
|
if (s->master) {
|
||||||
#ifdef DEBUG_IRQ_COUNT
|
|
||||||
*irq_counts = irq_count;
|
*irq_counts = irq_count;
|
||||||
*nb_irqs = ARRAY_SIZE(irq_count);
|
*nb_irqs = ARRAY_SIZE(irq_count);
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
*irq_counts = NULL;
|
*irq_counts = NULL;
|
||||||
*nb_irqs = 0;
|
*nb_irqs = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue