qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "André Braga" <meianoite@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Accessing process ID in QEMU
Date: Thu, 5 Apr 2007 13:26:19 -0300	[thread overview]
Message-ID: <2ad73a0704050926p4381de1q8a19b2751d06ef0c@mail.gmail.com> (raw)
In-Reply-To: <12835c8f0704042323x686d5c8hb99b849e4d99a927@mail.gmail.com>

I guess you're mixing some concepts. A PID is a concept from the
operating system, not from the hardware, emulated or physical.

What you could do, however, is experiment with user-mode emulation.
Check out the QEMU documentation regarding how to use this mode.

You could conceivably mess with the operating system scheduler code to
emit every context switch to user-land and dump the PID of the current
process to the serial port, and have QEMU trap when certain
instructions are executed, and then you cross this information
yourself. But that just doesn't sound right, specially considering how
fast and often context switches happen.

OTOH, if you know where in memory the OS stores the current PID, you
could make QEMU trap on that instruction and then dump the memory
location of interest.

HTH,


On 4/5/07, Shashidhar Mysore <shashimc@gmail.com> wrote:
> Hi,
>
> I am trying to add commands to the monitor which can enable or disable
> tracing in QEMU. As arguments to this command I would like to pass the
> process ID of the process I wish to trace. Can anybody tell me how to access
> the process ID from within QEMU?
>
> Basically, whenever I see an instruction executing I want to capture more
> details about the instruction such as the type of instruction, the process
> ID of the process on behalf of which this instruction is executing (other
> details I'm interested in is if this is a load or store, memory address, and
> memory value loaded/stored, etc). Can you please tell me how to figure out
> these details, especially the process ID.
>
> Thanks,
> -Shashi.
>

      reply	other threads:[~2007-04-05 16:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-05  6:23 [Qemu-devel] Accessing process ID in QEMU Shashidhar Mysore
2007-04-05 16:26 ` André Braga [this message]

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=2ad73a0704050926p4381de1q8a19b2751d06ef0c@mail.gmail.com \
    --to=meianoite@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).