[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 22/34] trace: add acpi memory hotplug IO regi
From: |
Igor Mammedov |
Subject: |
Re: [Qemu-devel] [PATCH v3 22/34] trace: add acpi memory hotplug IO region events |
Date: |
Wed, 28 May 2014 13:01:51 +0200 |
On Wed, 28 May 2014 11:00:25 +0200
Anshul Makkar <address@hidden> wrote:
> Hi,
>
> Sorry, for this basic question. Do the above trace function lead to some
> printfs which will be helpful for debugging. If yes, where I can see the
> trace logs. I have not been able to find the definition of these trace
> functions.
configure QEMU with "--enable-trace-backend=stderr " option to get printf()
like behavior then create file with events you're interested in for example:
echo "mhp_*" > memhp_events
and start QEMU with following option: -trace events=memhp_events
>
> Thanks
> Anshul Makkar
> www.justkernel.com
>
>
> On Tue, May 27, 2014 at 3:01 PM, Igor Mammedov <address@hidden> wrote:
>
> > Add events for tracing accesses to memory hotplug IO ports.
> >
> > Signed-off-by: Igor Mammedov <address@hidden>
> > ---
> > hw/acpi/memory_hotplug.c | 13 +++++++++++++
> > trace-events | 13 +++++++++++++
> > 2 files changed, 26 insertions(+), 0 deletions(-)
> >
> > diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
> > index 6138346..73a0501 100644
> > --- a/hw/acpi/memory_hotplug.c
> > +++ b/hw/acpi/memory_hotplug.c
> > @@ -2,6 +2,7 @@
> > #include "hw/acpi/pc-hotplug.h"
> > #include "hw/mem/dimm.h"
> > #include "hw/boards.h"
> > +#include "trace.h"
> >
> > static uint64_t acpi_memory_hotplug_read(void *opaque, hwaddr addr,
> > unsigned int size)
> > @@ -11,6 +12,7 @@ static uint64_t acpi_memory_hotplug_read(void *opaque,
> > hwaddr addr,
> > MemStatus *mdev;
> >
> > if (mem_st->selector >= mem_st->dev_count) {
> > + trace_mhp_acpi_invalid_slot_selected(mem_st->selector);
> > return 0;
> > }
> >
> > @@ -18,24 +20,30 @@ static uint64_t acpi_memory_hotplug_read(void *opaque,
> > hwaddr addr,
> > switch (addr) {
> > case 0x0: /* Lo part of phys address where DIMM is mapped */
> > val = object_property_get_int(OBJECT(mdev->dimm), DIMM_ADDR_PROP,
> > NULL);
> > + trace_mhp_acpi_read_addr_lo(mem_st->selector, val);
> > break;
> > case 0x4: /* Hi part of phys address where DIMM is mapped */
> > val = object_property_get_int(OBJECT(mdev->dimm), DIMM_ADDR_PROP,
> > NULL) >> 32;
> > + trace_mhp_acpi_read_addr_hi(mem_st->selector, val);
> > break;
> > case 0x8: /* Lo part of DIMM size */
> > val = object_property_get_int(OBJECT(mdev->dimm), DIMM_SIZE_PROP,
> > NULL);
> > + trace_mhp_acpi_read_size_lo(mem_st->selector, val);
> > break;
> > case 0xc: /* Hi part of DIMM size */
> > val = object_property_get_int(OBJECT(mdev->dimm), DIMM_SIZE_PROP,
> > NULL) >> 32;
> > + trace_mhp_acpi_read_size_hi(mem_st->selector, val);
> > break;
> > case 0x10: /* node proximity for _PXM method */
> > val = object_property_get_int(OBJECT(mdev->dimm), DIMM_NODE_PROP,
> > NULL);
> > + trace_mhp_acpi_read_pxm(mem_st->selector, val);
> > break;
> > case 0x14: /* pack and return is_* fields */
> > val |= mdev->is_enabled ? 1 : 0;
> > val |= mdev->is_inserting ? 2 : 0;
> > + trace_mhp_acpi_read_flags(mem_st->selector, val);
> > break;
> > default:
> > val = ~0;
> > @@ -56,6 +64,7 @@ static void acpi_memory_hotplug_write(void *opaque,
> > hwaddr addr, uint64_t data,
> >
> > if (addr) {
> > if (mem_st->selector >= mem_st->dev_count) {
> > + trace_mhp_acpi_invalid_slot_selected(mem_st->selector);
> > return;
> > }
> > }
> > @@ -63,6 +72,7 @@ static void acpi_memory_hotplug_write(void *opaque,
> > hwaddr addr, uint64_t data,
> > switch (addr) {
> > case 0x0: /* DIMM slot selector */
> > mem_st->selector = data;
> > + trace_mhp_acpi_write_slot(mem_st->selector);
> > break;
> > case 0x4: /* _OST event */
> > mdev = &mem_st->devs[mem_st->selector];
> > @@ -72,10 +82,12 @@ static void acpi_memory_hotplug_write(void *opaque,
> > hwaddr addr, uint64_t data,
> > /* TODO: handle device remove OST event */
> > }
> > mdev->ost_event = data;
> > + trace_mhp_acpi_write_ost_ev(mem_st->selector, mdev->ost_event);
> > break;
> > case 0x8: /* _OST status */
> > mdev = &mem_st->devs[mem_st->selector];
> > mdev->ost_status = data;
> > + trace_mhp_acpi_write_ost_status(mem_st->selector,
> > mdev->ost_status);
> > /* TODO: report async error */
> > /* TODO: implement memory removal on guest signal */
> > break;
> > @@ -83,6 +95,7 @@ static void acpi_memory_hotplug_write(void *opaque,
> > hwaddr addr, uint64_t data,
> > mdev = &mem_st->devs[mem_st->selector];
> > if (data & 2) { /* clear insert event */
> > mdev->is_inserting = false;
> > + trace_mhp_acpi_clear_insert_evt(mem_st->selector);
> > }
> > break;
> > }
> > diff --git a/trace-events b/trace-events
> > index b6d289d..4f4c58f 100644
> > --- a/trace-events
> > +++ b/trace-events
> > @@ -1252,3 +1252,16 @@ xen_pv_mmio_write(uint64_t addr) "WARNING: write to
> > Xen PV Device MMIO space (ad
> > # hw/pci/pci_host.c
> > pci_cfg_read(const char *dev, unsigned devid, unsigned fnid, unsigned
> > offs, unsigned val) "%s %02u:%u @0x%x -> 0x%x"
> > pci_cfg_write(const char *dev, unsigned devid, unsigned fnid, unsigned
> > offs, unsigned val) "%s %02u:%u @0x%x <- 0x%x"
> > +
> > +#hw/acpi/memory_hotplug.c
> > +mhp_acpi_invalid_slot_selected(uint32_t slot) "0x%"PRIx32
> > +mhp_acpi_read_addr_lo(uint32_t slot, uint32_t addr) "slot[0x%"PRIx32"]
> > addr lo: 0x%"PRIx32
> > +mhp_acpi_read_addr_hi(uint32_t slot, uint32_t addr) "slot[0x%"PRIx32"]
> > addr hi: 0x%"PRIx32
> > +mhp_acpi_read_size_lo(uint32_t slot, uint32_t size) "slot[0x%"PRIx32"]
> > size lo: 0x%"PRIx32
> > +mhp_acpi_read_size_hi(uint32_t slot, uint32_t size) "slot[0x%"PRIx32"]
> > size hi: 0x%"PRIx32
> > +mhp_acpi_read_pxm(uint32_t slot, uint32_t pxm) "slot[0x%"PRIx32"]
> > proximity: 0x%"PRIx32
> > +mhp_acpi_read_flags(uint32_t slot, uint32_t flags) "slot[0x%"PRIx32"]
> > flags: 0x%"PRIx32
> > +mhp_acpi_write_slot(uint32_t slot) "set active slot: 0x%"PRIx32
> > +mhp_acpi_write_ost_ev(uint32_t slot, uint32_t ev) "slot[0x%"PRIx32"] OST
> > EVENT: 0x%"PRIx32
> > +mhp_acpi_write_ost_status(uint32_t slot, uint32_t st) "slot[0x%"PRIx32"]
> > OST STATUS: 0x%"PRIx32
> > +mhp_acpi_clear_insert_evt(uint32_t slot) "slot[0x%"PRIx32"] clear insert
> > event"
> > --
> > 1.7.1
> >
> >
> >
- [Qemu-devel] [PATCH v3 09/34] qdev: expose DeviceState.hotplugged field as a property, (continued)
- [Qemu-devel] [PATCH v3 09/34] qdev: expose DeviceState.hotplugged field as a property, Igor Mammedov, 2014/05/27
- [Qemu-devel] [PATCH v3 08/34] qdev: hotplug for buss-less devices, Igor Mammedov, 2014/05/27
- [Qemu-devel] [PATCH v3 10/34] dimm: implement dimm device abstraction, Igor Mammedov, 2014/05/27
- [Qemu-devel] [PATCH v3 11/34] memory: add memory_region_is_mapped() API, Igor Mammedov, 2014/05/27
- [Qemu-devel] [PATCH v3 13/34] pc: initialize memory hotplug address space, Igor Mammedov, 2014/05/27
- [Qemu-devel] [PATCH v3 14/34] pc: exit QEMU if number of slots more than supported 256, Igor Mammedov, 2014/05/27
- [Qemu-devel] [PATCH v3 17/34] pc: add memory hotplug handler to PC_MACHINE, Igor Mammedov, 2014/05/27
- [Qemu-devel] [PATCH v3 18/34] dimm: add busy address check and address auto-allocation, Igor Mammedov, 2014/05/27
- [Qemu-devel] [PATCH v3 22/34] trace: add acpi memory hotplug IO region events, Igor Mammedov, 2014/05/27
- [Qemu-devel] [PATCH v3 21/34] acpi: memory hotplug ACPI hardware implementation, Igor Mammedov, 2014/05/27
- [Qemu-devel] [PATCH v3 23/34] trace: pc: add DIMM slot & address allocation, Igor Mammedov, 2014/05/27
- [Qemu-devel] [PATCH v3 24/34] acpi:piix4: allow plug/unlug callbacks handle not only PCI devices, Igor Mammedov, 2014/05/27
- [Qemu-devel] [PATCH v3 25/34] acpi:piix4: add memory hotplug handling, Igor Mammedov, 2014/05/27
- [Qemu-devel] [PATCH v3 28/34] pc: migrate piix4 & ich9 MemHotplugState, Igor Mammedov, 2014/05/27
- [Qemu-devel] [PATCH v3 30/34] pc: propagate memory hotplug event to ACPI device, Igor Mammedov, 2014/05/27
- [Qemu-devel] [PATCH v3 31/34] pc: ACPI BIOS: implement memory hotplug interface, Igor Mammedov, 2014/05/27
- [Qemu-devel] [PATCH v3 32/34] pc: add "hotplug-memory-region-size" property to PC_MACHINE, Igor Mammedov, 2014/05/27
- [Qemu-devel] [PATCH v3 29/34] pc: add acpi-device link to PCMachineState, Igor Mammedov, 2014/05/27
- [Qemu-devel] [PATCH v3 33/34] pc: ACPI BIOS: reserve SRAT entry for hotplug mem hole, Igor Mammedov, 2014/05/27