From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Alex Williamson" <alex.williamson@redhat.com>,
"Cédric Le Goater" <clg@redhat.com>,
"Mads Ynddal" <mads@ynddal.dk>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Yoshinori Sato" <ysato@users.sourceforge.jp>,
"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH 5/5] tracetool: Forbid newline character in event format
Date: Thu, 6 Jun 2024 12:39:43 +0200 [thread overview]
Message-ID: <20240606103943.79116-6-philmd@linaro.org> (raw)
In-Reply-To: <20240606103943.79116-1-philmd@linaro.org>
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
next prev parent reply other threads:[~2024-06-06 10:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Philippe Mathieu-Daudé [this message]
2024-06-06 11:22 ` [PATCH 5/5] tracetool: Forbid newline character in event format 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é
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240606103943.79116-6-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=alex.williamson@redhat.com \
--cc=clg@redhat.com \
--cc=mads@ynddal.dk \
--cc=qemu-devel@nongnu.org \
--cc=stefanb@linux.vnet.ibm.com \
--cc=stefanha@redhat.com \
--cc=ysato@users.sourceforge.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).