Skip to contentSkip to conversation

How to get memroy trace in qemu-system-arm or qemu-arm

Qemu-arm Jimmy Situ 2 participants 2 messages Nov 29, 2015

lore
Share & tools
lore

Jimmy Situ

author
#0 lore raw

Dear all,

I am trying to capture memory access with qemu-system-arm, and I find there is get_phys_addr in target-arm/helper.c
So I add a qemu trace event in it. It seems this trace can capture some memroy access. However, the trace address trace doses not make any sence.

Do anyone know about this get_phys_addr() function. Does it call by every memory access? If not, how could I capture the memory trace correctly?

Thanks.

#1 lore raw
Quoted 8 lines · Jimmy Situ

I am trying to capture memory access with qemu-system-arm, and I find there is get_phys_addr in target-arm/helper.c
So I add a qemu trace event in it. It seems this trace can capture some memroy access. However, the trace address trace doses not make any sence.

Do anyone know about this get_phys_addr() function. Does it call by every memory access?
If not, how could I capture the memory trace correctly?

No, get_phys_addr is not called for every access:
(1) we cache the results of virtual-to-physical lookups in a TLB, because they're expensive; subsequent TLB hits won't call the function again
(2) direct physical address accesses won't go through the function (for ARM this just means the memory accesses done as part of the page table walk)

QEMU doesn't currently provide any way of tracing all guest memory accesses, I'm afraid -- our design is more aimed at running guest code fast, rather than providing detailed information on things the guest is doing.

thanks
-- PMM