qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Looking for the correct way to pull register values out of QEMU
@ 2011-05-25 16:42 Nathan DeBardeleben
  2011-05-25 17:50 ` Mulyadi Santosa
  2011-05-25 18:01 ` Richard Henderson
  0 siblings, 2 replies; 3+ messages in thread
From: Nathan DeBardeleben @ 2011-05-25 16:42 UTC (permalink / raw)
  To: qemu-devel

Hello all, hopefully this message is not too trivial.  I am looking for 
some simple direction.

What I am looking to do is to pull the register states out of a QEMU 
session external to the session.  I figure at very least I could save 
the state of the VM to a file and then dig through it but this would be 
exceedingly tedious, especially considering I intend to use this for 
periodic sampling.

Are there interfaces that do this now and if there are not, can you 
point me towards section of the source to best modify?

Basically what I'd like to be able to do is periodically poke into a 
running QEMU VM and drag down the registers, in particular, the PC, and 
then record that.  Over time, with samples, I would have some sort of 
distribution of where the PC was during a run.

Now to be clear, this isn't really what I want this for, but if I could 
do this, it would basically go a long way towards this research.

So imagine:

1: Stop QEMU (maybe not necessary?)
2: Drag down the set of registers
3: Release QEMU (contingent on #1)
4: Repeat over some periodic sampling rate.
5: Produce a "gprof-like" graph of where the PC was during the time 
observed.

I realize that without information from the kernel about the instruction 
ranges for each application I will be unable to tie this information 
back to which applications were running.

Any tips / help anyone can provide would be very useful.

Thank you.

-- 
- Nathan

----------------------------------------------------
   Nathan DeBardeleben, Ph.D.
   Los Alamos National Laboratory
   High Perf. Computing Systems Integration (HPC-5)
   Ultra-Scale Research Center, Resilience Lead
   email: ndebard@lanl.gov
----------------------------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] Looking for the correct way to pull register values out of QEMU
  2011-05-25 16:42 [Qemu-devel] Looking for the correct way to pull register values out of QEMU Nathan DeBardeleben
@ 2011-05-25 17:50 ` Mulyadi Santosa
  2011-05-25 18:01 ` Richard Henderson
  1 sibling, 0 replies; 3+ messages in thread
From: Mulyadi Santosa @ 2011-05-25 17:50 UTC (permalink / raw)
  To: Nathan DeBardeleben; +Cc: qemu-devel

On Wed, May 25, 2011 at 23:42, Nathan DeBardeleben <ndebard@lanl.gov> wrote:
> Hello all, hopefully this message is not too trivial.  I am looking for some
> simple direction.
>
> What I am looking to do is to pull the register states out of a QEMU session
> external to the session.  I figure at very least I could save the state of
> the VM to a file and then dig through it but this would be exceedingly
> tedious, especially considering I intend to use this for periodic sampling.

is "info register" command in Qemu monitor something that fits your
above requirement? have you tried it?

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] Looking for the correct way to pull register values out of QEMU
  2011-05-25 16:42 [Qemu-devel] Looking for the correct way to pull register values out of QEMU Nathan DeBardeleben
  2011-05-25 17:50 ` Mulyadi Santosa
@ 2011-05-25 18:01 ` Richard Henderson
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2011-05-25 18:01 UTC (permalink / raw)
  To: Nathan DeBardeleben; +Cc: qemu-devel

On 05/25/2011 09:42 AM, Nathan DeBardeleben wrote:
> 1: Stop QEMU (maybe not necessary?)
> 2: Drag down the set of registers
> 3: Release QEMU (contingent on #1)
> 4: Repeat over some periodic sampling rate.
> 5: Produce a "gprof-like" graph of where the PC was during the time observed.

The gdb remote protocol is fairly simple.  It would be pretty easy to start
QEMU with the -gdb tcp::port option, and write a script to grab the data you
want as well as format it as desired.

It may be even easier to write the script in python and run it within gdb itself.


r~

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-25 18:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-25 16:42 [Qemu-devel] Looking for the correct way to pull register values out of QEMU Nathan DeBardeleben
2011-05-25 17:50 ` Mulyadi Santosa
2011-05-25 18:01 ` Richard Henderson

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