Revision d8023f31

b/hw/apic.c
21 21
#include "qemu-timer.h"
22 22
#include "host-utils.h"
23 23
#include "sysbus.h"
24

  
25
//#define DEBUG_APIC
26
//#define DEBUG_COALESCING
27

  
28
#ifdef DEBUG_APIC
29
#define DPRINTF(fmt, ...)                                       \
30
    do { printf("apic: " fmt , ## __VA_ARGS__); } while (0)
31
#else
32
#define DPRINTF(fmt, ...)
33
#endif
34

  
35
#ifdef DEBUG_COALESCING
36
#define DPRINTF_C(fmt, ...)                                     \
37
    do { printf("apic: " fmt , ## __VA_ARGS__); } while (0)
38
#else
39
#define DPRINTF_C(fmt, ...)
40
#endif
24
#include "trace.h"
41 25

  
42 26
/* APIC Local Vector Table */
43 27
#define APIC_LVT_TIMER   0
......
168 152
    uint32_t lvt = s->lvt[vector];
169 153
    int trigger_mode;
170 154

  
171
    DPRINTF("%s: vector %d delivery mode %d\n", __func__, vector,
172
            (lvt >> 8) & 7);
155
    trace_apic_local_deliver(vector, (lvt >> 8) & 7);
156

  
173 157
    if (lvt & APIC_LVT_MASKED)
174 158
        return;
175 159

  
......
300 284
{
301 285
    uint32_t deliver_bitmask[MAX_APIC_WORDS];
302 286

  
303
    DPRINTF("%s: dest %d dest_mode %d delivery_mode %d vector %d"
304
            " polarity %d trigger_mode %d\n", __func__, dest, dest_mode,
305
            delivery_mode, vector_num, polarity, trigger_mode);
287
    trace_apic_deliver_irq(dest, dest_mode, delivery_mode, vector_num,
288
                           polarity, trigger_mode);
289

  
306 290
    apic_get_delivery_bitmask(deliver_bitmask, dest, dest_mode);
307 291
    apic_bus_deliver(deliver_bitmask, delivery_mode, vector_num, polarity,
308 292
                     trigger_mode);
......
312 296
{
313 297
    APICState *s = DO_UPCAST(APICState, busdev.qdev, d);
314 298

  
315
    DPRINTF("cpu_set_apic_base: %016" PRIx64 "\n", val);
299
    trace_cpu_set_apic_base(val);
300

  
316 301
    if (!s)
317 302
        return;
318 303
    s->apicbase = (val & 0xfffff000) |
......
329 314
{
330 315
    APICState *s = DO_UPCAST(APICState, busdev.qdev, d);
331 316

  
332
    DPRINTF("cpu_get_apic_base: %016" PRIx64 "\n",
333
            s ? (uint64_t)s->apicbase: 0);
317
    trace_cpu_get_apic_base(s ? (uint64_t)s->apicbase: 0);
318

  
334 319
    return s ? s->apicbase : 0;
335 320
}
336 321

  
......
402 387

  
403 388
void apic_reset_irq_delivered(void)
404 389
{
405
    DPRINTF_C("%s: old coalescing %d\n", __func__, apic_irq_delivered);
390
    trace_apic_reset_irq_delivered(apic_irq_delivered);
391

  
406 392
    apic_irq_delivered = 0;
407 393
}
408 394

  
409 395
int apic_get_irq_delivered(void)
410 396
{
411
    DPRINTF_C("%s: returning coalescing %d\n", __func__, apic_irq_delivered);
397
    trace_apic_get_irq_delivered(apic_irq_delivered);
398

  
412 399
    return apic_irq_delivered;
413 400
}
414 401

  
415 402
static void apic_set_irq(APICState *s, int vector_num, int trigger_mode)
416 403
{
417 404
    apic_irq_delivered += !get_bit(s->irr, vector_num);
418
    DPRINTF_C("%s: coalescing %d\n", __func__, apic_irq_delivered);
405

  
406
    trace_apic_set_irq(apic_irq_delivered);
419 407

  
420 408
    set_bit(s->irr, vector_num);
421 409
    if (trigger_mode)
......
769 757
        val = 0;
770 758
        break;
771 759
    }
772
    DPRINTF("read: " TARGET_FMT_plx " = %08x\n", addr, val);
760
    trace_apic_mem_readl(addr, val);
773 761
    return val;
774 762
}
775 763

  
......
805 793
    }
806 794
    s = DO_UPCAST(APICState, busdev.qdev, d);
807 795

  
808
    DPRINTF("write: " TARGET_FMT_plx " = %08x\n", addr, val);
796
    trace_apic_mem_writel(addr, val);
809 797

  
810 798
    switch(index) {
811 799
    case 0x02:
b/trace-events
69 69
# balloon.c
70 70
# Since requests are raised via monitor, not many tracepoints are needed.
71 71
disable balloon_event(void *opaque, unsigned long addr) "opaque %p addr %lu"
72

  
73
# hw/apic.c
74
disable apic_local_deliver(int vector, uint32_t lvt) "vector %d delivery mode %d"
75
disable apic_deliver_irq(uint8_t dest, uint8_t dest_mode, uint8_t delivery_mode, uint8_t vector_num, uint8_t polarity, uint8_t trigger_mode) "dest %d dest_mode %d delivery_mode %d vector %d polarity %d trigger_mode %d"
76
disable cpu_set_apic_base(uint64_t val) "%016"PRIx64""
77
disable cpu_get_apic_base(uint64_t val) "%016"PRIx64""
78
disable apic_mem_readl(uint64_t addr, uint32_t val)  "%"PRIx64" = %08x"
79
disable apic_mem_writel(uint64_t addr, uint32_t val) "%"PRIx64" = %08x"
80
# coalescing
81
disable apic_reset_irq_delivered(int apic_irq_delivered) "old coalescing %d"
82
disable apic_get_irq_delivered(int apic_irq_delivered) "returning coalescing %d"
83
disable apic_set_irq(int apic_irq_delivered) "coalescing %d"

Also available in: Unified diff