From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Hollis Blanchard <hollis_blanchard@mentor.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PULL 03/13] trace: split subpage MMIOs into their own trace events.
Date: Tue, 1 Mar 2016 15:48:04 +0000 [thread overview]
Message-ID: <1456847294-13576-4-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1456847294-13576-1-git-send-email-stefanha@redhat.com>
From: Hollis Blanchard <hollis_blanchard@mentor.com>
Previously, a single MMIO could trigger the memory_region_ops tracepoint twice:
once on its way into subpage ops, then later on its way into the model's ops.
Also, the fields previously called "addr" are actually offsets into the memory
region. Rename them to "offset" while we're editing the tracepoint definitions.
Signed-off-by: Hollis Blanchard <hollis_blanchard@mentor.com>
Message-id: 1454976185-30095-2-git-send-email-hollis_blanchard@mentor.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
memory.c | 36 ++++++++++++++++++++++++++++++------
trace-events | 6 ++++--
2 files changed, 34 insertions(+), 8 deletions(-)
diff --git a/memory.c b/memory.c
index 0dd9695..86ffd53 100644
--- a/memory.c
+++ b/memory.c
@@ -383,7 +383,11 @@ static MemTxResult memory_region_oldmmio_read_accessor(MemoryRegion *mr,
uint64_t tmp;
tmp = mr->ops->old_mmio.read[ctz32(size)](mr->opaque, addr);
- trace_memory_region_ops_read(mr, addr, tmp, size);
+ if (mr->subpage) {
+ trace_memory_region_subpage_read(mr, addr, tmp, size);
+ } else {
+ trace_memory_region_ops_read(mr, addr, tmp, size);
+ }
*value |= (tmp & mask) << shift;
return MEMTX_OK;
}
@@ -399,7 +403,11 @@ static MemTxResult memory_region_read_accessor(MemoryRegion *mr,
uint64_t tmp;
tmp = mr->ops->read(mr->opaque, addr, size);
- trace_memory_region_ops_read(mr, addr, tmp, size);
+ if (mr->subpage) {
+ trace_memory_region_subpage_read(mr, addr, tmp, size);
+ } else {
+ trace_memory_region_ops_read(mr, addr, tmp, size);
+ }
*value |= (tmp & mask) << shift;
return MEMTX_OK;
}
@@ -416,7 +424,11 @@ static MemTxResult memory_region_read_with_attrs_accessor(MemoryRegion *mr,
MemTxResult r;
r = mr->ops->read_with_attrs(mr->opaque, addr, &tmp, size, attrs);
- trace_memory_region_ops_read(mr, addr, tmp, size);
+ if (mr->subpage) {
+ trace_memory_region_subpage_read(mr, addr, tmp, size);
+ } else {
+ trace_memory_region_ops_read(mr, addr, tmp, size);
+ }
*value |= (tmp & mask) << shift;
return r;
}
@@ -432,7 +444,11 @@ static MemTxResult memory_region_oldmmio_write_accessor(MemoryRegion *mr,
uint64_t tmp;
tmp = (*value >> shift) & mask;
- trace_memory_region_ops_write(mr, addr, tmp, size);
+ if (mr->subpage) {
+ trace_memory_region_subpage_write(mr, addr, tmp, size);
+ } else {
+ trace_memory_region_ops_write(mr, addr, tmp, size);
+ }
mr->ops->old_mmio.write[ctz32(size)](mr->opaque, addr, tmp);
return MEMTX_OK;
}
@@ -448,7 +464,11 @@ static MemTxResult memory_region_write_accessor(MemoryRegion *mr,
uint64_t tmp;
tmp = (*value >> shift) & mask;
- trace_memory_region_ops_write(mr, addr, tmp, size);
+ if (mr->subpage) {
+ trace_memory_region_subpage_write(mr, addr, tmp, size);
+ } else {
+ trace_memory_region_ops_write(mr, addr, tmp, size);
+ }
mr->ops->write(mr->opaque, addr, tmp, size);
return MEMTX_OK;
}
@@ -464,7 +484,11 @@ static MemTxResult memory_region_write_with_attrs_accessor(MemoryRegion *mr,
uint64_t tmp;
tmp = (*value >> shift) & mask;
- trace_memory_region_ops_write(mr, addr, tmp, size);
+ if (mr->subpage) {
+ trace_memory_region_subpage_write(mr, addr, tmp, size);
+ } else {
+ trace_memory_region_ops_write(mr, addr, tmp, size);
+ }
return mr->ops->write_with_attrs(mr->opaque, addr, tmp, size, attrs);
}
diff --git a/trace-events b/trace-events
index d57e1c3..021211d 100644
--- a/trace-events
+++ b/trace-events
@@ -1620,8 +1620,10 @@ disable exec_tb_exit(void *next_tb, unsigned int flags) "tb:%p flags=%x"
translate_block(void *tb, uintptr_t pc, uint8_t *tb_code) "tb:%p, pc:0x%"PRIxPTR", tb_code:%p"
# memory.c
-memory_region_ops_read(void *mr, uint64_t addr, uint64_t value, unsigned size) "mr %p addr %#"PRIx64" value %#"PRIx64" size %u"
-memory_region_ops_write(void *mr, uint64_t addr, uint64_t value, unsigned size) "mr %p addr %#"PRIx64" value %#"PRIx64" size %u"
+memory_region_ops_read(void *mr, uint64_t offset, uint64_t value, unsigned size) "mr %p offset %#"PRIx64" value %#"PRIx64" size %u"
+memory_region_ops_write(void *mr, uint64_t offset, uint64_t value, unsigned size) "mr %p offset %#"PRIx64" value %#"PRIx64" size %u"
+memory_region_subpage_read(void *mr, uint64_t offset, uint64_t value, unsigned size) "mr %p offset %#"PRIx64" value %#"PRIx64" size %u"
+memory_region_subpage_write(void *mr, uint64_t offset, uint64_t value, unsigned size) "mr %p offset %#"PRIx64" value %#"PRIx64" size %u"
# qom/object.c
object_dynamic_cast_assert(const char *type, const char *target, const char *file, int line, const char *func) "%s->%s (%s:%d:%s)"
--
2.5.0
next prev parent reply other threads:[~2016-03-01 15:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-01 15:48 [Qemu-devel] [PULL 00/13] Tracing patches Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 01/13] trace: drop trailing empty strings Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 02/13] trace: docs: "simple" backend does support strings Stefan Hajnoczi
2016-03-01 15:48 ` Stefan Hajnoczi [this message]
2016-03-01 15:48 ` [Qemu-devel] [PULL 04/13] trace: use addresses instead of offsets in memory tracepoints Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 05/13] vl: fix tracing initialization Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 06/13] trace: Extend API to manage event arguments Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 07/13] trace: Remove unnecessary intermediate event copies Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 08/13] tcg: Add type for vCPU pointers Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 09/13] tcg: Move definition of type TCGv Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 10/13] trace: Add helper function to cast event arguments Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 11/13] typedefs: Add CPUState Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 12/13] trace: Add 'vcpu' event property to trace guest vCPU Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 13/13] trace: Add a proper API to manage auto-generated events from the 'tcg' property Stefan Hajnoczi
2016-03-01 16:47 ` [Qemu-devel] [PULL 00/13] 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=1456847294-13576-4-git-send-email-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=hollis_blanchard@mentor.com \
--cc=peter.maydell@linaro.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).