Received: from eggs.gnu.org ([2001:4830:134:3::10]:55757) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WG8vu-0007J8-K9 for qemu-devel@nongnu.org; Wed, 19 Feb 2014 10:19:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WG8vj-0004of-PP for qemu-devel@nongnu.org; Wed, 19 Feb 2014 10:19:34 -0500 Received: from roura.ac.upc.es ([147.83.33.10]:52149) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WG8vj-0004jx-Dk for qemu-devel@nongnu.org; Wed, 19 Feb 2014 10:19:23 -0500 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <20140217193618.25959.69101.stgit@fimbulvetr.bsc.es> <20140219134845.GC30759@stefanha-thinkpad.muc.redhat.com> Date: Wed, 19 Feb 2014 16:19:10 +0100 In-Reply-To: <20140219134845.GC30759@stefanha-thinkpad.muc.redhat.com> (Stefan Hajnoczi's message of "Wed, 19 Feb 2014 14:48:45 +0100") Message-ID: <87eh2zw2oh.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, Kazuya Saito Stefan Hajnoczi writes: > 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/diffe= rent >> 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 > 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. > 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. > It's simpler if we turn the design inside-out. Instead of making > backends export all sorts of interfaces and flags, tracetool should just > parse trace-events and hand the list over to the backend. > 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). > Common behavior should live in plain old Python modules/functions. > TL;DR moving to a library design would simplify and clean up more than > trying to improve the current framework design > What do you think? 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" for= mats have no backend-specific contents. 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-backend tracing. The thing here is that maybe we should change format to "file", since it actually refers to a specific output file. 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