From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M6kiV-0001eA-5X for qemu-devel@nongnu.org; Wed, 20 May 2009 08:16:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M6kiU-0001dj-KM for qemu-devel@nongnu.org; Wed, 20 May 2009 08:16:14 -0400 Received: from [199.232.76.173] (port=43593 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M6kiU-0001dR-Gq for qemu-devel@nongnu.org; Wed, 20 May 2009 08:16:14 -0400 Received: from fg-out-1718.google.com ([72.14.220.157]:38046) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M6kiU-0003YO-3i for qemu-devel@nongnu.org; Wed, 20 May 2009 08:16:14 -0400 Received: by fg-out-1718.google.com with SMTP id e21so145354fga.8 for ; Wed, 20 May 2009 05:16:12 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <200905201148.43631.paul@codesourcery.com> References: <1242745197.24234.7.camel@peak10.cs.hut.fi> <200905201148.43631.paul@codesourcery.com> Date: Wed, 20 May 2009 14:16:12 +0200 Message-ID: <761ea48b0905200516g47713089g5d0b06f6f94bcd1a@mail.gmail.com> Subject: Re: [Qemu-devel] Instruction counting instrumentation for ARM + initial patch From: Laurent Desnogues Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?Timo_T=F6yry?= Cc: qemu-devel@nongnu.org On Wed, May 20, 2009 at 12:48 PM, Paul Brook wrote: > On Tuesday 19 May 2009, Timo T=F6yry wrote: >> Hi, >> >> The attached patch implements instruction counting instrumentation for >> ARM usermode linux. Currently the patch is a working draft but we >> intend to clean it up for possible inclusion. We'd appreciate any >> comments. Below is a more detailed description. > > Ewww. This looks pretty much impossible to maintain. > If you really want to do this I recommend dumping an execution trace, and > having a third party utility do the counting after the fact. My advice would be similar to Paul's: for my instruction counter, instead of counting instructions, I count translation blocks. I can either output a TB trace (which can be huge, but useful to do trace analysis) or an execution count for each TB. As a postpass you can do whatever you want. The benefits, on top of being easier to maintain, are that it's more flexible, it has a very small impact on QEMU execution time, and it can be trivially ported to any front end. The problem is to play nicely with TB flushes :-) HTH, Laurent