From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WG7L6-0000k2-3U for qemu-devel@nongnu.org; Wed, 19 Feb 2014 08:37:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WG7L1-00043p-TY for qemu-devel@nongnu.org; Wed, 19 Feb 2014 08:37:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:29792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WG7L1-00043j-KB for qemu-devel@nongnu.org; Wed, 19 Feb 2014 08:37:23 -0500 Date: Wed, 19 Feb 2014 14:37:16 +0100 From: Stefan Hajnoczi Message-ID: <20140219133716.GB30759@stefanha-thinkpad.muc.redhat.com> References: <20140217193618.25959.69101.stgit@fimbulvetr.bsc.es> <20140217193641.25959.98699.stgit@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20140217193641.25959.98699.stgit@fimbulvetr.bsc.es> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 4/4] trace: [tracetool] Minimize the amount of per-backend code 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:41PM +0100, Llu=EDs Vilanova wrote: > Backends now only contain the essential backend-specific code, and most= of the work is moved to frontend code. >=20 > Signed-off-by: Llu=EDs Vilanova > --- > scripts/simpletrace.py | 6 -- > scripts/tracetool/__init__.py | 24 ++---- > scripts/tracetool/backend/__init__.py | 72 ++++++++---------- > scripts/tracetool/backend/dtrace.py | 79 ++------------------ > scripts/tracetool/backend/events.py | 23 ------ > scripts/tracetool/backend/ftrace.py | 56 ++++++-------- > scripts/tracetool/backend/simple.py | 130 ++++++++++++++++---------= -------- > scripts/tracetool/backend/stderr.py | 42 ++++------- > scripts/tracetool/backend/ust.py | 44 +++++------ > scripts/tracetool/format/__init__.py | 46 ++++-------- > scripts/tracetool/format/c.py | 9 ++ > scripts/tracetool/format/d.py | 23 +++++- > scripts/tracetool/format/events_c.py | 11 +-- > scripts/tracetool/format/events_h.py | 11 +-- > scripts/tracetool/format/h.py | 24 ++++-- > scripts/tracetool/format/stap.py | 37 +++++++++ > trace/Makefile.objs | 4 + > 17 files changed, 274 insertions(+), 367 deletions(-) > delete mode 100644 scripts/tracetool/backend/events.py Please split the coding style changes into a separate commit (e.g. removing trailing commas). > diff --git a/scripts/simpletrace.py b/scripts/simpletrace.py > index 8bbcb42..03d032e 100755 > --- a/scripts/simpletrace.py > +++ b/scripts/simpletrace.py > @@ -109,14 +109,10 @@ def process(events, log, analyzer): > if isinstance(log, str): > log =3D open(log, 'rb') > =20 > - enabled_events =3D [] > dropped_event =3D Event.build("Dropped_Event(uint64_t num_events_d= ropped)") > edict =3D {dropped_event_id: dropped_event} > =20 > - for e in events: > - if 'disable' not in e.properties: > - enabled_events.append(e) > - for num, event in enumerate(enabled_events): > + for num, event in enumerate(events): > edict[num] =3D event > =20 > def build_fn(analyzer, event): This patch breaks existing simpletrace files. Imagine you are developing code and use simpletrace. Then you decide to rebase onto the latest qemu.git/master. This patch changes the semantics - now simpletrace.py outputs junk when analyzing the existing file. We can't break the file format for convenience. Either bump the file format version number or don't change the semantics.