qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: "\"陳韋任 (Wei-Ren Chen)\"" <chenwj@iis.sinica.edu.tw>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Any better way to access CPUArchState in vl.c?
Date: Tue, 19 Jun 2012 11:54:46 +0200	[thread overview]
Message-ID: <4FE04C66.2070203@suse.de> (raw)
In-Reply-To: <20120619090230.GA39361@cs.nctu.edu.tw>

Hi,

Am 19.06.2012 11:02, schrieb 陳韋任 (Wei-Ren Chen):
>> Question is, what are you trying to do? In particular, of which CPU
>> (think SMP) are you trying to print ->some_field? :)
> 
>   Currently we only consider single CPU ARM guest, so there should be only one
> env we need to take care of. We add some fields into CPUState and want to print
> their value when the VM is terminated. For example,
> 
> ---
> static void main_loop(void)
> {
>     do {
>         nonblocking = !kvm_enabled() && last_io > 0;
>         last_io = main_loop_wait(nonblocking);
>     } while (!main_loop_should_exit());
> 
>     // print env->some_field1
>     // print env->some_field2
> }
> ---
> 
> If we can access env in vl.c directly, it would make the task easier.

If you only have one CPU then using first_cpu->some_field1 should be
almost as easy. :)

Regards,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2012-06-19  9:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-18  7:47 [Qemu-devel] Any better way to access CPUArchState in vl.c? 陳韋任 (Wei-Ren Chen)
2012-06-18 10:01 ` Andreas Färber
2012-06-19  9:02   ` 陳韋任 (Wei-Ren Chen)
2012-06-19  9:54     ` Andreas Färber [this message]
2012-06-19 11:54       ` 陳韋任 (Wei-Ren Chen)
2012-06-19 12:08         ` Peter Maydell
2012-06-20  8:03           ` 陳韋任 (Wei-Ren Chen)
2012-06-19 12:09         ` Peter Crosthwaite
2012-06-19 13:21           ` Andreas Färber
2012-06-19 12:12         ` Andreas Färber

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=4FE04C66.2070203@suse.de \
    --to=afaerber@suse.de \
    --cc=chenwj@iis.sinica.edu.tw \
    --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).