From 0e2b9edfb6126fd9ce235a1b34ba20bbeb2547ae Mon Sep 17 00:00:00 2001 From: Philippe Mathieu-Daudé Date: Thu, 6 Jun 2024 12:26:31 +0200 Subject: tracetool: Remove unused vcpu.py script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit vcpu.py is pointless since commit 89aafcf2a7 ("trace: remove code that depends on setting vcpu"), remote it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Reviewed-by: Zhao Liu Message-id: 20240606102631.78152-1-philmd@linaro.org Signed-off-by: Stefan Hajnoczi --- scripts/tracetool/__init__.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'scripts/tracetool/__init__.py') diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py index b887540a55..7237abe0e8 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -306,13 +306,7 @@ class Event(object): fmt = [fmt_trans, fmt] args = Arguments.build(groups["args"]) - event = Event(name, props, fmt, args, lineno, filename) - - # add implicit arguments when using the 'vcpu' property - import tracetool.vcpu - event = tracetool.vcpu.transform_event(event) - - return event + return Event(name, props, fmt, args, lineno, filename) def __repr__(self): """Evaluable string representation for this object.""" -- cgit 1.4.1 From 4c2b6f328742084a5bd770af7c3a2ef07828c41c Mon Sep 17 00:00:00 2001 From: Philippe Mathieu-Daudé Date: Thu, 6 Jun 2024 12:39:43 +0200 Subject: tracetool: Forbid newline character in event format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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é Acked-by: Mads Ynddal Reviewed-by: Daniel P. Berrangé Message-id: 20240606103943.79116-6-philmd@linaro.org Signed-off-by: Stefan Hajnoczi --- scripts/tracetool/__init__.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts/tracetool/__init__.py') 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 @@ class Event(object): 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] -- cgit 1.4.1