From 26b8e6dc42b9e46b76295f5613c7f7d61a78ccf0 Mon Sep 17 00:00:00 2001 From: Alexey Kardashevskiy Date: Thu, 13 Jun 2019 15:09:37 +1000 Subject: loader: Trace loaded images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds a trace point which prints every loaded image. This includes bios/firmware/kernel/initradmdisk/pcirom. Signed-off-by: Alexey Kardashevskiy Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20190613050937.124903-1-aik@ozlabs.ru> Signed-off-by: Stefan Hajnoczi --- hw/core/loader.c | 3 +++ hw/core/trace-events | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 hw/core/trace-events (limited to 'hw') diff --git a/hw/core/loader.c b/hw/core/loader.c index 75eb56d..0d60219 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -45,6 +45,7 @@ #include "qemu/osdep.h" #include "qemu-common.h" #include "qapi/error.h" +#include "trace.h" #include "hw/hw.h" #include "disas/disas.h" #include "migration/vmstate.h" @@ -1151,6 +1152,8 @@ static void rom_reset(void *unused) * CPU definitely fetches its instructions from the just written data. */ cpu_flush_icache_range(rom->addr, rom->datasize); + + trace_loader_write_rom(rom->name, rom->addr, rom->datasize, rom->isrom); } } diff --git a/hw/core/trace-events b/hw/core/trace-events new file mode 100644 index 0000000..fe47a9c --- /dev/null +++ b/hw/core/trace-events @@ -0,0 +1,2 @@ +# loader.c +loader_write_rom(const char *name, uint64_t gpa, uint64_t size, bool isrom) "%s: @0x%"PRIx64" size=0x%"PRIx64" ROM=%d" -- cgit v1.1 From 794dcb54b3fc3cb91d1eeb34216be3177400d6a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Mon, 16 Sep 2019 11:51:20 +0200 Subject: trace: Remove trailing newline in events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While the tracing framework does not forbid trailing newline in events format string, using them lead to confuse output. It is the responsibility of the backend to properly end an event line. Some of our formats have trailing newlines, remove them. [Fixed typo in commit description reported by Eric Blake --Stefan] Reviewed-by: John Snow Reviewed-by: Kevin Wolf Signed-off-by: Philippe Mathieu-Daudé Message-id: 20190916095121.29506-2-philmd@redhat.com Message-Id: <20190916095121.29506-2-philmd@redhat.com> Signed-off-by: Stefan Hajnoczi --- hw/misc/trace-events | 10 +++++----- hw/scsi/trace-events | 2 +- hw/sd/trace-events | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'hw') diff --git a/hw/misc/trace-events b/hw/misc/trace-events index c1ea1aa..7427622 100644 --- a/hw/misc/trace-events +++ b/hw/misc/trace-events @@ -118,11 +118,11 @@ iotkit_secctl_ns_read(uint32_t offset, uint64_t data, unsigned size) "IoTKit Sec iotkit_secctl_ns_write(uint32_t offset, uint64_t data, unsigned size) "IoTKit SecCtl NS regs write: offset 0x%x data 0x%" PRIx64 " size %u" # imx6ul_ccm.c -ccm_entry(void) "\n" -ccm_freq(uint32_t freq) "freq = %d\n" -ccm_clock_freq(uint32_t clock, uint32_t freq) "(Clock = %d) = %d\n" -ccm_read_reg(const char *reg_name, uint32_t value) "reg[%s] <= 0x%" PRIx32 "\n" -ccm_write_reg(const char *reg_name, uint32_t value) "reg[%s] => 0x%" PRIx32 "\n" +ccm_entry(void) "" +ccm_freq(uint32_t freq) "freq = %d" +ccm_clock_freq(uint32_t clock, uint32_t freq) "(Clock = %d) = %d" +ccm_read_reg(const char *reg_name, uint32_t value) "reg[%s] <= 0x%" PRIx32 +ccm_write_reg(const char *reg_name, uint32_t value) "reg[%s] => 0x%" PRIx32 # iotkit-sysinfo.c iotkit_sysinfo_read(uint64_t offset, uint64_t data, unsigned size) "IoTKit SysInfo read: offset 0x%" PRIx64 " data 0x%" PRIx64 " size %u" diff --git a/hw/scsi/trace-events b/hw/scsi/trace-events index 452b599..b082005 100644 --- a/hw/scsi/trace-events +++ b/hw/scsi/trace-events @@ -28,7 +28,7 @@ mptsas_mmio_read(void *dev, uint32_t addr, uint32_t val) "dev %p addr 0x%08x val mptsas_mmio_unhandled_read(void *dev, uint32_t addr) "dev %p addr 0x%08x" mptsas_mmio_unhandled_write(void *dev, uint32_t addr, uint32_t val) "dev %p addr 0x%08x value 0x%x" mptsas_mmio_write(void *dev, uint32_t addr, uint32_t val) "dev %p addr 0x%08x value 0x%x" -mptsas_process_message(void *dev, int msg, uint32_t ctx) "dev %p cmd %d context 0x%08x\n" +mptsas_process_message(void *dev, int msg, uint32_t ctx) "dev %p cmd %d context 0x%08x" mptsas_process_scsi_io_request(void *dev, int bus, int target, int lun, uint64_t len) "dev %p dev %d:%d:%d length %"PRIu64"" mptsas_reset(void *dev) "dev %p " mptsas_scsi_overflow(void *dev, uint32_t ctx, uint64_t req, uint64_t found) "dev %p context 0x%08x: %"PRIu64"/%"PRIu64"" diff --git a/hw/sd/trace-events b/hw/sd/trace-events index 52971dc..efcff66 100644 --- a/hw/sd/trace-events +++ b/hw/sd/trace-events @@ -4,7 +4,7 @@ bcm2835_sdhost_read(uint64_t offset, uint64_t data, unsigned size) "offset 0x%" PRIx64 " data 0x%" PRIx64 " size %u" bcm2835_sdhost_write(uint64_t offset, uint64_t data, unsigned size) "offset 0x%" PRIx64 " data 0x%" PRIx64 " size %u" bcm2835_sdhost_edm_change(const char *why, uint32_t edm) "(%s) EDM now 0x%x" -bcm2835_sdhost_update_irq(uint32_t irq) "IRQ bits 0x%x\n" +bcm2835_sdhost_update_irq(uint32_t irq) "IRQ bits 0x%x" # core.c sdbus_command(const char *bus_name, uint8_t cmd, uint32_t arg) "@%s CMD%02d arg 0x%08x" -- cgit v1.1