-----BEGIN PGP SIGNATURE-----

Version: GnuPG v1
 
 iQEcBAABAgAGBQJW5qAFAAoJEJykq7OBq3PIii0H/1u46qp77HP0NLp2NXSqKc/T
 gdFXcI/yquclABMk0L79yxigC3KtpACHWSXmHkEnAAYIPJNfoez59Ol7U10gDP8k
 NKL0avpPbukCzuenlkP0/uGDwS3c25+zWxd5eabhL9AapsnAKvJdhnzkbLT62gP7
 cemrHwnXRkRmKKGeloAiJiKxZakM44yr05MMAI+Yt0bsKFxGwmM63ZAW8KESJBlE
 CodIEROBSDcOusN3EkBE6zBnVEb7RVVROk3QmdFjLE8olDH7Pn5yfMzs5mmgJErt
 CCy1sPPIqBeHnLOAo0HrUazF06HnIC6WXa86Xg/emcodaFuwFivRrcege2dkHEc=
 =T7PV
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging

# gpg: Signature made Mon 14 Mar 2016 11:27:01 GMT using RSA key ID 81AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"

* remotes/stefanha/tags/tracing-pull-request:
  trace: separate MMIO tracepoints from TB-access tracepoints
  trace: include CPU index in trace_memory_region_*()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2016-03-14 16:22:17 +00:00
commit 618a5a8bc5
2 changed files with 56 additions and 16 deletions

View File

