From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afpC0-0006o4-7E for qemu-devel@nongnu.org; Tue, 15 Mar 2016 09:39:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afpBv-0006GF-WD for qemu-devel@nongnu.org; Tue, 15 Mar 2016 09:39:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45076) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afpBv-0006G9-RM for qemu-devel@nongnu.org; Tue, 15 Mar 2016 09:39:19 -0400 Date: Tue, 15 Mar 2016 13:39:17 +0000 From: Stefan Hajnoczi Message-ID: <20160315133916.GM27203@stefanha-x1.localdomain> References: <87wpp4m6n1.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QqzFzR/RUlLahzby" Content-Disposition: inline In-Reply-To: <87wpp4m6n1.fsf@blackfin.pond.sub.org> 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: Markus Armbruster Cc: =?iso-8859-1?Q?Llu=EDs?= Vilanova , Peter Maydell , qemu-devel@nongnu.org, "Dr. David Alan Gilbert" --QqzFzR/RUlLahzby Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Mar 15, 2016 at 10:29:06AM +0100, Markus Armbruster wrote: > Stefan cc'ed because tracing is part of the problem. Search for > "tracers". Thanks for bringing up the generated tracing headers. David Gilbert and I discussed splitting them up a few months ago. I'll summarize the problem and we can think about solutions: trace.h includes generated-tracers.h and generated-events.h. These files are generated from scripts/tracetool.py. The contents of the files depends on the configured --enable-trace-backends= list (log, simple, ftrace, dtrace, ust). Idealy ./trace-events would have "sections" so that multiple files are generated: # section virtio-blk foo() ... # section memory bar() ... This would put trace_foo() in generated-tracers-virtio-blk.h and trace_bar() in generated-tracers-memory.h. Source files using tracing would need to include headers for relevant sections. This way we can narrow the scope of tracing headers and prevent global recompilation. The fly in the ointment is that trace/control.h defines enum TraceEventID, a global numbering of all trace events. The enum is used in trace/contro.h APIs and also in the simpletrace file format. If ./trace-event is modified the numbering of trace events could change. This would require global recompilation :(. So in order to avoid global recompilation we need to eliminate enum TraceEventID. Perhaps it's possible to use TraceEvent* instead of TraceEventID. For the simpletrace backend we would continue to use a global ordering but that only affects generated-tracers.c and not header files (thankfully!). Any comments? Stefan --QqzFzR/RUlLahzby Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJW6BCEAAoJEJykq7OBq3PIXZIIAIwNKCPTLo2qwSVd7FImzjiS O29SRlYYBSr6bcxI9eecN929VrJb+yuqbfie5RfrfUw4oxjh69xu8WTfPBFgUgku rqW6NL08KBh7D9ri/lhRgYHiAGY7ZW0C0lrsuV53zWMTgkNPDGxLMzaGrxFVM58i FMMtbYbdmCD+e2tULy/xmdkzx8qrG3F4PtgCr2yJ73EwHWJVQKqUopbVuZUy+XT+ rLOLyDDz4527s4mc5dNIqWCqQ+pTd9dtEd6V2w5C8Ts5GuNInQ+P5FBUJrj1LcuH BBOm4ZKIaxSim5jJXp7yvxdtCOYN25muGiw51IcGSvPSdqVam1nwwOcY4WftOto= =S6mM -----END PGP SIGNATURE----- --QqzFzR/RUlLahzby--