Received: from eggs.gnu.org ([2001:4830:134:3::10]:37304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGTqu-0004m5-AX for qemu-devel@nongnu.org; Thu, 20 Feb 2014 08:39:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGTql-0000Ae-EZ for qemu-devel@nongnu.org; Thu, 20 Feb 2014 08:39:48 -0500 Received: from roura.ac.upc.es ([147.83.33.10]:34201) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGTql-0000AF-1l for qemu-devel@nongnu.org; Thu, 20 Feb 2014 08:39:39 -0500 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <20140217193618.25959.69101.stgit@fimbulvetr.bsc.es> <20140219134845.GC30759@stefanha-thinkpad.muc.redhat.com> <87eh2zw2oh.fsf@fimbulvetr.bsc.es> <20140220102058.GD1272@stefanha-thinkpad.redhat.com> Date: Thu, 20 Feb 2014 14:39:27 +0100 In-Reply-To: <20140220102058.GD1272@stefanha-thinkpad.redhat.com> (Stefan Hajnoczi's message of "Thu, 20 Feb 2014 11:20:58 +0100") Message-ID: <87d2ihrjhs.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 0/4] Tracetool cleanup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, Stefan Hajnoczi , Kazuya Saito Stefan Hajnoczi writes: > On Wed, Feb 19, 2014 at 04:19:10PM +0100, Llu=C3=ADs Vilanova wrote: >> Stefan Hajnoczi writes: >>=20 >> > On Mon, Feb 17, 2014 at 08:36:19PM +0100, Llu=C3=ADs Vilanova wrote: >> >> Minimizes the amount of backend code, making it simpler to add new/di= fferent >> >> backends. >> >>=20 >> >> Also performs other cleanups all around. >> >>=20 >> >> Signed-off-by: Llu=C3=ADs Vilanova >> >> --- >> >>=20 >> >> Llu=C3=ADs Vilanova (4): >> >> trace: [tracetool] Add method 'Event.api' to build event names >> >> trace: [tracetool,trivial] Style changes >> >> trace: [tracetool] Identify formats directly used by QEMU >> >> trace: [tracetool] Minimize the amount of per-backend code >>=20 >> > I think we stretched the concepts of backends and formats too far. >> > There are formats that only work with one backend (like 'stap'). And >> > there are backends that behave differently from all other backends. >>=20 >> > As a result we're trying to abstract and make common a bunch of stuff >> > that isn't really common. This problem existed before this patch >> > series, but I feel we're going further down a direction that >> > increasingly seems to be wrong. >>=20 >> > It's simpler if we turn the design inside-out. Instead of making >> > backends export all sorts of interfaces and flags, tracetool should ju= st >> > parse trace-events and hand the list over to the backend. >>=20 >> > Let the backend do whatever it wants. The format option simply becomes >> > an option telling the backend which type of output to generate >> > (events.h, events.c, .stp, etc). >>=20 >> > Common behavior should live in plain old Python modules/functions. >>=20 >> > TL;DR moving to a library design would simplify and clean up more than >> > trying to improve the current framework design >>=20 >> > What do you think? >>=20 >> This series moves into that direction; some of the formats are simply not >> handled by backends. For example, the "stap", "events_c" and "events_h" = formats >> have no backend-specific contents. >>=20 >> Also, having common code for the "format", and then relying on backends = for a >> small piece of the contents simplifies later patches like the multi-back= end >> tracing. >>=20 >> The thing here is that maybe we should change format to "file", since it >> actually refers to a specific output file. > You have a point. tracetool needs to output a particular file (e.g. > generated-events.c, generated-tracers.h), which is kind of what a > "format" has become. > So the "format" is the primary piece of code that emits output. But if > it needs to do something backend-specific (like generated-tracers.h) > then it should call into backend modules. Exactly. > I am still concerned about the weird and wonderful interfaces that we're > creating (like the "API" field in this patch series). They make it > harder to understand the code and add new backends. Will think about > this more when reviewing the next revision of this series. Right. To be honest, the "API" sounded like a nice idea when I wrote it, bu= t the only thing it buys you is that non-API formats will only receive non-disabl= ed events. A really small benefit for adding more inter-module semantics. I wi= ll probably remove it after rebasing the series. Thanks, Lluis --=20 "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