Re: [Qemu-devel] [PATCH v2 4/4] trace-events: fix code style: print 0x before hex numbers
On Mon, 31 Jul 2017 18:05:46 +0300 Vladimir Sementsov-Ogievskiywrote: > 31.07.2017 12:49, Cornelia Huck wrote: > > On Sat, 29 Jul 2017 16:11:59 +0300 > > Vladimir Sementsov-Ogievskiy wrote: > > > >> The only exception are groups of numers separated by symbols > >> '.', ' ', ':', '/', like 'ab.09.7d'. > >> > > (...) > >> Signed-off-by: Vladimir Sementsov-Ogievskiy > > > s390x related changes above: > > > > Acked-by: Cornelia Huck > > Thank you! > > Don't know, should I add 'Acked-by's into commit message for the next > version? Yes, please do so.
Re: [Qemu-devel] [PATCH v2 4/4] trace-events: fix code style: print 0x before hex numbers
31.07.2017 12:49, Cornelia Huck wrote: On Sat, 29 Jul 2017 16:11:59 +0300 Vladimir Sementsov-Ogievskiywrote: The only exception are groups of numers separated by symbols '.', ' ', ':', '/', like 'ab.09.7d'. (...) Signed-off-by: Vladimir Sementsov-Ogievskiy --- accel/tcg/trace-events| 2 +- block/trace-events| 22 +++ hw/audio/trace-events | 4 +- hw/char/trace-events | 12 ++-- hw/display/trace-events | 12 ++-- hw/dma/trace-events | 20 +++--- hw/i386/xen/trace-events | 4 +- hw/input/trace-events | 4 +- hw/intc/trace-events | 156 +++--- hw/isa/trace-events | 4 +- hw/misc/trace-events | 78 +++ hw/net/trace-events | 34 +- hw/nvram/trace-events | 2 +- hw/ppc/trace-events | 64 +-- hw/s390x/trace-events | 20 +++--- hw/scsi/trace-events | 112 - hw/sd/trace-events| 4 +- hw/timer/trace-events | 20 +++--- hw/usb/trace-events | 56 - hw/vfio/trace-events | 44 ++--- hw/virtio/trace-events| 6 +- linux-user/trace-events | 10 +-- migration/trace-events| 36 +-- nbd/trace-events | 18 +++--- net/trace-events | 4 +- target/arm/trace-events | 10 +-- target/s390x/trace-events | 2 +- target/sparc/trace-events | 30 - 28 files changed, 395 insertions(+), 395 deletions(-) @@ -74,8 +74,8 @@ flic_no_device_api(int err) "flic: no Device Contral API support %d" flic_reset_failed(int err) "flic: reset failed %d" # hw/intc/s390_flic.c -qemu_s390_airq_suppressed(uint8_t type, uint8_t isc) "flic: adapter I/O interrupt suppressed (type %x isc %x)" -qemu_s390_suppress_airq(uint8_t isc, const char *from, const char *to) "flic: for isc %x, suppress airq by modifying ais mode from %s to %s" +qemu_s390_airq_suppressed(uint8_t type, uint8_t isc) "flic: adapter I/O interrupt suppressed (type 0x%x isc 0x%x)" +qemu_s390_suppress_airq(uint8_t isc, const char *from, const char *to) "flic: for isc 0x%x, suppress airq by modifying ais mode from %s to %s" # hw/intc/aspeed_vic.c aspeed_vic_set_irq(int irq, int level) "Enabling IRQ %d: %d" diff --git a/hw/s390x/trace-events b/hw/s390x/trace-events index f07e974678..eb9d349bfa 100644 --- a/hw/s390x/trace-events +++ b/hw/s390x/trace-events @@ -2,15 +2,15 @@ # hw/s390x/css.c css_enable_facility(const char *facility) "CSS: enable %s" -css_crw(uint8_t rsc, uint8_t erc, uint16_t rsid, const char *chained) "CSS: queueing crw: rsc=%x, erc=%x, rsid=%x %s" -css_chpid_add(uint8_t cssid, uint8_t chpid, uint8_t type) "CSS: add chpid %x.%02x (type %02x)" -css_new_image(uint8_t cssid, const char *default_cssid) "CSS: add css image %02x %s" -css_assign_subch(const char *do_assign, uint8_t cssid, uint8_t ssid, uint16_t schid, uint16_t devno) "CSS: %s %x.%x.%04x (devno %04x)" -css_io_interrupt(int cssid, int ssid, int schid, uint32_t intparm, uint8_t isc, const char *conditional) "CSS: I/O interrupt on sch %x.%x.%04x (intparm %08x, isc %x) %s" -css_adapter_interrupt(uint8_t isc) "CSS: adapter I/O interrupt (isc %x)" -css_do_sic(uint16_t mode, uint8_t isc) "CSS: set interruption mode %x on isc %x" +css_crw(uint8_t rsc, uint8_t erc, uint16_t rsid, const char *chained) "CSS: queueing crw: rsc=0x%x, erc=0x%x, rsid=0x%x %s" +css_chpid_add(uint8_t cssid, uint8_t chpid, uint8_t type) "CSS: add chpid %x.%02x (type 0x%02x)" +css_new_image(uint8_t cssid, const char *default_cssid) "CSS: add css image 0x%02x %s" +css_assign_subch(const char *do_assign, uint8_t cssid, uint8_t ssid, uint16_t schid, uint16_t devno) "CSS: %s %x.%x.%04x (devno 0x%04x)" +css_io_interrupt(int cssid, int ssid, int schid, uint32_t intparm, uint8_t isc, const char *conditional) "CSS: I/O interrupt on sch %x.%x.%04x (intparm 0x%08x, isc 0x%x) %s" +css_adapter_interrupt(uint8_t isc) "CSS: adapter I/O interrupt (isc 0x%x)" +css_do_sic(uint16_t mode, uint8_t isc) "CSS: set interruption mode 0x%x on isc 0x%x" # hw/s390x/virtio-ccw.c -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)" -virtio_ccw_set_ind(uint64_t ind_loc, uint8_t ind_old, uint8_t ind_new) "VIRTIO-CCW: indicator at %" PRIu64 ": %x->%x" +virtio_ccw_interpret_ccw(int cssid, int ssid, int schid, int cmd_code) "VIRTIO-CCW: %x.%x.%04x: interpret command 0x%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 0x%04x (%s)" +virtio_ccw_set_ind(uint64_t ind_loc, uint8_t ind_old, uint8_t ind_new) "VIRTIO-CCW: indicator at %"
Re: [Qemu-devel] [PATCH v2 4/4] trace-events: fix code style: print 0x before hex numbers
On Sat, 29 Jul 2017 16:11:59 +0300 Vladimir Sementsov-Ogievskiywrote: > The only exception are groups of numers separated by symbols > '.', ' ', ':', '/', like 'ab.09.7d'. > (...) > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > accel/tcg/trace-events| 2 +- > block/trace-events| 22 +++ > hw/audio/trace-events | 4 +- > hw/char/trace-events | 12 ++-- > hw/display/trace-events | 12 ++-- > hw/dma/trace-events | 20 +++--- > hw/i386/xen/trace-events | 4 +- > hw/input/trace-events | 4 +- > hw/intc/trace-events | 156 > +++--- > hw/isa/trace-events | 4 +- > hw/misc/trace-events | 78 +++ > hw/net/trace-events | 34 +- > hw/nvram/trace-events | 2 +- > hw/ppc/trace-events | 64 +-- > hw/s390x/trace-events | 20 +++--- > hw/scsi/trace-events | 112 - > hw/sd/trace-events| 4 +- > hw/timer/trace-events | 20 +++--- > hw/usb/trace-events | 56 - > hw/vfio/trace-events | 44 ++--- > hw/virtio/trace-events| 6 +- > linux-user/trace-events | 10 +-- > migration/trace-events| 36 +-- > nbd/trace-events | 18 +++--- > net/trace-events | 4 +- > target/arm/trace-events | 10 +-- > target/s390x/trace-events | 2 +- > target/sparc/trace-events | 30 - > 28 files changed, 395 insertions(+), 395 deletions(-) > > @@ -74,8 +74,8 @@ flic_no_device_api(int err) "flic: no Device Contral API > support %d" > flic_reset_failed(int err) "flic: reset failed %d" > > # hw/intc/s390_flic.c > -qemu_s390_airq_suppressed(uint8_t type, uint8_t isc) "flic: adapter I/O > interrupt suppressed (type %x isc %x)" > -qemu_s390_suppress_airq(uint8_t isc, const char *from, const char *to) > "flic: for isc %x, suppress airq by modifying ais mode from %s to %s" > +qemu_s390_airq_suppressed(uint8_t type, uint8_t isc) "flic: adapter I/O > interrupt suppressed (type 0x%x isc 0x%x)" > +qemu_s390_suppress_airq(uint8_t isc, const char *from, const char *to) > "flic: for isc 0x%x, suppress airq by modifying ais mode from %s to %s" > > # hw/intc/aspeed_vic.c > aspeed_vic_set_irq(int irq, int level) "Enabling IRQ %d: %d" > diff --git a/hw/s390x/trace-events b/hw/s390x/trace-events > index f07e974678..eb9d349bfa 100644 > --- a/hw/s390x/trace-events > +++ b/hw/s390x/trace-events > @@ -2,15 +2,15 @@ > > # hw/s390x/css.c > css_enable_facility(const char *facility) "CSS: enable %s" > -css_crw(uint8_t rsc, uint8_t erc, uint16_t rsid, const char *chained) "CSS: > queueing crw: rsc=%x, erc=%x, rsid=%x %s" > -css_chpid_add(uint8_t cssid, uint8_t chpid, uint8_t type) "CSS: add chpid > %x.%02x (type %02x)" > -css_new_image(uint8_t cssid, const char *default_cssid) "CSS: add css image > %02x %s" > -css_assign_subch(const char *do_assign, uint8_t cssid, uint8_t ssid, > uint16_t schid, uint16_t devno) "CSS: %s %x.%x.%04x (devno %04x)" > -css_io_interrupt(int cssid, int ssid, int schid, uint32_t intparm, uint8_t > isc, const char *conditional) "CSS: I/O interrupt on sch %x.%x.%04x (intparm > %08x, isc %x) %s" > -css_adapter_interrupt(uint8_t isc) "CSS: adapter I/O interrupt (isc %x)" > -css_do_sic(uint16_t mode, uint8_t isc) "CSS: set interruption mode %x on isc > %x" > +css_crw(uint8_t rsc, uint8_t erc, uint16_t rsid, const char *chained) "CSS: > queueing crw: rsc=0x%x, erc=0x%x, rsid=0x%x %s" > +css_chpid_add(uint8_t cssid, uint8_t chpid, uint8_t type) "CSS: add chpid > %x.%02x (type 0x%02x)" > +css_new_image(uint8_t cssid, const char *default_cssid) "CSS: add css image > 0x%02x %s" > +css_assign_subch(const char *do_assign, uint8_t cssid, uint8_t ssid, > uint16_t schid, uint16_t devno) "CSS: %s %x.%x.%04x (devno 0x%04x)" > +css_io_interrupt(int cssid, int ssid, int schid, uint32_t intparm, uint8_t > isc, const char *conditional) "CSS: I/O interrupt on sch %x.%x.%04x (intparm > 0x%08x, isc 0x%x) %s" > +css_adapter_interrupt(uint8_t isc) "CSS: adapter I/O interrupt (isc 0x%x)" > +css_do_sic(uint16_t mode, uint8_t isc) "CSS: set interruption mode 0x%x on > isc 0x%x" > > # hw/s390x/virtio-ccw.c > -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)" > -virtio_ccw_set_ind(uint64_t ind_loc, uint8_t ind_old, uint8_t ind_new) > "VIRTIO-CCW: indicator at %" PRIu64 ": %x->%x" > +virtio_ccw_interpret_ccw(int cssid, int ssid, int schid, int cmd_code) > "VIRTIO-CCW: %x.%x.%04x: interpret command 0x%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
Re: [Qemu-devel] [PATCH v2 4/4] trace-events: fix code style: print 0x before hex numbers
On Sat, Jul 29, 2017 at 04:11:59PM +0300, Vladimir Sementsov-Ogievskiy wrote: > The only exception are groups of numers separated by symbols > '.', ' ', ':', '/', like 'ab.09.7d'. > > This patch is made by the following: > > > find . -name trace-events | xargs python script.py > > where script.py is the following python script: > = > #!/usr/bin/env python > > import sys > import re > import fileinput > > rhex = '%[-+ *.0-9]*(?:[hljztL]|ll|hh)?(?:x|X|"\s*PRI[xX][^"]*"?)' > rgroup = re.compile('((?:' + rhex + '[.:/ ])+' + rhex + ')') > rbad = re.compile('(? > files = sys.argv[1:] > > for fname in files: > for line in fileinput.input(fname, inplace=True): > arr = re.split(rgroup, line) > for i in range(0, len(arr), 2): > arr[i] = re.sub(rbad, '0x\g<0>', arr[i]) > > sys.stdout.write(''.join(arr)) > = > > Signed-off-by: Vladimir Sementsov-Ogievskiy> --- > accel/tcg/trace-events| 2 +- > block/trace-events| 22 +++ > hw/audio/trace-events | 4 +- > hw/char/trace-events | 12 ++-- > hw/display/trace-events | 12 ++-- > hw/dma/trace-events | 20 +++--- > hw/i386/xen/trace-events | 4 +- > hw/input/trace-events | 4 +- > hw/intc/trace-events | 156 > +++--- > hw/isa/trace-events | 4 +- > hw/misc/trace-events | 78 +++ > hw/net/trace-events | 34 +- > hw/nvram/trace-events | 2 +- > hw/ppc/trace-events | 64 +-- > hw/s390x/trace-events | 20 +++--- > hw/scsi/trace-events | 112 - > hw/sd/trace-events| 4 +- > hw/timer/trace-events | 20 +++--- > hw/usb/trace-events | 56 - > hw/vfio/trace-events | 44 ++--- > hw/virtio/trace-events| 6 +- > linux-user/trace-events | 10 +-- > migration/trace-events| 36 +-- > nbd/trace-events | 18 +++--- > net/trace-events | 4 +- > target/arm/trace-events | 10 +-- > target/s390x/trace-events | 2 +- > target/sparc/trace-events | 30 - > 28 files changed, 395 insertions(+), 395 deletions(-) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature
[Qemu-devel] [PATCH v2 4/4] trace-events: fix code style: print 0x before hex numbers
The only exception are groups of numers separated by symbols '.', ' ', ':', '/', like 'ab.09.7d'. This patch is made by the following: > find . -name trace-events | xargs python script.py where script.py is the following python script: = #!/usr/bin/env python import sys import re import fileinput rhex = '%[-+ *.0-9]*(?:[hljztL]|ll|hh)?(?:x|X|"\s*PRI[xX][^"]*"?)' rgroup = re.compile('((?:' + rhex + '[.:/ ])+' + rhex + ')') rbad = re.compile('(?', arr[i]) sys.stdout.write(''.join(arr)) = Signed-off-by: Vladimir Sementsov-Ogievskiy--- accel/tcg/trace-events| 2 +- block/trace-events| 22 +++ hw/audio/trace-events | 4 +- hw/char/trace-events | 12 ++-- hw/display/trace-events | 12 ++-- hw/dma/trace-events | 20 +++--- hw/i386/xen/trace-events | 4 +- hw/input/trace-events | 4 +- hw/intc/trace-events | 156 +++--- hw/isa/trace-events | 4 +- hw/misc/trace-events | 78 +++ hw/net/trace-events | 34 +- hw/nvram/trace-events | 2 +- hw/ppc/trace-events | 64 +-- hw/s390x/trace-events | 20 +++--- hw/scsi/trace-events | 112 - hw/sd/trace-events| 4 +- hw/timer/trace-events | 20 +++--- hw/usb/trace-events | 56 - hw/vfio/trace-events | 44 ++--- hw/virtio/trace-events| 6 +- linux-user/trace-events | 10 +-- migration/trace-events| 36 +-- nbd/trace-events | 18 +++--- net/trace-events | 4 +- target/arm/trace-events | 10 +-- target/s390x/trace-events | 2 +- target/sparc/trace-events | 30 - 28 files changed, 395 insertions(+), 395 deletions(-) diff --git a/accel/tcg/trace-events b/accel/tcg/trace-events index 2de8359670..c22ad60af7 100644 --- a/accel/tcg/trace-events +++ b/accel/tcg/trace-events @@ -4,7 +4,7 @@ # cpu-exec.c disable exec_tb(void *tb, uintptr_t pc) "tb:%p pc=0x%"PRIxPTR disable exec_tb_nocache(void *tb, uintptr_t pc) "tb:%p pc=0x%"PRIxPTR -disable exec_tb_exit(void *last_tb, unsigned int flags) "tb:%p flags=%x" +disable exec_tb_exit(void *last_tb, unsigned int flags) "tb:%p flags=0x%x" # translate-all.c translate_block(void *tb, uintptr_t pc, uint8_t *tb_code) "tb:%p, pc:0x%"PRIxPTR", tb_code:%p" diff --git a/block/trace-events b/block/trace-events index 622c754495..8fc853b135 100644 --- a/block/trace-events +++ b/block/trace-events @@ -5,8 +5,8 @@ bdrv_open_common(void *bs, const char *filename, int flags, const char *format_n bdrv_lock_medium(void *bs, bool locked) "bs %p locked %d" # block/block-backend.c -blk_co_preadv(void *blk, void *bs, int64_t offset, unsigned int bytes, int flags) "blk %p bs %p offset %"PRId64" bytes %u flags %x" -blk_co_pwritev(void *blk, void *bs, int64_t offset, unsigned int bytes, int flags) "blk %p bs %p offset %"PRId64" bytes %u flags %x" +blk_co_preadv(void *blk, void *bs, int64_t offset, unsigned int bytes, int flags) "blk %p bs %p offset %"PRId64" bytes %u flags 0x%x" +blk_co_pwritev(void *blk, void *bs, int64_t offset, unsigned int bytes, int flags) "blk %p bs %p offset %"PRId64" bytes %u flags 0x%x" # block/io.c bdrv_co_readv(void *bs, int64_t sector_num, int nb_sector) "bs %p sector_num %"PRId64" nb_sectors %d" @@ -54,19 +54,19 @@ paio_submit_co(int64_t offset, int count, int type) "offset %"PRId64" count %d t paio_submit(void *acb, void *opaque, int64_t offset, int count, int type) "acb %p opaque %p offset %"PRId64" count %d type %d" # block/qcow2.c -qcow2_writev_start_req(void *co, int64_t offset, int bytes) "co %p offset %" PRIx64 " bytes %d" +qcow2_writev_start_req(void *co, int64_t offset, int bytes) "co %p offset 0x%" PRIx64 " bytes %d" qcow2_writev_done_req(void *co, int ret) "co %p ret %d" qcow2_writev_start_part(void *co) "co %p" qcow2_writev_done_part(void *co, int cur_bytes) "co %p cur_bytes %d" -qcow2_writev_data(void *co, uint64_t offset) "co %p offset %" PRIx64 -qcow2_pwrite_zeroes_start_req(void *co, int64_t offset, int count) "co %p offset %" PRIx64 " count %d" -qcow2_pwrite_zeroes(void *co, int64_t offset, int count) "co %p offset %" PRIx64 " count %d" +qcow2_writev_data(void *co, uint64_t offset) "co %p offset 0x%" PRIx64 +qcow2_pwrite_zeroes_start_req(void *co, int64_t offset, int count) "co %p offset 0x%" PRIx64 " count %d" +qcow2_pwrite_zeroes(void *co, int64_t offset, int count) "co %p offset 0x%" PRIx64 " count %d" # block/qcow2-cluster.c -qcow2_alloc_clusters_offset(void *co, uint64_t offset, int bytes) "co %p offset %" PRIx64 " bytes %d" -qcow2_handle_copied(void *co, uint64_t guest_offset, uint64_t host_offset, uint64_t bytes) "co %p guest_offset %" PRIx64 " host_offset %" PRIx64 " bytes %" PRIx64 -qcow2_handle_alloc(void *co, uint64_t guest_offset, uint64_t host_offset,