@ -386,6 +386,14 @@ static hwaddr memory_region_to_absolute_addr(MemoryRegion *mr, hwaddr offset)
return abs_addr; return abs_addr;
} }
static int get_cpu_index(void)
{
if (current_cpu) {
return current_cpu->cpu_index;
}
return -1;
}
static MemTxResult memory_region_oldmmio_read_accessor(MemoryRegion *mr, static MemTxResult memory_region_oldmmio_read_accessor(MemoryRegion *mr,
hwaddr addr, hwaddr addr,
uint64_t *value, uint64_t *value,
@ -398,10 +406,15 @@ static MemTxResult memory_region_oldmmio_read_accessor(MemoryRegion *mr,
tmp = mr->ops->old_mmio.read[ctz32(size)](mr->opaque, addr); tmp = mr->ops->old_mmio.read[ctz32(size)](mr->opaque, addr);
if (mr->subpage) { if (mr->subpage) {
trace_memory_region_subpage_read(mr, addr, tmp, size); trace_memory_region_subpage_read(get_cpu_index(), mr, addr, tmp, size);
} else if (mr == &io_mem_notdirty) {
/* Accesses to code which has previously been translated into a TB show
* up in the MMIO path, as accesses to the io_mem_notdirty
* MemoryRegion. */
trace_memory_region_tb_read(get_cpu_index(), addr, tmp, size);
} else if (TRACE_MEMORY_REGION_OPS_READ_ENABLED) { } else if (TRACE_MEMORY_REGION_OPS_READ_ENABLED) {
hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr); hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr);
trace_memory_region_ops_read(mr, abs_addr, tmp, size); trace_memory_region_ops_read(get_cpu_index(), mr, abs_addr, tmp, size);
} }
*value |= (tmp & mask) << shift; *value |= (tmp & mask) << shift;
return MEMTX_OK; return MEMTX_OK;
@ -419,10 +432,15 @@ static MemTxResult memory_region_read_accessor(MemoryRegion *mr,
tmp = mr->ops->read(mr->opaque, addr, size); tmp = mr->ops->read(mr->opaque, addr, size);
if (mr->subpage) { if (mr->subpage) {
trace_memory_region_subpage_read(mr, addr, tmp, size); trace_memory_region_subpage_read(get_cpu_index(), mr, addr, tmp, size);
} else if (mr == &io_mem_notdirty) {
/* Accesses to code which has previously been translated into a TB show
* up in the MMIO path, as accesses to the io_mem_notdirty
* MemoryRegion. */
trace_memory_region_tb_read(get_cpu_index(), addr, tmp, size);
} else if (TRACE_MEMORY_REGION_OPS_READ_ENABLED) { } else if (TRACE_MEMORY_REGION_OPS_READ_ENABLED) {
hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr); hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr);
trace_memory_region_ops_read(mr, abs_addr, tmp, size); trace_memory_region_ops_read(get_cpu_index(), mr, abs_addr, tmp, size);
} }
*value |= (tmp & mask) << shift; *value |= (tmp & mask) << shift;
return MEMTX_OK; return MEMTX_OK;
@ -441,10 +459,15 @@ static MemTxResult memory_region_read_with_attrs_accessor(MemoryRegion *mr,
r = mr->ops->read_with_attrs(mr->opaque, addr, &tmp, size, attrs); r = mr->ops->read_with_attrs(mr->opaque, addr, &tmp, size, attrs);
if (mr->subpage) { if (mr->subpage) {
trace_memory_region_subpage_read(mr, addr, tmp, size); trace_memory_region_subpage_read(get_cpu_index(), mr, addr, tmp, size);
} else if (mr == &io_mem_notdirty) {
/* Accesses to code which has previously been translated into a TB show
* up in the MMIO path, as accesses to the io_mem_notdirty
* MemoryRegion. */
trace_memory_region_tb_read(get_cpu_index(), addr, tmp, size);
} else if (TRACE_MEMORY_REGION_OPS_READ_ENABLED) { } else if (TRACE_MEMORY_REGION_OPS_READ_ENABLED) {
hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr); hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr);
trace_memory_region_ops_read(mr, abs_addr, tmp, size); trace_memory_region_ops_read(get_cpu_index(), mr, abs_addr, tmp, size);
} }
*value |= (tmp & mask) << shift; *value |= (tmp & mask) << shift;
return r; return r;
@ -462,10 +485,15 @@ static MemTxResult memory_region_oldmmio_write_accessor(MemoryRegion *mr,
tmp = (*value >> shift) & mask; tmp = (*value >> shift) & mask;
if (mr->subpage) { if (mr->subpage) {
trace_memory_region_subpage_write(mr, addr, tmp, size); trace_memory_region_subpage_write(get_cpu_index(), mr, addr, tmp, size);
} else if (mr == &io_mem_notdirty) {
/* Accesses to code which has previously been translated into a TB show
* up in the MMIO path, as accesses to the io_mem_notdirty
* MemoryRegion. */
trace_memory_region_tb_write(get_cpu_index(), addr, tmp, size);
} else if (TRACE_MEMORY_REGION_OPS_WRITE_ENABLED) { } else if (TRACE_MEMORY_REGION_OPS_WRITE_ENABLED) {
hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr); hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr);
trace_memory_region_ops_write(mr, abs_addr, tmp, size); trace_memory_region_ops_write(get_cpu_index(), mr, abs_addr, tmp, size);
} }
mr->ops->old_mmio.write[ctz32(size)](mr->opaque, addr, tmp); mr->ops->old_mmio.write[ctz32(size)](mr->opaque, addr, tmp);
return MEMTX_OK; return MEMTX_OK;
@ -483,10 +511,15 @@ static MemTxResult memory_region_write_accessor(MemoryRegion *mr,
tmp = (*value >> shift) & mask; tmp = (*value >> shift) & mask;
if (mr->subpage) { if (mr->subpage) {
trace_memory_region_subpage_write(mr, addr, tmp, size); trace_memory_region_subpage_write(get_cpu_index(), mr, addr, tmp, size);
} else if (mr == &io_mem_notdirty) {
/* Accesses to code which has previously been translated into a TB show
* up in the MMIO path, as accesses to the io_mem_notdirty
* MemoryRegion. */
trace_memory_region_tb_write(get_cpu_index(), addr, tmp, size);
} else if (TRACE_MEMORY_REGION_OPS_WRITE_ENABLED) { } else if (TRACE_MEMORY_REGION_OPS_WRITE_ENABLED) {
hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr); hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr);
trace_memory_region_ops_write(mr, abs_addr, tmp, size); trace_memory_region_ops_write(get_cpu_index(), mr, abs_addr, tmp, size);
} }
mr->ops->write(mr->opaque, addr, tmp, size); mr->ops->write(mr->opaque, addr, tmp, size);
return MEMTX_OK; return MEMTX_OK;
@ -504,10 +537,15 @@ static MemTxResult memory_region_write_with_attrs_accessor(MemoryRegion *mr,
tmp = (*value >> shift) & mask; tmp = (*value >> shift) & mask;
if (mr->subpage) { if (mr->subpage) {
trace_memory_region_subpage_write(mr, addr, tmp, size); trace_memory_region_subpage_write(get_cpu_index(), mr, addr, tmp, size);
} else if (mr == &io_mem_notdirty) {
/* Accesses to code which has previously been translated into a TB show
* up in the MMIO path, as accesses to the io_mem_notdirty
* MemoryRegion. */
trace_memory_region_tb_write(get_cpu_index(), addr, tmp, size);
} else if (TRACE_MEMORY_REGION_OPS_WRITE_ENABLED) { } else if (TRACE_MEMORY_REGION_OPS_WRITE_ENABLED) {
hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr); hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr);
trace_memory_region_ops_write(mr, abs_addr, tmp, size); trace_memory_region_ops_write(get_cpu_index(), mr, abs_addr, tmp, size);
} }
return mr->ops->write_with_attrs(mr->opaque, addr, tmp, size, attrs); return mr->ops->write_with_attrs(mr->opaque, addr, tmp, size, attrs);
} }

View File

@ -1620,10 +1620,12 @@ 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" translate_block(void *tb, uintptr_t pc, uint8_t *tb_code) "tb:%p, pc:0x%"PRIxPTR", tb_code:%p"
# memory.c # 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_read(int cpu_index, void *mr, uint64_t addr, uint64_t value, unsigned size) "cpu %d 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_write(int cpu_index, void *mr, uint64_t addr, uint64_t value, unsigned size) "cpu %d mr %p addr %#"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_read(int cpu_index, void *mr, uint64_t offset, uint64_t value, unsigned size) "cpu %d 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" memory_region_subpage_write(int cpu_index, void *mr, uint64_t offset, uint64_t value, unsigned size) "cpu %d mr %p offset %#"PRIx64" value %#"PRIx64" size %u"
memory_region_tb_read(int cpu_index, uint64_t addr, uint64_t value, unsigned size) "cpu %d addr %#"PRIx64" value %#"PRIx64" size %u"
memory_region_tb_write(int cpu_index, uint64_t addr, uint64_t value, unsigned size) "cpu %d addr %#"PRIx64" value %#"PRIx64" size %u"
# qom/object.c # 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)" object_dynamic_cast_assert(const char *type, const char *target, const char *file, int line, const char *func) "%s->%s (%s:%d:%s)"