[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 23/23] trace: Do not use the word 'new' in event
From: |
Lluís Vilanova |
Subject: |
[Qemu-devel] [PATCH v2 23/23] trace: Do not use the word 'new' in event arguments |
Date: |
Tue, 16 Apr 2013 15:52:01 +0200 |
User-agent: |
StGit/0.16 |
This lets instrumentation clients in C++ use the auto-generated headers.
Signed-off-by: Lluís Vilanova <address@hidden>
---
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__.py
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")
+FORBIDDEN = [ "new" ]
+
+class ForbiddenArgumentError (Exception):
+ def __init__ (self, name):
+ self.name = name
+ def __str__ (self):
+ return "Cannot use forbidden argument name: %s" % self.name
+
class Arguments:
"""Event arguments description."""
@@ -74,6 +82,9 @@ class Arguments:
else:
arg_type, identifier = arg.rsplit(None, 1)
+ if identifier in FORBIDDEN:
+ raise ForbiddenArgumentError(identifier)
+
res.append((arg_type, identifier))
return Arguments(res)
@@ -165,7 +176,10 @@ class Event(object):
name = groups["name"]
props = groups["props"].split()
fmt = groups["fmt"]
- args = Arguments.build(groups["args"])
+ try:
+ args = Arguments.build(groups["args"])
+ except ForbiddenArgumentError as e:
+ error("Error: event '%s' uses forbidden argument name '%s'" %
(name, e.name))
return Event(name, props, fmt, args)
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 heads,
uint32_t secs, int tr
# hw/jazz-led.c
jazz_led_read(uint64_t addr, uint8_t val) "read addr=0x%"PRIx64": 0x%x"
-jazz_led_write(uint64_t addr, uint8_t new) "write addr=0x%"PRIx64": 0x%x"
+jazz_led_write(uint64_t addr, uint8_t new_) "write addr=0x%"PRIx64": 0x%x"
# hw/lance.c
lance_mem_readw(uint64_t addr, uint32_t ret) "addr=%"PRIx64"val=0x%04x"
@@ -285,10 +285,10 @@ usb_port_release(int bus, const char *port) "bus %d, port
%s"
usb_ehci_reset(void) "=== RESET ==="
usb_ehci_opreg_read(uint32_t addr, const char *str, uint32_t val) "rd mmio
%04x [%s] = %x"
usb_ehci_opreg_write(uint32_t addr, const char *str, uint32_t val) "wr mmio
%04x [%s] = %x"
-usb_ehci_opreg_change(uint32_t addr, const char *str, uint32_t new, uint32_t
old) "ch mmio %04x [%s] = %x (old: %x)"
+usb_ehci_opreg_change(uint32_t addr, const char *str, uint32_t new_, uint32_t
old) "ch mmio %04x [%s] = %x (old: %x)"
usb_ehci_portsc_read(uint32_t addr, uint32_t port, uint32_t val) "rd mmio %04x
[port %d] = %x"
usb_ehci_portsc_write(uint32_t addr, uint32_t port, uint32_t val) "wr mmio
%04x [port %d] = %x"
-usb_ehci_portsc_change(uint32_t addr, uint32_t port, uint32_t new, uint32_t
old) "ch mmio %04x [port %d] = %x (old: %x)"
+usb_ehci_portsc_change(uint32_t addr, uint32_t port, uint32_t new_, uint32_t
old) "ch mmio %04x [port %d] = %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,
uint32_t n_qtd, uint32_t a_qtd) "q %p - QH @ %08x: next %08x qtds
%08x,%08x,%08x"
@@ -530,7 +530,7 @@ qed_aio_write_main(void *s, void *acb, int ret, uint64_t
offset, size_t len) "s
# hw/g364fb.c
g364fb_read(uint64_t addr, uint32_t val) "read addr=0x%"PRIx64": 0x%x"
-g364fb_write(uint64_t addr, uint32_t new) "write addr=0x%"PRIx64": 0x%x"
+g364fb_write(uint64_t addr, uint32_t val) "write addr=0x%"PRIx64": 0x%x"
# hw/grlib_gptimer.c
grlib_gptimer_enable(int id, uint32_t count) "timer:%d set count 0x%x and run"
- [Qemu-devel] [PATCH v2 10/23] instrument: [dynamic] Call dynamically linked user-provided routines, (continued)
- [Qemu-devel] [PATCH v2 10/23] instrument: [dynamic] Call dynamically linked user-provided routines, Lluís Vilanova, 2013/04/16
- [Qemu-devel] [PATCH v2 16/23] Let makefiles add entries to the set of target architecture objects, Lluís Vilanova, 2013/04/16
- [Qemu-devel] [PATCH v2 01/23] instrument: Add documentation, Lluís Vilanova, 2013/04/16
- [Qemu-devel] [PATCH v2 15/23] instrument: [qmp, qapi] Add control interface, Lluís Vilanova, 2013/04/16
- [Qemu-devel] [PATCH v2 03/23] trace: Let the user specify her own trace-events file, Lluís Vilanova, 2013/04/16
- [Qemu-devel] [PATCH v2 11/23] instrument: Add internal control interface, Lluís Vilanova, 2013/04/16
- [Qemu-devel] [PATCH v2 05/23] trace: Minimize inclusions of "qemu-common.h" to avoid inclusion loops, Lluís Vilanova, 2013/04/16
- [Qemu-devel] [PATCH v2 12/23] instrument: [hmp] Add control interface, Lluís Vilanova, 2013/04/16
- [Qemu-devel] [PATCH v2 23/23] trace: Do not use the word 'new' in event arguments,
Lluís Vilanova <=
- Re: [Qemu-devel] [RFC][PATCH v2 00/23] instrument: Let the user wrap/override specific event tracing routines, Lluís Vilanova, 2013/04/16