From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X73Y3-0006GK-Ck for qemu-devel@nongnu.org; Tue, 15 Jul 2014 10:17:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X73Xv-0003Us-UB for qemu-devel@nongnu.org; Tue, 15 Jul 2014 10:17:39 -0400 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:59910 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X73Xv-0003U2-Nj for qemu-devel@nongnu.org; Tue, 15 Jul 2014 10:17:31 -0400 References: <1405424541-21803-1-git-send-email-alex.bennee@linaro.org> <1405424541-21803-4-git-send-email-alex.bennee@linaro.org> <53C52A66.5000906@redhat.com> From: Alex =?utf-8?Q?Benn=C3=A9e?= Date: Tue, 15 Jul 2014 15:16:26 +0100 In-reply-to: <53C52A66.5000906@redhat.com> Message-ID: <871ttmyabr.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v2 3/3] trace: instrument and trace tcg tb flush activity List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: mohamad.gebai@gmail.com, qemu-devel@nongnu.org, stefanha@redhat.com, Andreas =?utf-8?Q?F=C3=A4r?= =?utf-8?Q?ber?= Paolo Bonzini writes: > Il 15/07/2014 13:42, Alex Bennée ha scritto: >> + trace_inc_counter(&cpu->tb_jmp_cache_stats.misses); >> tb = tb_find_slow(env, pc, cs_base, flags); >> + } else { >> + trace_inc_counter(&cpu->tb_jmp_cache_stats.hits); >> } > > I think this is premature optimization... How do you mean? It's not really an optimization as much as an instrumentation. It should compile away to nothing if you don't have tracing enabled in your build. OTOH the numbers I'm seeing are very interesting in so far as the fast path could be a potential waste of code in a lot of cases. -- Alex Bennée