* [Qemu-devel] Accessing process ID in QEMU
@ 2007-04-05 6:23 Shashidhar Mysore
2007-04-05 16:26 ` André Braga
0 siblings, 1 reply; 2+ messages in thread
From: Shashidhar Mysore @ 2007-04-05 6:23 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 693 bytes --]
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.
[-- Attachment #2: Type: text/html, Size: 725 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] Accessing process ID in QEMU
2007-04-05 6:23 [Qemu-devel] Accessing process ID in QEMU Shashidhar Mysore
@ 2007-04-05 16:26 ` André Braga
0 siblings, 0 replies; 2+ messages in thread
From: André Braga @ 2007-04-05 16:26 UTC (permalink / raw)
To: qemu-devel
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.
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-04-05 16:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-05 6:23 [Qemu-devel] Accessing process ID in QEMU Shashidhar Mysore
2007-04-05 16:26 ` André Braga
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).