From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HZUqT-0002Xi-5a for qemu-devel@nongnu.org; Thu, 05 Apr 2007 12:29:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HZUqN-0002XW-NP for qemu-devel@nongnu.org; Thu, 05 Apr 2007 12:29:55 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HZUqN-0002XT-Gu for qemu-devel@nongnu.org; Thu, 05 Apr 2007 12:29:51 -0400 Received: from py-out-1112.google.com ([64.233.166.181]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HZUmy-000878-Vt for qemu-devel@nongnu.org; Thu, 05 Apr 2007 12:26:21 -0400 Received: by py-out-1112.google.com with SMTP id h31so424118pyc for ; Thu, 05 Apr 2007 09:26:19 -0700 (PDT) Message-ID: <2ad73a0704050926p4381de1q8a19b2751d06ef0c@mail.gmail.com> Date: Thu, 5 Apr 2007 13:26:19 -0300 From: "=?ISO-8859-1?Q?Andr=E9_Braga?=" Subject: Re: [Qemu-devel] Accessing process ID in QEMU In-Reply-To: <12835c8f0704042323x686d5c8hb99b849e4d99a927@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <12835c8f0704042323x686d5c8hb99b849e4d99a927@mail.gmail.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 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. >