Received: from [140.186.70.92] (port=38434 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhO8m-0000u4-5w for qemu-devel@nongnu.org; Mon, 24 Jan 2011 10:15:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PhO8k-0004KA-ML for qemu-devel@nongnu.org; Mon, 24 Jan 2011 10:15:36 -0500 Received: from mailout-de.gmx.net ([213.165.64.22]:35033) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PhO8k-0004Je-7Q for qemu-devel@nongnu.org; Mon, 24 Jan 2011 10:15:34 -0500 From: =?utf-8?Q?Llu=C3=ADs?= Subject: Re: [Qemu-devel] TCG flow vs dyngen References: <000001cbb58c$221f5a00$011aa8c0@side35ya3cah0n> <4D330D01.9060801@gmail.com> <4D3CA28C.5080907@landley.net> <4D3D9334.6050801@gmail.com> Date: Mon, 24 Jan 2011 16:15:15 +0100 In-Reply-To: <4D3D9334.6050801@gmail.com> (Stefano Bonifazi's message of "Mon, 24 Jan 2011 15:56:52 +0100") Message-ID: <87fwsis58c.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: qemu-devel@nongnu.org Stefano Bonifazi writes: > On 01/24/2011 03:32 PM, Peter Maydell wrote: >> >> Being a JIT doesn't prohibit counting target instructions executed. >> It just means that counting them generally requires generating >> code to do the counting at runtime, so it's a more complicated >> change to make than it would be in a non-JIT emulator. >> > What do you mean? Should I change the code of qemu-user for counting the > instructions, or should I add code into the target binaries? If I recall this correctly, target-i386 has a generic function (whose name I don't remember) called whenever the rdtsc instruction is executed. This function rebuilds the counter that contains the number of executed instructions (more or less, this number can be tuned from a variety of sources). 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