diff options
author | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2021-03-07 08:48:33 +0100 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2021-07-09 18:42:46 +0200 |
commit | 9bb5405482e7be4c0a6f259d4f18ea612d4a31ba (patch) | |
tree | a9cbd0bccdd5308c83b4aae42dae0ecd6f2c64e4 /softmmu/memory.c | |
parent | 0849cb547844b7205af01455b82dc54956c978a9 (diff) |
memory: Display MemoryRegion name in read/write ops trace events
MemoryRegion names is cached on first call to memory_region_name(),
so displaying the name is trace events is cheap. Add it for read /
write ops.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210307074833.143106-1-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'softmmu/memory.c')
-rw-r--r-- | softmmu/memory.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/softmmu/memory.c b/softmmu/memory.c index f0161515e9..24a97c8b1f 100644 --- a/softmmu/memory.c +++ b/softmmu/memory.c @@ -442,7 +442,8 @@ static MemTxResult memory_region_read_accessor(MemoryRegion *mr, trace_memory_region_subpage_read(get_cpu_index(), mr, addr, tmp, size); } else if (trace_event_get_state_backends(TRACE_MEMORY_REGION_OPS_READ)) { hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr); - trace_memory_region_ops_read(get_cpu_index(), mr, abs_addr, tmp, size); + trace_memory_region_ops_read(get_cpu_index(), mr, abs_addr, tmp, size, + memory_region_name(mr)); } memory_region_shift_read_access(value, shift, mask, tmp); return MEMTX_OK; @@ -464,7 +465,8 @@ static MemTxResult memory_region_read_with_attrs_accessor(MemoryRegion *mr, trace_memory_region_subpage_read(get_cpu_index(), mr, addr, tmp, size); } else if (trace_event_get_state_backends(TRACE_MEMORY_REGION_OPS_READ)) { hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr); - trace_memory_region_ops_read(get_cpu_index(), mr, abs_addr, tmp, size); + trace_memory_region_ops_read(get_cpu_index(), mr, abs_addr, tmp, size, + memory_region_name(mr)); } memory_region_shift_read_access(value, shift, mask, tmp); return r; @@ -484,7 +486,8 @@ static MemTxResult memory_region_write_accessor(MemoryRegion *mr, trace_memory_region_subpage_write(get_cpu_index(), mr, addr, tmp, size); } else if (trace_event_get_state_backends(TRACE_MEMORY_REGION_OPS_WRITE)) { hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr); - trace_memory_region_ops_write(get_cpu_index(), mr, abs_addr, tmp, size); + trace_memory_region_ops_write(get_cpu_index(), mr, abs_addr, tmp, size, + memory_region_name(mr)); } mr->ops->write(mr->opaque, addr, tmp, size); return MEMTX_OK; @@ -504,7 +507,8 @@ static MemTxResult memory_region_write_with_attrs_accessor(MemoryRegion *mr, trace_memory_region_subpage_write(get_cpu_index(), mr, addr, tmp, size); } else if (trace_event_get_state_backends(TRACE_MEMORY_REGION_OPS_WRITE)) { hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr); - trace_memory_region_ops_write(get_cpu_index(), mr, abs_addr, tmp, size); + trace_memory_region_ops_write(get_cpu_index(), mr, abs_addr, tmp, size, + memory_region_name(mr)); } return mr->ops->write_with_attrs(mr->opaque, addr, tmp, size, attrs); } |