Browse Source

loader: Trace loaded images

This adds a trace point which prints every loaded image. This includes
bios/firmware/kernel/initradmdisk/pcirom.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20190613050937.124903-1-aik@ozlabs.ru>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Alexey Kardashevskiy 6 năm trước cách đây
mục cha
commit
26b8e6dc42
3 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 1 0
      Makefile.objs
  2. 3 0
      hw/core/loader.c
  3. 2 0
      hw/core/trace-events

+ 1 - 0
Makefile.objs

@@ -203,6 +203,7 @@ trace-events-subdirs += target/riscv
 trace-events-subdirs += target/s390x
 trace-events-subdirs += target/s390x
 trace-events-subdirs += target/sparc
 trace-events-subdirs += target/sparc
 trace-events-subdirs += util
 trace-events-subdirs += util
+trace-events-subdirs += hw/core
 
 
 trace-events-files = $(SRC_PATH)/trace-events $(trace-events-subdirs:%=$(SRC_PATH)/%/trace-events)
 trace-events-files = $(SRC_PATH)/trace-events $(trace-events-subdirs:%=$(SRC_PATH)/%/trace-events)
 
 

+ 3 - 0
hw/core/loader.c

@@ -45,6 +45,7 @@
 #include "qemu/osdep.h"
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu-common.h"
 #include "qapi/error.h"
 #include "qapi/error.h"
+#include "trace.h"
 #include "hw/hw.h"
 #include "hw/hw.h"
 #include "disas/disas.h"
 #include "disas/disas.h"
 #include "migration/vmstate.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 definitely fetches its instructions from the just written data.
          */
          */
         cpu_flush_icache_range(rom->addr, rom->datasize);
         cpu_flush_icache_range(rom->addr, rom->datasize);
+
+        trace_loader_write_rom(rom->name, rom->addr, rom->datasize, rom->isrom);
     }
     }
 }
 }
 
 

+ 2 - 0
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"