Received: from eggs.gnu.org ([208.118.235.92]:41768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US7Hg-00010l-FA for qemu-devel@nongnu.org; Tue, 16 Apr 2013 10:55:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1US6lD-0005dy-UZ for qemu-devel@nongnu.org; Tue, 16 Apr 2013 10:21:30 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:44940) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US6Il-000404-3G for qemu-devel@nongnu.org; Tue, 16 Apr 2013 09:52:03 -0400 Received: from gw.ac.upc.edu (gw.ac.upc.es [147.83.30.3]) by roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id r3GDq2Jo030960 for ; Tue, 16 Apr 2013 15:52:02 +0200 Received: from localhost (unknown [84.88.51.85]) by gw.ac.upc.edu (Postfix) with ESMTP id 0EC866B01C9 for ; Tue, 16 Apr 2013 15:52:02 +0200 (CEST) From: =?utf-8?b?TGx1w61z?= Vilanova Date: Tue, 16 Apr 2013 15:52:01 +0200 Message-Id: <20130416135201.21588.77757.stgit@fimbulvetr.bsc.es> In-Reply-To: <20130416134949.21588.80064.stgit@fimbulvetr.bsc.es> References: <20130416134949.21588.80064.stgit@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v2 23/23] trace: Do not use the word 'new' in event arguments List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This lets instrumentation clients in C++ use the auto-generated headers. Signed-off-by: Llu=C3=ADs Vilanova --- scripts/tracetool/__init__.py | 16 +++++++++++++++- trace-events | 8 ++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.p= y index 7624982..851be4d 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -40,6 +40,14 @@ def out(*lines, **kwargs): sys.stdout.writelines("\n".join(lines) + "\n") =20 =20 +FORBIDDEN =3D [ "new" ] + +class ForbiddenArgumentError (Exception): + def __init__ (self, name): + self.name =3D name + def __str__ (self): + return "Cannot use forbidden argument name: %s" % self.name + class Arguments: """Event arguments description.""" =20 @@ -74,6 +82,9 @@ class Arguments: else: arg_type, identifier =3D arg.rsplit(None, 1) =20 + if identifier in FORBIDDEN: + raise ForbiddenArgumentError(identifier) + res.append((arg_type, identifier)) return Arguments(res) =20 @@ -165,7 +176,10 @@ class Event(object): name =3D groups["name"] props =3D groups["props"].split() fmt =3D groups["fmt"] - args =3D Arguments.build(groups["args"]) + try: + args =3D Arguments.build(groups["args"]) + except ForbiddenArgumentError as e: + error("Error: event '%s' uses forbidden argument name '%s'" = % (name, e.name)) =20 return Event(name, props, fmt, args) =20 diff --git a/trace-events b/trace-events index 412f7e4..eb7dd93 100644 --- a/trace-events +++ b/trace-events @@ -187,7 +187,7 @@ hd_geometry_guess(void *bs, uint32_t cyls, uint32_t h= eads, uint32_t secs, int tr =20 # hw/jazz-led.c jazz_led_read(uint64_t addr, uint8_t val) "read addr=3D0x%"PRIx64": 0x%x= " -jazz_led_write(uint64_t addr, uint8_t new) "write addr=3D0x%"PRIx64": 0x= %x" +jazz_led_write(uint64_t addr, uint8_t new_) "write addr=3D0x%"PRIx64": 0= x%x" =20 # hw/lance.c lance_mem_readw(uint64_t addr, uint32_t ret) "addr=3D%"PRIx64"val=3D0x%0= 4x" @@ -285,10 +285,10 @@ usb_port_release(int bus, const char *port) "bus %d= , port %s" usb_ehci_reset(void) "=3D=3D=3D RESET =3D=3D=3D" usb_ehci_opreg_read(uint32_t addr, const char *str, uint32_t val) "rd mm= io %04x [%s] =3D %x" usb_ehci_opreg_write(uint32_t addr, const char *str, uint32_t val) "wr m= mio %04x [%s] =3D %x" -usb_ehci_opreg_change(uint32_t addr, const char *str, uint32_t new, uint= 32_t old) "ch mmio %04x [%s] =3D %x (old: %x)" +usb_ehci_opreg_change(uint32_t addr, const char *str, uint32_t new_, uin= t32_t old) "ch mmio %04x [%s] =3D %x (old: %x)" usb_ehci_portsc_read(uint32_t addr, uint32_t port, uint32_t val) "rd mmi= o %04x [port %d] =3D %x" usb_ehci_portsc_write(uint32_t addr, uint32_t port, uint32_t val) "wr mm= io %04x [port %d] =3D %x" -usb_ehci_portsc_change(uint32_t addr, uint32_t port, uint32_t new, uint3= 2_t old) "ch mmio %04x [port %d] =3D %x (old: %x)" +usb_ehci_portsc_change(uint32_t addr, uint32_t port, uint32_t new_, uint= 32_t old) "ch mmio %04x [port %d] =3D %x (old: %x)" usb_ehci_usbsts(const char *sts, int state) "usbsts %s %d" usb_ehci_state(const char *schedule, const char *state) "%s schedule %s" usb_ehci_qh_ptrs(void *q, uint32_t addr, uint32_t nxt, uint32_t c_qtd, u= int32_t n_qtd, uint32_t a_qtd) "q %p - QH @ %08x: next %08x qtds %08x,%08= x,%08x" @@ -530,7 +530,7 @@ qed_aio_write_main(void *s, void *acb, int ret, uint6= 4_t offset, size_t len) "s =20 # hw/g364fb.c g364fb_read(uint64_t addr, uint32_t val) "read addr=3D0x%"PRIx64": 0x%x" -g364fb_write(uint64_t addr, uint32_t new) "write addr=3D0x%"PRIx64": 0x%= x" +g364fb_write(uint64_t addr, uint32_t val) "write addr=3D0x%"PRIx64": 0x%= x" =20 # hw/grlib_gptimer.c grlib_gptimer_enable(int id, uint32_t count) "timer:%d set count 0x%x an= d run"