Received: from [140.186.70.92] (port=46113 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P2k1D-0000h7-0D for qemu-devel@nongnu.org; Mon, 04 Oct 2010 08:19:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P2k1B-0008NW-RE for qemu-devel@nongnu.org; Mon, 04 Oct 2010 08:19:46 -0400 Received: from mailout-de.gmx.net ([213.165.64.22]:43079 helo=mail.gmx.net) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1P2k1B-0008NG-99 for qemu-devel@nongnu.org; Mon, 04 Oct 2010 08:19:45 -0400 From: xscript@gmx.net (=?utf-8?Q?Llu=C3=ADs?=) Subject: Re: [Qemu-devel] profiling software execution using qemu References: <1286132530.15589.6.camel@bahadir-laptop> Date: Mon, 04 Oct 2010 14:18:03 +0200 In-Reply-To: <1286132530.15589.6.camel@bahadir-laptop> (Bahadir Balban's message of "Sun, 03 Oct 2010 22:02:10 +0300") Message-ID: <87vd5ii22s.fsf@ginnungagap.bsc.es> MIME-Version: 1.0 Content-Type: text/plain List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bahadir Balban Cc: qemu-devel@nongnu.org Bahadir Balban writes: > I would like to trace instruction execution using QEMU. Is this > possible? > Ideally I would like to dump all executed instruction locations to a > file, then match this information to function names based on the debug > symbols in my ELF file, then finally analyze the parts that execute the > most. Is this possible with qemu? Anyone who did this kind of work? If you want it for x86, you might use this (I still haven't inserted points for other architectures): git clone https://code.gso.ac.upc.edu/git/qemu-instrument https://projects.gso.ac.upc.edu/projects/qemu-instrument This is just a set of static instrumentation points, what to do with them is up to you. If you just want tracing the addresses you could simply define a INSTR_GEN_FETCH that calls a helper you must define that, in turn, writes your information into disk by any means you see fit. Note that this is just a proof of concept, so in the worst case it can give you some hints on where to look for the information that you want. Lluis -- "And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Norton Juster in The Phantom Tollbooth