From: Johannes Stuettgen <johannes.stuettgen@googlemail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Logging Memory Writes in Qemu
Date: Fri, 07 Oct 2011 11:56:34 +0200 [thread overview]
Message-ID: <4E8ECCD2.6070905@gmail.com> (raw)
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
reply other threads:[~2011-10-07 9:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4E8ECCD2.6070905@gmail.com \
--to=johannes.stuettgen@googlemail.com \
--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).