From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Fam Zheng" <fam@euphon.net>,
"Peter Maydell" <peter.maydell@linaro.org>,
qemu-block@nongnu.org, "Alexey Kardashevskiy" <aik@ozlabs.ru>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: [Qemu-devel] [PULL 1/3] loader: Trace loaded images
Date: Wed, 18 Sep 2019 14:21:10 +0100 [thread overview]
Message-ID: <20190918132112.10418-2-stefanha@redhat.com> (raw)
In-Reply-To: <20190918132112.10418-1-stefanha@redhat.com>
From: Alexey Kardashevskiy <aik@ozlabs.ru>
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>
---
Makefile.objs | 1 +
hw/core/loader.c | 3 +++
hw/core/trace-events | 2 ++
3 files changed, 6 insertions(+)
create mode 100644 hw/core/trace-events
diff --git a/Makefile.objs b/Makefile.objs
index 6a143dcd57..abcbd89654 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -203,6 +203,7 @@ trace-events-subdirs += target/riscv
trace-events-subdirs += target/s390x
trace-events-subdirs += target/sparc
trace-events-subdirs += util
+trace-events-subdirs += hw/core
trace-events-files = $(SRC_PATH)/trace-events $(trace-events-subdirs:%=$(SRC_PATH)/%/trace-events)
diff --git a/hw/core/loader.c b/hw/core/loader.c
index 75eb56ddbb..0d60219364 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 0000000000..fe47a9c8cb
--- /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"
--
2.21.0
next prev parent reply other threads:[~2019-09-18 13:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-18 13:21 [Qemu-devel] [PULL 0/3] Tracing patches Stefan Hajnoczi
2019-09-18 13:21 ` Stefan Hajnoczi [this message]
2019-09-18 13:21 ` [Qemu-devel] [PULL 2/3] trace: Remove trailing newline in events Stefan Hajnoczi
2019-09-18 15:51 ` Philippe Mathieu-Daudé
2019-09-19 9:31 ` Stefan Hajnoczi
2019-09-18 13:21 ` [Qemu-devel] [PULL 3/3] trace: Forbid event format ending with newline character Stefan Hajnoczi
2019-09-19 13:37 ` [Qemu-devel] [PULL 0/3] Tracing patches Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190918132112.10418-2-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=aik@ozlabs.ru \
--cc=fam@euphon.net \
--cc=jasowang@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).