qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Logging Memory Writes in Qemu
@ 2011-10-07  9:56 Johannes Stuettgen
  0 siblings, 0 replies; only message in thread
From: Johannes Stuettgen @ 2011-10-07  9:56 UTC (permalink / raw)
  To: qemu-devel

Hello,

i am trying to perform some memory measurements and was hoping you could 
point me in the right direction:

My goal is to log every write access to physical memory, the physical 
address written as well as the total amount of bytes that are written 
(modified) in each access.
My first idea after reading the documentation was to change the 
MemoryOps->write ptr to point to a logging function and then pass the 
arguments back to the original. However i could'nt reliably locate the 
place in the code where these ops get initialized.

I also had a look at exec.c, and tried to hook into 'void 
cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf, int len, 
int is_write)'. This function gets called when starting qemu without any 
arguments (and thus no harddiscs or cdrom images), however as soon as i 
boot a harddisk the function does not seem to get called anymore.

These are the calls i get when booting an empty system:
0xAdress:written_bytes
-------------------------------
0x07FDD000:590
0x07FDC900:16
0x07FDC88C:4
0x07FDD800:590
0x07FDC910:16
0x07FDC89C:4
0x07FDE000:590
0x07FDC920:16
0x07FDC8AC:4

What would be the 'right' place to place such a hook in your opinion?

Sincerly,
Johannes Stuettgen

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-10-07  9:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-07  9:56 [Qemu-devel] Logging Memory Writes in Qemu Johannes Stuettgen

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).