Skip to contentSkip to conversation

trace-events: Clean up with cleanup-trace-events.pl again

PATCH Applied Markus Armbruster 2 participants 6 messages Sep 23, 2014 – Sep 24, 2014

lore
Share & tools
lore
#0 lore raw

cover trace-events: Clean up with cleanup-trace-events.pl again

This series applies on top of Stefan's "trace: drop orphan events from ./trace-events".

Markus Armbruster (4):
cleanup-trace-events.pl: Tighten search for trace event call
trace-events: Drop unused megasas trace event
trace-events: Drop orphaned monitor trace event
trace-events: Fix comments pointing to source files

 scripts/cleanup-trace-events.pl |  2 +-
 trace-events                    | 25 +++++++++++++------------
 2 files changed, 14 insertions(+), 13 deletions(-)
Signature · 1 line
1.9.3
#1 lore raw

PATCH 1/4 cleanup-trace-events.pl: Tighten search for trace event call

The script can get fooled too easily. For instance, it finds trace_megasas_io_read_start when looking for trace_megasas_io_read, and incorrectly concludes that event megasas_io_read is used.

Supply -w to git-grep to tighten the search.

---
 scripts/cleanup-trace-events.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/cleanup-trace-events.pl +1 -1
index cffbf16..7e808ef 100755
@@ -25,7 +25,7 @@ sub out {
 
 while (<>) {
     if (/^(disable )?([a-z_0-9]+)\(/) {
-        open GREP, '-|', 'git', 'grep', '-l', "trace_$2"
+        open GREP, '-|', 'git', 'grep', '-lw', "trace_$2"
             or die "run git grep: $!";
         my $fname;
         while ($fname = <GREP>) {
Signature · 1 line
1.9.3
#2 lore raw

PATCH 2/4 trace-events: Drop unused megasas trace event

In reply to Markus Armbruster

Event megasas_io_read was added in commit e8f943c, but never used. Drop it.

---
 trace-events | 2 --
 1 file changed, 2 deletions(-)
trace-events +0 -2
index 467439b..cdabb4e 100644
@@ -668,8 +668,6 @@ megasas_io_target_not_present(int cmd, const char *frame, int dev, int lun) "scm
 megasas_io_read_start(int cmd, unsigned long lba, unsigned long count, unsigned long len) "scmd %d: start LBA %lx %lu blocks (%lu bytes)"
 megasas_io_write_start(int cmd, unsigned long lba, unsigned long count, unsigned long len) "scmd %d: start LBA %lx %lu blocks (%lu bytes)"
 megasas_io_complete(int cmd, uint32_t len) "scmd %d: %d bytes completed"
-megasas_io_read(int cmd, int bytes, int len, unsigned long offset) "scmd %d: %d/%d bytes, iov offset %lu"
-megasas_io_write(int cmd, int bytes, int len, unsigned long offset) "scmd %d: %d/%d bytes, iov offset %lu"
 megasas_iovec_sgl_overflow(int cmd, int index, int limit) "scmd %d: iovec count %d limit %d"
 megasas_iovec_sgl_underflow(int cmd, int index) "scmd %d: iovec count %d"
 megasas_iovec_sgl_invalid(int cmd, int index, uint64_t pa, uint32_t len) "scmd %d: element %d pa %" PRIx64 " len %u"
Signature · 1 line
1.9.3
#3 lore raw

PATCH 3/4 trace-events: Drop orphaned monitor trace event

In reply to Markus Armbruster

Event monitor_protocol_event is unused since commit 7517517. Drop it.

---
 trace-events | 1 -
 1 file changed, 1 deletion(-)
trace-events +0 -1
index cdabb4e..6eada18 100644
@@ -927,7 +927,6 @@ esp_pci_sbac_write(uint32_t reg, uint32_t val) "sbac: 0x%8.8x -> 0x%8.8x"
 # monitor.c
 handle_qmp_command(void *mon, const char *cmd_name) "mon %p cmd_name \"%s\""
 monitor_protocol_emitter(void *mon) "mon %p"
-monitor_protocol_event(uint32_t event, const char *evname, void *data) "event=%d name \"%s\" data %p"
 monitor_protocol_event_handler(uint32_t event, void *data, uint64_t last, uint64_t now) "event=%d data=%p last=%" PRId64 " now=%" PRId64
 monitor_protocol_event_emit(uint32_t event, void *data) "event=%d data=%p"
 monitor_protocol_event_queue(uint32_t event, void *data, uint64_t rate, uint64_t last, uint64_t now) "event=%d data=%p rate=%" PRId64 " last=%" PRId64 " now=%" PRId64
Signature · 1 line
1.9.3
#4 lore raw

PATCH 4/4 trace-events: Fix comments pointing to source files

In reply to Markus Armbruster

A few files have been renamed without updating their comment here. A few events have been added in the wrong place. Clean that up.

Comments with no space after the '#' look ugly and confuse cleanup-trace-events.pl. Insert a space.

scripts/cleanup-trace-events.pl is now happy again.

---
 trace-events | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)
trace-events +13 -9
index 6eada18..793df55 100644
@@ -834,7 +834,7 @@ pvscsi_state(const char* state) "starting %s ..."
 pvscsi_tx_rings_ppn(const char* label, uint64_t ppn) "%s page: %"PRIx64""
 pvscsi_tx_rings_num_pages(const char* label, uint32_t num) "Number of %s pages: %u"
 
-# xen-all.c
+# xen-hvm.c
 xen_ram_alloc(unsigned long ram_addr, unsigned long size) "requested: %#lx, size %#lx"
 xen_client_set_memory(uint64_t start_addr, unsigned long size, bool log_dirty) "%#"PRIx64" size %#lx, log_dirty %i"
 
@@ -843,7 +843,7 @@ xen_map_cache(uint64_t phys_addr) "want %#"PRIx64
 xen_remap_bucket(uint64_t index) "index %#"PRIx64
 xen_map_cache_return(void* ptr) "%p"
 
-# hw/xen/xen_platform.c
+# hw/i386/xen/xen_platform.c
 xen_platform_log(char *s) "xen platform: %s"
 
 # qemu-coroutine.c
@@ -1081,9 +1081,11 @@ savevm_state_complete(void) ""
 savevm_state_cancel(void) ""
 vmstate_save(const char *idstr, const char *vmsd_name) "%s, %s"
 vmstate_load(const char *idstr, const char *vmsd_name) "%s, %s"
-vmstate_load_field_error(const char *field, int ret) "field \"%s\" load failed, ret = %d"
 qemu_announce_self_iter(const char *mac) "%s"
 
+# vmstate.c
+vmstate_load_field_error(const char *field, int ret) "field \"%s\" load failed, ret = %d"
+
 # qemu-file.c
 qemu_file_fclose(void) ""
 
@@ -1238,7 +1240,7 @@ css_adapter_interrupt(uint8_t isc) "CSS: adapter I/O interrupt (isc %x)"
 virtio_ccw_interpret_ccw(int cssid, int ssid, int schid, int cmd_code) "VIRTIO-CCW: %x.%x.%04x: interpret command %x"
 virtio_ccw_new_device(int cssid, int ssid, int schid, int devno, const char *devno_mode) "VIRTIO-CCW: add subchannel %x.%x.%04x, devno %04x (%s)"
 
-# hw/intc/s390_flic.c
+# hw/intc/s390_flic_kvm.c
 flic_create_device(int err) "flic: create device failed %d"
 flic_no_device_api(int err) "flic: no Device Contral API support %d"
 flic_reset_failed(int err) "flic: reset failed %d"
@@ -1257,11 +1259,13 @@ kvm_vm_ioctl(int type, void *arg) "type 0x%x, arg %p"
 kvm_vcpu_ioctl(int cpu_index, int type, void *arg) "cpu_index %d, type 0x%x, arg %p"
 kvm_run_exit(int cpu_index, uint32_t reason) "cpu_index %d, reason %d"
 kvm_device_ioctl(int fd, int type, void *arg) "dev fd %d, type 0x%x, arg %p"
-kvm_failed_spr_set(int str, const char *msg) "Warning: Unable to set SPR %d to KVM: %s"
-kvm_failed_spr_get(int str, const char *msg) "Warning: Unable to retrieve SPR %d from KVM: %s"
 kvm_failed_reg_get(uint64_t id, const char *msg) "Warning: Unable to retrieve ONEREG %" PRIu64 " from KVM: %s"
 kvm_failed_reg_set(uint64_t id, const char *msg) "Warning: Unable to set ONEREG %" PRIu64 " to KVM: %s"
 
+# target-ppc/kvm.c
+kvm_failed_spr_set(int str, const char *msg) "Warning: Unable to set SPR %d to KVM: %s"
+kvm_failed_spr_get(int str, const char *msg) "Warning: Unable to retrieve SPR %d from KVM: %s"
+
 # TCG related tracing (mostly disabled by default)
 # cpu-exec.c
 disable exec_tb(void *tb, uintptr_t pc) "tb:%p pc=0x%"PRIxPTR
@@ -1279,7 +1283,7 @@ memory_region_ops_write(void *mr, uint64_t addr, uint64_t value, unsigned size)
 object_dynamic_cast_assert(const char *type, const char *target, const char *file, int line, const char *func) "%s->%s (%s:%d:%s)"
 object_class_dynamic_cast_assert(const char *type, const char *target, const char *file, int line, const char *func) "%s->%s (%s:%d:%s)"
 
-# hw/xen/xen_pvdevice.c
+# hw/i386/xen/xen_pvdevice.c
 xen_pv_mmio_read(uint64_t addr) "WARNING: read from Xen PV Device MMIO space (address %"PRIx64")"
 xen_pv_mmio_write(uint64_t addr) "WARNING: write to Xen PV Device MMIO space (address %"PRIx64")"
 
@@ -1287,7 +1291,7 @@ xen_pv_mmio_write(uint64_t addr) "WARNING: write to Xen PV Device MMIO space (ad
 pci_cfg_read(const char *dev, unsigned devid, unsigned fnid, unsigned offs, unsigned val) "%s %02u:%u @0x%x -> 0x%x"
 pci_cfg_write(const char *dev, unsigned devid, unsigned fnid, unsigned offs, unsigned val) "%s %02u:%u @0x%x <- 0x%x"
 
-#hw/acpi/memory_hotplug.c
+# hw/acpi/memory_hotplug.c
 mhp_acpi_invalid_slot_selected(uint32_t slot) "0x%"PRIx32
 mhp_acpi_read_addr_lo(uint32_t slot, uint32_t addr) "slot[0x%"PRIx32"] addr lo: 0x%"PRIx32
 mhp_acpi_read_addr_hi(uint32_t slot, uint32_t addr) "slot[0x%"PRIx32"] addr hi: 0x%"PRIx32
@@ -1300,7 +1304,7 @@ mhp_acpi_write_ost_ev(uint32_t slot, uint32_t ev) "slot[0x%"PRIx32"] OST EVENT:
 mhp_acpi_write_ost_status(uint32_t slot, uint32_t st) "slot[0x%"PRIx32"] OST STATUS: 0x%"PRIx32
 mhp_acpi_clear_insert_evt(uint32_t slot) "slot[0x%"PRIx32"] clear insert event"
 
-#hw/i386/pc.c
+# hw/i386/pc.c
 mhp_pc_dimm_assigned_slot(int slot) "0x%d"
 mhp_pc_dimm_assigned_address(uint64_t addr) "0x%"PRIx64
 
Signature · 1 line
1.9.3
#5 lore raw
In reply to Markus Armbruster
Quoted 9 lines · Markus Armbruster

This series applies on top of Stefan's "trace: drop orphan events from ./trace-events".

Markus Armbruster (4):
cleanup-trace-events.pl: Tighten search for trace event call
trace-events: Drop unused megasas trace event
trace-events: Drop orphaned monitor trace event
trace-events: Fix comments pointing to source files

Quoted 8 lines
 scripts/cleanup-trace-events.pl |  2 +-
 trace-events                    | 25 +++++++++++++------------
 2 files changed, 14 insertions(+), 13 deletions(-)
Signature · 1 line
1.9.3

Thanks, applied to my tracing tree:
https://github.com/stefanha/qemu/commits/tracing

Stefan