From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlH2Z-0002W6-3r for qemu-devel@nongnu.org; Thu, 12 Jan 2012 04:33:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RlH2S-0002lV-Di for qemu-devel@nongnu.org; Thu, 12 Jan 2012 04:33:47 -0500 Received: from mail-iy0-f173.google.com ([209.85.210.173]:39052) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlH2S-0002lK-Ac for qemu-devel@nongnu.org; Thu, 12 Jan 2012 04:33:40 -0500 Received: by iaeo4 with SMTP id o4so1140985iae.4 for ; Thu, 12 Jan 2012 01:33:38 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <87vcojrx20.fsf@ginnungagap.bsc.es> References: <1326193179-19677-1-git-send-email-harsh@linux.vnet.ibm.com> <1326193179-19677-2-git-send-email-harsh@linux.vnet.ibm.com> <87vcojrx20.fsf@ginnungagap.bsc.es> Date: Thu, 12 Jan 2012 09:33:38 +0000 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH v3 1/3] Converting tracetool.sh to tracetool.py List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?Llu=EDs_Vilanova?= Cc: Harsh Prateek Bora , aneesh.kumar@linux.vnet.ibm.com, stefanha@linux.vnet.ibm.com, qemu-devel@nongnu.org 2012/1/10 Llu=EDs Vilanova : > Harsh Prateek Bora writes: >> +class Event(object): >> + =A0 =A0def __init__(self, num, line): >> + =A0 =A0 =A0 =A0self.num =3D num >> + =A0 =A0 =A0 =A0self.args =3D get_args(line) >> + =A0 =A0 =A0 =A0self.arglist =3D self.args.split(',') >> + =A0 =A0 =A0 =A0self.name =3D get_name(line) >> + =A0 =A0 =A0 =A0self.argc =3D get_argc(line) >> + =A0 =A0 =A0 =A0self.argnames =3D get_argnames(line) >> + =A0 =A0 =A0 =A0self.sizestr =3D calc_sizeofargs(line) >> + =A0 =A0 =A0 =A0self.fmt =3D get_fmt(line) > > This is not not extracting the event properties (e.g., disable). A set of > strings should suffice. > > Arguments could be converted to an Arguments class (or similar, like > ArgumentList) and derive the rest from there using methods (e.g., names, = types, > sizestr, arglist, etc.). Yes, that would be nice. This will separate the trace-events parsing from the rest of the program, which can use the Event/Argument interface instead of parsing strings. Stefan