From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Cc: Cheif Jones <avivgnet@gmail.com>
Subject: Re: [Qemu-devel] Performance Monitoring
Date: Tue, 20 May 2008 23:06:44 +0100 [thread overview]
Message-ID: <200805202306.45277.paul@codesourcery.com> (raw)
In-Reply-To: <3000d2e90805201156g30050a68ve9187e3b94341e99@mail.gmail.com>
> I'm doing a research project in which i want to run an OS under an emulator
> for a period of time and get full CPU opcode statistics (how many times
> every opcode was executed). As far as i understand the Qemu design, it is
> doing "JIT" translation of terget opcode to host opcodes to improve
> performance, and so there is no easy way to count target opcodes (e.g a
> loop is compiled JIT and runs natively).
>
> Is it possible to disable Qemu's JIT capabilities and get target opcode
> statistics?
You've a couple of options:
- Disable TB caching (so code is always translated whenever it is run), and do
the counting during translation. Performance is going to be fairly sucky.
- Inject the counters into the translated code. This is maybe a bit more
work, but should perform much better.
With either alternative you'll still have issues with exceptions. MMU faults
abort a TB early, so will screw up your statistics. One possibility is to
terminate a TB on every memory access, like we do for watchpoints.
You probably already know this, but I'd be surprised if the statistics you get
have much/any correlation with real world performance on modern hardware.
Paul
next prev parent reply other threads:[~2008-05-20 22:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-20 18:56 [Qemu-devel] Performance Monitoring Cheif Jones
2008-05-20 22:06 ` Paul Brook [this message]
2008-05-21 0:09 ` Vince Weaver
2008-05-21 6:41 ` Laurent Desnogues
2008-05-20 22:44 ` Stanislav Shwartsman
2008-05-21 16:10 ` [Qemu-devel] " Charles Duffy
2008-05-22 3:46 ` Glauber Costa
2008-05-22 6:13 ` Cheif Jones
2008-05-23 3:38 ` Vince Weaver
2008-05-25 12:22 ` Cheif Jones
2008-05-28 0:21 ` Vince Weaver
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=200805202306.45277.paul@codesourcery.com \
--to=paul@codesourcery.com \
--cc=avivgnet@gmail.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).