* [PATCH 0/5] trace: Remove and forbid newline characters in event format
@ 2024-06-06 10:39 Philippe Mathieu-Daudé
2024-06-06 10:39 ` [PATCH 1/5] backends/tpm: Remove newline character in trace event Philippe Mathieu-Daudé
` (6 more replies)
0 siblings, 7 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-06-06 10:39 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Cédric Le Goater, Mads Ynddal,
Stefan Hajnoczi, Yoshinori Sato, Stefan Berger,
Philippe =?unknown-8bit?q?Mathieu-Daud=C3=A9?=
Trace events aren't designed to be multi-lines.
Few format use the newline character: remove it
and forbid further uses.
Philippe Mathieu-Daudé (5):
backends/tpm: Remove newline character in trace event
hw/sh4: Remove newline character in trace events
hw/usb: Remove newline character in trace events
hw/vfio: Remove newline character in trace events
tracetool: Forbid newline character in event format
backends/tpm/tpm_util.c | 5 +++--
backends/tpm/trace-events | 3 ++-
hw/sh4/trace-events | 4 ++--
hw/usb/trace-events | 6 +++---
hw/vfio/trace-events | 4 ++--
scripts/tracetool/__init__.py | 2 ++
6 files changed, 14 insertions(+), 10 deletions(-)
--
2.41.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/5] backends/tpm: Remove newline character in trace event
2024-06-06 10:39 [PATCH 0/5] trace: Remove and forbid newline characters in event format Philippe Mathieu-Daudé
@ 2024-06-06 10:39 ` Philippe Mathieu-Daudé
2024-06-06 11:20 ` Daniel P. Berrangé
2024-06-07 15:15 ` Stefan Berger
2024-06-06 10:39 ` [PATCH 2/5] hw/sh4: Remove newline character in trace events Philippe Mathieu-Daudé
` (5 subsequent siblings)
6 siblings, 2 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-06-06 10:39 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Cédric Le Goater, Mads Ynddal,
Stefan Hajnoczi, Yoshinori Sato, Stefan Berger,
Philippe Mathieu-Daudé
Split the 'tpm_util_show_buffer' event in two to avoid
using a newline character.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
backends/tpm/tpm_util.c | 5 +++--
backends/tpm/trace-events | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/backends/tpm/tpm_util.c b/backends/tpm/tpm_util.c
index 1856589c3b..cf138551df 100644
--- a/backends/tpm/tpm_util.c
+++ b/backends/tpm/tpm_util.c
@@ -339,10 +339,11 @@ void tpm_util_show_buffer(const unsigned char *buffer,
size_t len, i;
char *line_buffer, *p;
- if (!trace_event_get_state_backends(TRACE_TPM_UTIL_SHOW_BUFFER)) {
+ if (!trace_event_get_state_backends(TRACE_TPM_UTIL_SHOW_BUFFER_CONTENT)) {
return;
}
len = MIN(tpm_cmd_get_size(buffer), buffer_size);
+ trace_tpm_util_show_buffer_header(string, len);
/*
* allocate enough room for 3 chars per buffer entry plus a
@@ -356,7 +357,7 @@ void tpm_util_show_buffer(const unsigned char *buffer,
}
p += sprintf(p, "%.2X ", buffer[i]);
}
- trace_tpm_util_show_buffer(string, len, line_buffer);
+ trace_tpm_util_show_buffer_content(line_buffer);
g_free(line_buffer);
}
diff --git a/backends/tpm/trace-events b/backends/tpm/trace-events
index 1ecef42a07..cb5cfa6510 100644
--- a/backends/tpm/trace-events
+++ b/backends/tpm/trace-events
@@ -10,7 +10,8 @@ tpm_util_get_buffer_size_len(uint32_t len, size_t expected) "tpm_resp->len = %u,
tpm_util_get_buffer_size_hdr_len2(uint32_t len, size_t expected) "tpm2_resp->hdr.len = %u, expected = %zu"
tpm_util_get_buffer_size_len2(uint32_t len, size_t expected) "tpm2_resp->len = %u, expected = %zu"
tpm_util_get_buffer_size(size_t len) "buffersize of device: %zu"
-tpm_util_show_buffer(const char *direction, size_t len, const char *buf) "direction: %s len: %zu\n%s"
+tpm_util_show_buffer_header(const char *direction, size_t len) "direction: %s len: %zu"
+tpm_util_show_buffer_content(const char *buf) "%s"
# tpm_emulator.c
tpm_emulator_set_locality(uint8_t locty) "setting locality to %d"
--
2.41.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 2/5] hw/sh4: Remove newline character in trace events
2024-06-06 10:39 [PATCH 0/5] trace: Remove and forbid newline characters in event format Philippe Mathieu-Daudé
2024-06-06 10:39 ` [PATCH 1/5] backends/tpm: Remove newline character in trace event Philippe Mathieu-Daudé
@ 2024-06-06 10:39 ` Philippe Mathieu-Daudé
2024-06-06 11:21 ` Daniel P. Berrangé
2024-06-06 10:39 ` [PATCH 3/5] hw/usb: " Philippe Mathieu-Daudé
` (4 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-06-06 10:39 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Cédric Le Goater, Mads Ynddal,
Stefan Hajnoczi, Yoshinori Sato, Stefan Berger,
Philippe Mathieu-Daudé
Trace events aren't designed to be multi-lines. Remove
the newline character which doesn't bring much value.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/sh4/trace-events | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/sh4/trace-events b/hw/sh4/trace-events
index 4b61cd56c8..6bfd7eebc4 100644
--- a/hw/sh4/trace-events
+++ b/hw/sh4/trace-events
@@ -1,3 +1,3 @@
# sh7750.c
-sh7750_porta(uint16_t prev, uint16_t cur, uint16_t pdtr, uint16_t pctr) "porta changed from 0x%04x to 0x%04x\npdtra=0x%04x, pctra=0x%08x"
-sh7750_portb(uint16_t prev, uint16_t cur, uint16_t pdtr, uint16_t pctr) "portb changed from 0x%04x to 0x%04x\npdtrb=0x%04x, pctrb=0x%08x"
+sh7750_porta(uint16_t prev, uint16_t cur, uint16_t pdtr, uint16_t pctr) "porta changed from 0x%04x to 0x%04x (pdtra=0x%04x, pctra=0x%08x)"
+sh7750_portb(uint16_t prev, uint16_t cur, uint16_t pdtr, uint16_t pctr) "portb changed from 0x%04x to 0x%04x (pdtrb=0x%04x, pctrb=0x%08x)"
--
2.41.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 3/5] hw/usb: Remove newline character in trace events
2024-06-06 10:39 [PATCH 0/5] trace: Remove and forbid newline characters in event format Philippe Mathieu-Daudé
2024-06-06 10:39 ` [PATCH 1/5] backends/tpm: Remove newline character in trace event Philippe Mathieu-Daudé
2024-06-06 10:39 ` [PATCH 2/5] hw/sh4: Remove newline character in trace events Philippe Mathieu-Daudé
@ 2024-06-06 10:39 ` Philippe Mathieu-Daudé
2024-06-06 11:21 ` Daniel P. Berrangé
2024-06-06 10:39 ` [PATCH 4/5] hw/vfio: " Philippe Mathieu-Daudé
` (3 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-06-06 10:39 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Cédric Le Goater, Mads Ynddal,
Stefan Hajnoczi, Yoshinori Sato, Stefan Berger,
Philippe Mathieu-Daudé
Trace events aren't designed to be multi-lines.
Remove the newline characters.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/usb/trace-events | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/usb/trace-events b/hw/usb/trace-events
index fd7b90d70c..46732717a9 100644
--- a/hw/usb/trace-events
+++ b/hw/usb/trace-events
@@ -15,7 +15,7 @@ usb_ohci_exit(const char *s) "%s"
# hcd-ohci.c
usb_ohci_iso_td_read_failed(uint32_t addr) "ISO_TD read error at 0x%x"
-usb_ohci_iso_td_head(uint32_t head, uint32_t tail, uint32_t flags, uint32_t bp, uint32_t next, uint32_t be, uint32_t framenum, uint32_t startframe, uint32_t framecount, int rel_frame_num) "ISO_TD ED head 0x%.8x tailp 0x%.8x\n0x%.8x 0x%.8x 0x%.8x 0x%.8x\nframe_number 0x%.8x starting_frame 0x%.8x\nframe_count 0x%.8x relative %d"
+usb_ohci_iso_td_head(uint32_t head, uint32_t tail, uint32_t flags, uint32_t bp, uint32_t next, uint32_t be, uint32_t framenum, uint32_t startframe, uint32_t framecount, int rel_frame_num) "ISO_TD ED head 0x%.8x tailp 0x%.8x, flags 0x%.8x bp 0x%.8x next 0x%.8x be 0x%.8x, frame_number 0x%.8x starting_frame 0x%.8x, frame_count 0x%.8x relative %d"
usb_ohci_iso_td_head_offset(uint32_t o0, uint32_t o1, uint32_t o2, uint32_t o3, uint32_t o4, uint32_t o5, uint32_t o6, uint32_t o7) "0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x"
usb_ohci_iso_td_relative_frame_number_neg(int rel) "ISO_TD R=%d < 0"
usb_ohci_iso_td_relative_frame_number_big(int rel, int count) "ISO_TD R=%d > FC=%d"
@@ -23,7 +23,7 @@ usb_ohci_iso_td_bad_direction(int dir) "Bad direction %d"
usb_ohci_iso_td_bad_bp_be(uint32_t bp, uint32_t be) "ISO_TD bp 0x%.8x be 0x%.8x"
usb_ohci_iso_td_bad_cc_not_accessed(uint32_t start, uint32_t next) "ISO_TD cc != not accessed 0x%.8x 0x%.8x"
usb_ohci_iso_td_bad_cc_overrun(uint32_t start, uint32_t next) "ISO_TD start_offset=0x%.8x > next_offset=0x%.8x"
-usb_ohci_iso_td_so(uint32_t so, uint32_t eo, uint32_t s, uint32_t e, const char *str, ssize_t len, int ret) "0x%.8x eo 0x%.8x\nsa 0x%.8x ea 0x%.8x\ndir %s len %zu ret %d"
+usb_ohci_iso_td_so(uint32_t so, uint32_t eo, uint32_t s, uint32_t e, const char *str, ssize_t len, int ret) "0x%.8x eo 0x%.8x sa 0x%.8x ea 0x%.8x dir %s len %zu ret %d"
usb_ohci_iso_td_data_overrun(int ret, ssize_t len) "DataOverrun %d > %zu"
usb_ohci_iso_td_data_underrun(int ret) "DataUnderrun %d"
usb_ohci_iso_td_nak(int ret) "got NAK/STALL %d"
@@ -55,7 +55,7 @@ usb_ohci_td_pkt_full(const char *dir, const char *buf) "%s data: %s"
usb_ohci_td_too_many_pending(int ep) "ep=%d"
usb_ohci_td_packet_status(int status) "status=%d"
usb_ohci_ed_read_error(uint32_t addr) "ED read error at 0x%x"
-usb_ohci_ed_pkt(uint32_t cur, int h, int c, uint32_t head, uint32_t tail, uint32_t next) "ED @ 0x%.8x h=%u c=%u\n head=0x%.8x tailp=0x%.8x next=0x%.8x"
+usb_ohci_ed_pkt(uint32_t cur, int h, int c, uint32_t head, uint32_t tail, uint32_t next) "ED @ 0x%.8x h=%u c=%u head=0x%.8x tailp=0x%.8x next=0x%.8x"
usb_ohci_ed_pkt_flags(uint32_t fa, uint32_t en, uint32_t d, int s, int k, int f, uint32_t mps) "fa=%u en=%u d=%u s=%u k=%u f=%u mps=%u"
usb_ohci_hcca_read_error(uint32_t addr) "HCCA read error at 0x%x"
usb_ohci_mem_read(uint32_t size, const char *name, uint32_t addr, uint32_t offs, uint32_t val) "%d %s 0x%x %d -> 0x%x"
--
2.41.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 4/5] hw/vfio: Remove newline character in trace events
2024-06-06 10:39 [PATCH 0/5] trace: Remove and forbid newline characters in event format Philippe Mathieu-Daudé
` (2 preceding siblings ...)
2024-06-06 10:39 ` [PATCH 3/5] hw/usb: " Philippe Mathieu-Daudé
@ 2024-06-06 10:39 ` Philippe Mathieu-Daudé
2024-06-06 11:22 ` Daniel P. Berrangé
2024-06-06 10:39 ` [PATCH 5/5] tracetool: Forbid newline character in event format Philippe Mathieu-Daudé
` (2 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-06-06 10:39 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Cédric Le Goater, Mads Ynddal,
Stefan Hajnoczi, Yoshinori Sato, Stefan Berger,
Philippe Mathieu-Daudé
Trace events aren't designed to be multi-lines.
Remove the newline characters.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/vfio/trace-events | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/vfio/trace-events b/hw/vfio/trace-events
index 64161bf6f4..e16179b507 100644
--- a/hw/vfio/trace-events
+++ b/hw/vfio/trace-events
@@ -19,7 +19,7 @@ vfio_msix_fixup(const char *name, int bar, uint64_t start, uint64_t end) " (%s)
vfio_msix_relo(const char *name, int bar, uint64_t offset) " (%s) BAR %d offset 0x%"PRIx64""
vfio_msi_enable(const char *name, int nr_vectors) " (%s) Enabled %d MSI vectors"
vfio_msi_disable(const char *name) " (%s)"
-vfio_pci_load_rom(const char *name, unsigned long size, unsigned long offset, unsigned long flags) "Device %s ROM:\n size: 0x%lx, offset: 0x%lx, flags: 0x%lx"
+vfio_pci_load_rom(const char *name, unsigned long size, unsigned long offset, unsigned long flags) "Device '%s' ROM: size: 0x%lx, offset: 0x%lx, flags: 0x%lx"
vfio_rom_read(const char *name, uint64_t addr, int size, uint64_t data) " (%s, 0x%"PRIx64", 0x%x) = 0x%"PRIx64
vfio_pci_size_rom(const char *name, int size) "%s ROM size 0x%x"
vfio_vga_write(uint64_t addr, uint64_t data, int size) " (0x%"PRIx64", 0x%"PRIx64", %d)"
@@ -35,7 +35,7 @@ vfio_pci_hot_reset(const char *name, const char *type) " (%s) %s"
vfio_pci_hot_reset_has_dep_devices(const char *name) "%s: hot reset dependent devices:"
vfio_pci_hot_reset_dep_devices(int domain, int bus, int slot, int function, int group_id) "\t%04x:%02x:%02x.%x group %d"
vfio_pci_hot_reset_result(const char *name, const char *result) "%s hot reset: %s"
-vfio_populate_device_config(const char *name, unsigned long size, unsigned long offset, unsigned long flags) "Device %s config:\n size: 0x%lx, offset: 0x%lx, flags: 0x%lx"
+vfio_populate_device_config(const char *name, unsigned long size, unsigned long offset, unsigned long flags) "Device '%s' config: size: 0x%lx, offset: 0x%lx, flags: 0x%lx"
vfio_populate_device_get_irq_info_failure(const char *errstr) "VFIO_DEVICE_GET_IRQ_INFO failure: %s"
vfio_attach_device(const char *name, int group_id) " (%s) group %d"
vfio_detach_device(const char *name, int group_id) " (%s) group %d"
--
2.41.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 5/5] tracetool: Forbid newline character in event format
2024-06-06 10:39 [PATCH 0/5] trace: Remove and forbid newline characters in event format Philippe Mathieu-Daudé
` (3 preceding siblings ...)
2024-06-06 10:39 ` [PATCH 4/5] hw/vfio: " Philippe Mathieu-Daudé
@ 2024-06-06 10:39 ` Philippe Mathieu-Daudé
2024-06-06 11:22 ` Daniel P. Berrangé
2024-06-07 10:46 ` [PATCH 0/5] trace: Remove and forbid newline characters " Mads Ynddal
2024-06-10 17:05 ` Stefan Hajnoczi
6 siblings, 1 reply; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-06-06 10:39 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Williamson, Cédric Le Goater, Mads Ynddal,
Stefan Hajnoczi, Yoshinori Sato, Stefan Berger,
Philippe Mathieu-Daudé
Events aren't designed to be multi-lines. Multiple events
can be used instead. Prevent that format using multi-lines
by forbidding the newline character.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
scripts/tracetool/__init__.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index 7237abe0e8..bc03238c0f 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -301,6 +301,8 @@ def build(line_str, lineno, filename):
if fmt.endswith(r'\n"'):
raise ValueError("Event format must not end with a newline "
"character")
+ if '\\n' in fmt:
+ raise ValueError("Event format must not use new line character")
if len(fmt_trans) > 0:
fmt = [fmt_trans, fmt]
--
2.41.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 1/5] backends/tpm: Remove newline character in trace event
2024-06-06 10:39 ` [PATCH 1/5] backends/tpm: Remove newline character in trace event Philippe Mathieu-Daudé
@ 2024-06-06 11:20 ` Daniel P. Berrangé
2024-06-07 15:15 ` Stefan Berger
1 sibling, 0 replies; 15+ messages in thread
From: Daniel P. Berrangé @ 2024-06-06 11:20 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Alex Williamson, Cédric Le Goater, Mads Ynddal,
Stefan Hajnoczi, Yoshinori Sato, Stefan Berger
On Thu, Jun 06, 2024 at 12:39:39PM +0200, Philippe Mathieu-Daudé wrote:
> Split the 'tpm_util_show_buffer' event in two to avoid
> using a newline character.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> backends/tpm/tpm_util.c | 5 +++--
> backends/tpm/trace-events | 3 ++-
> 2 files changed, 5 insertions(+), 3 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/5] hw/sh4: Remove newline character in trace events
2024-06-06 10:39 ` [PATCH 2/5] hw/sh4: Remove newline character in trace events Philippe Mathieu-Daudé
@ 2024-06-06 11:21 ` Daniel P. Berrangé
0 siblings, 0 replies; 15+ messages in thread
From: Daniel P. Berrangé @ 2024-06-06 11:21 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Alex Williamson, Cédric Le Goater, Mads Ynddal,
Stefan Hajnoczi, Yoshinori Sato, Stefan Berger
On Thu, Jun 06, 2024 at 12:39:40PM +0200, Philippe Mathieu-Daudé wrote:
> Trace events aren't designed to be multi-lines. Remove
> the newline character which doesn't bring much value.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/sh4/trace-events | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 3/5] hw/usb: Remove newline character in trace events
2024-06-06 10:39 ` [PATCH 3/5] hw/usb: " Philippe Mathieu-Daudé
@ 2024-06-06 11:21 ` Daniel P. Berrangé
0 siblings, 0 replies; 15+ messages in thread
From: Daniel P. Berrangé @ 2024-06-06 11:21 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Alex Williamson, Cédric Le Goater, Mads Ynddal,
Stefan Hajnoczi, Yoshinori Sato, Stefan Berger
On Thu, Jun 06, 2024 at 12:39:41PM +0200, Philippe Mathieu-Daudé wrote:
> Trace events aren't designed to be multi-lines.
> Remove the newline characters.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/usb/trace-events | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 4/5] hw/vfio: Remove newline character in trace events
2024-06-06 10:39 ` [PATCH 4/5] hw/vfio: " Philippe Mathieu-Daudé
@ 2024-06-06 11:22 ` Daniel P. Berrangé
0 siblings, 0 replies; 15+ messages in thread
From: Daniel P. Berrangé @ 2024-06-06 11:22 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Alex Williamson, Cédric Le Goater, Mads Ynddal,
Stefan Hajnoczi, Yoshinori Sato, Stefan Berger
On Thu, Jun 06, 2024 at 12:39:42PM +0200, Philippe Mathieu-Daudé wrote:
> Trace events aren't designed to be multi-lines.
> Remove the newline characters.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/vfio/trace-events | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 5/5] tracetool: Forbid newline character in event format
2024-06-06 10:39 ` [PATCH 5/5] tracetool: Forbid newline character in event format Philippe Mathieu-Daudé
@ 2024-06-06 11:22 ` Daniel P. Berrangé
0 siblings, 0 replies; 15+ messages in thread
From: Daniel P. Berrangé @ 2024-06-06 11:22 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Alex Williamson, Cédric Le Goater, Mads Ynddal,
Stefan Hajnoczi, Yoshinori Sato, Stefan Berger
On Thu, Jun 06, 2024 at 12:39:43PM +0200, Philippe Mathieu-Daudé wrote:
> Events aren't designed to be multi-lines. Multiple events
> can be used instead. Prevent that format using multi-lines
> by forbidding the newline character.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> scripts/tracetool/__init__.py | 2 ++
> 1 file changed, 2 insertions(+)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/5] trace: Remove and forbid newline characters in event format
2024-06-06 10:39 [PATCH 0/5] trace: Remove and forbid newline characters in event format Philippe Mathieu-Daudé
` (4 preceding siblings ...)
2024-06-06 10:39 ` [PATCH 5/5] tracetool: Forbid newline character in event format Philippe Mathieu-Daudé
@ 2024-06-07 10:46 ` Mads Ynddal
2024-06-10 17:05 ` Stefan Hajnoczi
6 siblings, 0 replies; 15+ messages in thread
From: Mads Ynddal @ 2024-06-07 10:46 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Alex Williamson, Cédric Le Goater,
Stefan Hajnoczi, Yoshinori Sato, Stefan Berger
>
> Trace events aren't designed to be multi-lines.
> Few format use the newline character: remove it
> and forbid further uses.
>
> Philippe Mathieu-Daudé (5):
> backends/tpm: Remove newline character in trace event
> hw/sh4: Remove newline character in trace events
> hw/usb: Remove newline character in trace events
> hw/vfio: Remove newline character in trace events
> tracetool: Forbid newline character in event format
>
> backends/tpm/tpm_util.c | 5 +++--
> backends/tpm/trace-events | 3 ++-
> hw/sh4/trace-events | 4 ++--
> hw/usb/trace-events | 6 +++---
> hw/vfio/trace-events | 4 ++--
> scripts/tracetool/__init__.py | 2 ++
> 6 files changed, 14 insertions(+), 10 deletions(-)
>
> --
> 2.41.0
>
Acked-by: Mads Ynddal <mads@ynddal.dk>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/5] backends/tpm: Remove newline character in trace event
2024-06-06 10:39 ` [PATCH 1/5] backends/tpm: Remove newline character in trace event Philippe Mathieu-Daudé
2024-06-06 11:20 ` Daniel P. Berrangé
@ 2024-06-07 15:15 ` Stefan Berger
1 sibling, 0 replies; 15+ messages in thread
From: Stefan Berger @ 2024-06-07 15:15 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Williamson, Cédric Le Goater, Mads Ynddal,
Stefan Hajnoczi, Yoshinori Sato, Stefan Berger
On 6/6/24 06:39, Philippe Mathieu-Daudé wrote:
> Split the 'tpm_util_show_buffer' event in two to avoid
> using a newline character.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> backends/tpm/tpm_util.c | 5 +++--
> backends/tpm/trace-events | 3 ++-
> 2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/backends/tpm/tpm_util.c b/backends/tpm/tpm_util.c
> index 1856589c3b..cf138551df 100644
> --- a/backends/tpm/tpm_util.c
> +++ b/backends/tpm/tpm_util.c
> @@ -339,10 +339,11 @@ void tpm_util_show_buffer(const unsigned char *buffer,
> size_t len, i;
> char *line_buffer, *p;
>
> - if (!trace_event_get_state_backends(TRACE_TPM_UTIL_SHOW_BUFFER)) {
> + if (!trace_event_get_state_backends(TRACE_TPM_UTIL_SHOW_BUFFER_CONTENT)) {
> return;
> }
> len = MIN(tpm_cmd_get_size(buffer), buffer_size);
> + trace_tpm_util_show_buffer_header(string, len);
>
> /*
> * allocate enough room for 3 chars per buffer entry plus a
> @@ -356,7 +357,7 @@ void tpm_util_show_buffer(const unsigned char *buffer,
> }
> p += sprintf(p, "%.2X ", buffer[i]);
> }
> - trace_tpm_util_show_buffer(string, len, line_buffer);
> + trace_tpm_util_show_buffer_content(line_buffer);
>
> g_free(line_buffer);
> }
> diff --git a/backends/tpm/trace-events b/backends/tpm/trace-events
> index 1ecef42a07..cb5cfa6510 100644
> --- a/backends/tpm/trace-events
> +++ b/backends/tpm/trace-events
> @@ -10,7 +10,8 @@ tpm_util_get_buffer_size_len(uint32_t len, size_t expected) "tpm_resp->len = %u,
> tpm_util_get_buffer_size_hdr_len2(uint32_t len, size_t expected) "tpm2_resp->hdr.len = %u, expected = %zu"
> tpm_util_get_buffer_size_len2(uint32_t len, size_t expected) "tpm2_resp->len = %u, expected = %zu"
> tpm_util_get_buffer_size(size_t len) "buffersize of device: %zu"
> -tpm_util_show_buffer(const char *direction, size_t len, const char *buf) "direction: %s len: %zu\n%s"
> +tpm_util_show_buffer_header(const char *direction, size_t len) "direction: %s len: %zu"
> +tpm_util_show_buffer_content(const char *buf) "%s"
>
> # tpm_emulator.c
> tpm_emulator_set_locality(uint8_t locty) "setting locality to %d"
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/5] trace: Remove and forbid newline characters in event format
2024-06-06 10:39 [PATCH 0/5] trace: Remove and forbid newline characters in event format Philippe Mathieu-Daudé
` (5 preceding siblings ...)
2024-06-07 10:46 ` [PATCH 0/5] trace: Remove and forbid newline characters " Mads Ynddal
@ 2024-06-10 17:05 ` Stefan Hajnoczi
2024-06-10 17:59 ` Philippe Mathieu-Daudé
6 siblings, 1 reply; 15+ messages in thread
From: Stefan Hajnoczi @ 2024-06-10 17:05 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Alex Williamson, Cédric Le Goater, Mads Ynddal,
Yoshinori Sato, Stefan Berger
[-- Attachment #1: Type: text/plain, Size: 958 bytes --]
On Thu, Jun 06, 2024 at 12:39:38PM +0200, Philippe Mathieu-Daudé wrote:
> Trace events aren't designed to be multi-lines.
> Few format use the newline character: remove it
> and forbid further uses.
>
> Philippe Mathieu-Daudé (5):
> backends/tpm: Remove newline character in trace event
> hw/sh4: Remove newline character in trace events
> hw/usb: Remove newline character in trace events
> hw/vfio: Remove newline character in trace events
> tracetool: Forbid newline character in event format
>
> backends/tpm/tpm_util.c | 5 +++--
> backends/tpm/trace-events | 3 ++-
> hw/sh4/trace-events | 4 ++--
> hw/usb/trace-events | 6 +++---
> hw/vfio/trace-events | 4 ++--
> scripts/tracetool/__init__.py | 2 ++
> 6 files changed, 14 insertions(+), 10 deletions(-)
>
> --
> 2.41.0
>
Thanks, applied to my tracing tree:
https://gitlab.com/stefanha/qemu/commits/tracing
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/5] trace: Remove and forbid newline characters in event format
2024-06-10 17:05 ` Stefan Hajnoczi
@ 2024-06-10 17:59 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-06-10 17:59 UTC (permalink / raw)
To: Stefan Hajnoczi
Cc: qemu-devel, Alex Williamson, Cédric Le Goater, Mads Ynddal,
Yoshinori Sato, Stefan Berger
On 10/6/24 19:05, Stefan Hajnoczi wrote:
> On Thu, Jun 06, 2024 at 12:39:38PM +0200, Philippe Mathieu-Daudé wrote:
>> Trace events aren't designed to be multi-lines.
>> Few format use the newline character: remove it
>> and forbid further uses.
>>
>> Philippe Mathieu-Daudé (5):
>> backends/tpm: Remove newline character in trace event
>> hw/sh4: Remove newline character in trace events
>> hw/usb: Remove newline character in trace events
>> hw/vfio: Remove newline character in trace events
>> tracetool: Forbid newline character in event format
> Thanks, applied to my tracing tree:
> https://gitlab.com/stefanha/qemu/commits/tracing
Thanks!
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2024-06-10 18:00 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-06 10:39 [PATCH 0/5] trace: Remove and forbid newline characters in event format Philippe Mathieu-Daudé
2024-06-06 10:39 ` [PATCH 1/5] backends/tpm: Remove newline character in trace event Philippe Mathieu-Daudé
2024-06-06 11:20 ` Daniel P. Berrangé
2024-06-07 15:15 ` Stefan Berger
2024-06-06 10:39 ` [PATCH 2/5] hw/sh4: Remove newline character in trace events Philippe Mathieu-Daudé
2024-06-06 11:21 ` Daniel P. Berrangé
2024-06-06 10:39 ` [PATCH 3/5] hw/usb: " Philippe Mathieu-Daudé
2024-06-06 11:21 ` Daniel P. Berrangé
2024-06-06 10:39 ` [PATCH 4/5] hw/vfio: " Philippe Mathieu-Daudé
2024-06-06 11:22 ` Daniel P. Berrangé
2024-06-06 10:39 ` [PATCH 5/5] tracetool: Forbid newline character in event format Philippe Mathieu-Daudé
2024-06-06 11:22 ` Daniel P. Berrangé
2024-06-07 10:46 ` [PATCH 0/5] trace: Remove and forbid newline characters " Mads Ynddal
2024-06-10 17:05 ` Stefan Hajnoczi
2024-06-10 17:59 ` Philippe Mathieu-Daudé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).