qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vince Weaver <vince@csl.cornell.edu>
To: Laurent Desnogues <laurent.desnogues@gmail.com>
Cc: "Timo Töyry" <ttoyry@cs.hut.fi>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Instruction counting instrumentation for ARM + initial patch
Date: Wed, 20 May 2009 16:35:25 -0400 (EDT)	[thread overview]
Message-ID: <20090520162441.L73304@stanley.csl.cornell.edu> (raw)
In-Reply-To: <761ea48b0905200516g47713089g5d0b06f6f94bcd1a@mail.gmail.com>


I wonder if a simplistic stats gathering frame work could be added to 
Qemu.

The problem is there currently are at least 3 users of Qemu:
   1.  People who want fast simulation
   2.  People who are doing virtualization
   3.  People trying to do instrumentation/research

Unfortunately those three groups have conflicting interests.

The main problem is that adding instrumentation infrastructure will either 
slow down the common case, or else introduce lots of #ifdefs all over the 
code.  Neither is very attractive.

It would be nice if maybe a limited instrumentation architecture could
be put into qemu, that could be configured out.  It would save the various 
researchers the problem of everyone re-implementing it differently.

It would be nice to have:
   1. A way to dump an instruction trace (address, length (for CISC),
      and opcode, CPU# for multi-thread)
   2. A way to dump memory traces (address, length, possibly the value
      loaded/stored, CPU# for multi-thread)
   3. A way to dump basic-block entry/exit

Many of the various research metrics can be gained from these stats.
   #1 and #2 are enough for cache simulators.
   #1 (if post-processed) is enough to get a frequency plot for instruction
      count and type.
   #1 can be used to extrapolate branch-taken statistics for branch
      predictors
   #3 Can be used for basic block vectors, or to get faster instruction
      counts

I'm not sure if it's possible to do this in a non-intrusive way that would 
be acceptable to the other users of Qemu though.

Pin manages to have their null plugin run very fast; at least one
of the Spec2k binaries runs faster translated than it does natively.

Vince

  reply	other threads:[~2009-05-20 20:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-19 14:59 [Qemu-devel] Instruction counting instrumentation for ARM + initial patch Timo Töyry
2009-05-20 10:48 ` Paul Brook
2009-05-20 12:16   ` Laurent Desnogues
2009-05-20 20:35     ` Vince Weaver [this message]
2009-05-23 13:23       ` Laurent Desnogues
2009-05-25 15:04         ` Sami Kiminki

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=20090520162441.L73304@stanley.csl.cornell.edu \
    --to=vince@csl.cornell.edu \
    --cc=laurent.desnogues@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=ttoyry@cs.hut.fi \
    /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).