Received: from eggs.gnu.org ([2001:4830:134:3::10]:60962) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WG7WE-0000JW-GE for qemu-devel@nongnu.org; Wed, 19 Feb 2014 08:49:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WG7W8-0007jl-DN for qemu-devel@nongnu.org; Wed, 19 Feb 2014 08:48:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:1458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WG7W8-0007je-3t for qemu-devel@nongnu.org; Wed, 19 Feb 2014 08:48:52 -0500 Date: Wed, 19 Feb 2014 14:48:45 +0100 From: Stefan Hajnoczi Message-ID: <20140219134845.GC30759@stefanha-thinkpad.muc.redhat.com> References: <20140217193618.25959.69101.stgit@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20140217193618.25959.69101.stgit@fimbulvetr.bsc.es> 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: =?iso-8859-1?Q?Llu=EDs?= Vilanova Cc: qemu-devel@nongnu.org, Kazuya Saito On Mon, Feb 17, 2014 at 08:36:19PM +0100, Llu=EDs Vilanova wrote: > Minimizes the amount of backend code, making it simpler to add new/diff= erent > backends. >=20 > Also performs other cleanups all around. >=20 > Signed-off-by: Llu=EDs Vilanova > --- >=20 > Llu=EDs 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? Stefan