Received: from eggs.gnu.org ([208.118.235.92]:51273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEgp3-0003nR-BV for qemu-devel@nongnu.org; Mon, 02 Apr 2012 08:57:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SEgov-0000Ah-MD for qemu-devel@nongnu.org; Mon, 02 Apr 2012 08:57:24 -0400 Received: from roura.ac.upc.edu ([147.83.33.10]:52775 helo=roura.ac.upc.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEgov-0000AL-BV for qemu-devel@nongnu.org; Mon, 02 Apr 2012 08:57:17 -0400 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <20120327194910.7241.47693.stgit@ginnungagap.bsc.es> <20120327194918.7241.10931.stgit@ginnungagap.bsc.es> <20120330072716.GA16437@stefanha-thinkpad.localdomain> <8762dmt4ej.fsf@ginnungagap.bsc.es> <20120402073658.GA19273@stefanha-thinkpad.localdomain> Date: Mon, 02 Apr 2012 14:57:21 +0200 In-Reply-To: <20120402073658.GA19273@stefanha-thinkpad.localdomain> (Stefan Hajnoczi's message of "Mon, 2 Apr 2012 08:36:58 +0100") Message-ID: <87pqbqz3ym.fsf@ginnungagap.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH v3 1/8] tracetool: Rewrite infrastructure as python modules List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org Stefan Hajnoczi writes: > On Fri, Mar 30, 2012 at 06:55:16PM +0200, Llu=C3=ADs Vilanova wrote: >> Stefan Hajnoczi writes: >> >> + kwargs =3D {} >> >> + >> >> + try: >> >> + tracetool.generate(sys.stdin, arg_format, arg_backend, **kwa= rgs) >>=20 >> > If forgot to ask what kwargs is doing here? Can we default to {}? >> > Otherwise let's drop it for now since there are no options defined yet. >>=20 >> It's used later in the patch adding dtrace support. I just thought it wo= uld be >> better to maintain the interface of 'tracetool.generate' instead of addi= ng new >> parameters later when necessary. > Thanks for pointing that out. I went back to look at how the > dtrace-specific options get passed in. I noticed you assigned them > directly to dtrace.py module variables - probably because you didn't > want to add the (mostly unused) kwargs argument to all code generation > functions? > For now I think this is okay since most backends don't care about > kwargs. If we need it more maybe we should think of a cleaner solution. Exactly. Using the kwargs approach all over the place would do the job, but right now there are only two of these arguments, which looks manageable usi= ng explicit arguments (since v4). 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