From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agdUg-0000Mh-Oh for qemu-devel@nongnu.org; Thu, 17 Mar 2016 15:22:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agdUd-00085l-Jr for qemu-devel@nongnu.org; Thu, 17 Mar 2016 15:22:02 -0400 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:34392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agdUd-00085b-9Z for qemu-devel@nongnu.org; Thu, 17 Mar 2016 15:21:59 -0400 Received: by mail-wm0-x236.google.com with SMTP id p65so40248021wmp.1 for ; Thu, 17 Mar 2016 12:21:58 -0700 (PDT) Sender: Paolo Bonzini References: <87wpp4m6n1.fsf@blackfin.pond.sub.org> <20160315133916.GM27203@stefanha-x1.localdomain> <20160315135647.GB11728@work-vm> <20160316182343.GE2012@stefanha-x1.localdomain> <20160316182748.GG2246@work-vm> <20160317112508.GG14062@stefanha-x1.localdomain> <20160317162900.GK5966@work-vm> From: Paolo Bonzini Message-ID: <56EB03D0.6010209@redhat.com> Date: Thu, 17 Mar 2016 20:21:52 +0100 MIME-Version: 1.0 In-Reply-To: <20160317162900.GK5966@work-vm> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] Our use of #include is undisciplined, and what to do about it List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" , Stefan Hajnoczi Cc: qemu-devel@nongnu.org, Peter Maydell , Richard Henderson , =?UTF-8?Q?Llu=c3=ads_Vilanova?= , Markus Armbruster On 17/03/2016 17:29, Dr. David Alan Gilbert wrote: > OK, so I see TraceEvent has a TraceEventID field; so yes that works easily; > it turns out to be a little more expensive though since what was a: > > trace_events_dstate[id] > > is now > trace_events_dstate[te->id] That however makes you waste a lot of cache on trace_events_dstate (commit 585ec72, "trace: track enabled events in a separate array", 2016-02-03). Perhaps we get the linker to do compute the id, for example by using a separate data section and then use te-&te_first to compute the id... Richard, do you have ideas on how to do this in a reasonably portable manner? > But hang on, what's the 'sstate' in TraceEvent; do we actually need two > state fields if we're passing a TraceEvent pointer around? sstate means the event is unavailable, it's basically just a way to provide better error messages. Paolo