qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Tanish Desai" <tanishdesai37@gmail.com>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Manos Pitsidianakis" <manos.pitsidianakis@linaro.org>,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	"Mads Ynddal" <mads@ynddal.dk>
Subject: [PATCH 02/16] tracetool: remove dead code
Date: Fri, 19 Sep 2025 13:25:22 +0200	[thread overview]
Message-ID: <20250919112536.141782-3-pbonzini@redhat.com> (raw)
In-Reply-To: <20250919112536.141782-1-pbonzini@redhat.com>

There are no tcg-exec events anymore and the sub-event functionality was
only used for it.  Excise it from tracetool.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 scripts/tracetool/__init__.py | 44 +++++------------------------------
 scripts/tracetool/format/h.py |  5 ----
 2 files changed, 6 insertions(+), 43 deletions(-)

diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index 1d5238a0843..afa889e759e 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -122,10 +122,6 @@ def __init__(self, args):
             else:
                 self._args.append(arg)
 
-    def copy(self):
-        """Create a new copy."""
-        return Arguments(list(self._args))
-
     @staticmethod
     def build(arg_str):
         """Build and Arguments instance from an argument string.
@@ -222,13 +218,12 @@ class Event(object):
                       r"(?P<name>\w+)"
                       r"\((?P<args>[^)]*)\)"
                       r"\s*"
-                      r"(?:(?:(?P<fmt_trans>\".+),)?\s*(?P<fmt>\".+))?"
+                      r"(?P<fmt>\".+)?"
                       r"\s*")
 
     _VALID_PROPS = set(["disable"])
 
-    def __init__(self, name, props, fmt, args, lineno, filename, orig=None,
-                 event_trans=None, event_exec=None):
+    def __init__(self, name, props, fmt, args, lineno, filename):
         """
         Parameters
         ----------
@@ -236,20 +231,14 @@ def __init__(self, name, props, fmt, args, lineno, filename, orig=None,
             Event name.
         props : list of str
             Property names.
-        fmt : str, list of str
-            Event printing format string(s).
+        fmt : str
+            Event printing format string.
         args : Arguments
             Event arguments.
         lineno : int
             The line number in the input file.
         filename : str
             The path to the input file.
-        orig : Event or None
-            Original Event before transformation/generation.
-        event_trans : Event or None
-            Generated translation-time event ("tcg" property).
-        event_exec : Event or None
-            Generated execution-time event ("tcg" property).
 
         """
         self.name = name
@@ -258,29 +247,16 @@ def __init__(self, name, props, fmt, args, lineno, filename, orig=None,
         self.args = args
         self.lineno = int(lineno)
         self.filename = str(filename)
-        self.event_trans = event_trans
-        self.event_exec = event_exec
 
         if len(args) > 10:
             raise ValueError("Event '%s' has more than maximum permitted "
                              "argument count" % name)
 
-        if orig is None:
-            self.original = weakref.ref(self)
-        else:
-            self.original = orig
-
         unknown_props = set(self.properties) - self._VALID_PROPS
         if len(unknown_props) > 0:
             raise ValueError("Unknown properties: %s"
                              % ", ".join(unknown_props))
-        assert isinstance(self.fmt, str) or len(self.fmt) == 2
 
-    def copy(self):
-        """Create a new copy."""
-        return Event(self.name, list(self.properties), self.fmt,
-                     self.args.copy(), self.lineno, self.filename,
-                     self, self.event_trans, self.event_exec)
 
     @staticmethod
     def build(line_str, lineno, filename):
@@ -302,8 +278,7 @@ def build(line_str, lineno, filename):
         name = groups["name"]
         props = groups["props"].split()
         fmt = groups["fmt"]
-        fmt_trans = groups["fmt_trans"]
-        if fmt.find("%m") != -1 or fmt_trans.find("%m") != -1:
+        if fmt.find("%m") != -1:
             raise ValueError("Event format '%m' is forbidden, pass the error "
                              "as an explicit trace argument")
         if fmt.endswith(r'\n"'):
@@ -312,29 +287,22 @@ def build(line_str, lineno, filename):
         if '\\n' in fmt:
             raise ValueError("Event format must not use new line character")
 
-        if len(fmt_trans) > 0:
-            fmt = [fmt_trans, fmt]
         args = Arguments.build(groups["args"])
 
         return Event(name, props, fmt, args, lineno, posix_relpath(filename))
 
     def __repr__(self):
         """Evaluable string representation for this object."""
-        if isinstance(self.fmt, str):
-            fmt = self.fmt
-        else:
-            fmt = "%s, %s" % (self.fmt[0], self.fmt[1])
         return "Event('%s %s(%s) %s')" % (" ".join(self.properties),
                                           self.name,
                                           self.args,
-                                          fmt)
+                                          self.fmt)
     # Star matching on PRI is dangerous as one might have multiple
     # arguments with that format, hence the non-greedy version of it.
     _FMT = re.compile(r"(%[\d\.]*\w+|%.*?PRI\S+)")
 
     def formats(self):
         """List conversion specifiers in the argument print format string."""
-        assert not isinstance(self.fmt, list)
         return self._FMT.findall(self.fmt)
 
     QEMU_TRACE               = "trace_%(name)s"
diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py
index b42a8268a81..bd9e0ca7f23 100644
--- a/scripts/tracetool/format/h.py
+++ b/scripts/tracetool/format/h.py
@@ -40,11 +40,6 @@ def generate(events, backend, group):
             enabled = 0
         else:
             enabled = 1
-        if "tcg-exec" in e.properties:
-            # a single define for the two "sub-events"
-            out('#define TRACE_%(name)s_ENABLED %(enabled)d',
-                name=e.original.name.upper(),
-                enabled=enabled)
         out('#define TRACE_%s_ENABLED %d' % (e.name.upper(), enabled))
 
     backend.generate_begin(events, group)
-- 
2.51.0




  parent reply	other threads:[~2025-09-19 11:26 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19 11:25 [PATCH 00/16] tracetool: add Rust support Paolo Bonzini
2025-09-19 11:25 ` [PATCH 01/16] tracetool: fix usage of try_import() Paolo Bonzini
2025-09-23 19:06   ` Stefan Hajnoczi
2025-09-19 11:25 ` Paolo Bonzini [this message]
2025-09-23 19:06   ` [PATCH 02/16] tracetool: remove dead code Stefan Hajnoczi
2025-09-19 11:25 ` [PATCH 03/16] treewide: remove unnessary "coding" header Paolo Bonzini
2025-09-23 19:06   ` Stefan Hajnoczi
2025-09-19 11:25 ` [PATCH 04/16] tracetool: add SPDX headers Paolo Bonzini
2025-09-23 19:06   ` Stefan Hajnoczi
2025-09-19 11:25 ` [PATCH 05/16] trace/ftrace: move snprintf+write from tracepoints to ftrace.c Paolo Bonzini
2025-09-19 11:25 ` [PATCH 06/16] tracetool: add CHECK_TRACE_EVENT_GET_STATE Paolo Bonzini
2025-09-19 11:25 ` [PATCH 07/16] tracetool/backend: remove redundant trace event checks Paolo Bonzini
2025-09-19 11:25 ` [PATCH 08/16] tracetool: Add Rust format support Paolo Bonzini
2025-09-23 19:23   ` Stefan Hajnoczi
2025-09-24  7:13     ` Paolo Bonzini
2025-09-24  7:50       ` Daniel P. Berrangé
2025-09-24 11:49         ` Stefan Hajnoczi
2025-09-24 11:56           ` Daniel P. Berrangé
2025-09-24 18:10       ` Stefan Hajnoczi
2025-09-24 19:58         ` Paolo Bonzini
2025-09-25 11:50           ` Stefan Hajnoczi
2025-09-25 12:38             ` Paolo Bonzini
2025-09-25 15:09               ` Stefan Hajnoczi
2025-09-25 15:37                 ` Paolo Bonzini
2025-09-25 17:16                   ` Stefan Hajnoczi
2025-09-19 11:25 ` [PATCH 09/16] rust: add trace crate Paolo Bonzini
2025-09-23 19:29   ` Stefan Hajnoczi
2025-09-19 11:25 ` [PATCH 10/16] rust: qdev: add minimal clock bindings Paolo Bonzini
2025-09-23 19:31   ` Stefan Hajnoczi
2025-09-19 11:25 ` [PATCH 11/16] rust: pl011: add tracepoints Paolo Bonzini
2025-09-23 19:04   ` Stefan Hajnoczi
2025-09-19 11:25 ` [PATCH 12/16] tracetool/simple: add Rust support Paolo Bonzini
2025-09-23 19:35   ` Stefan Hajnoczi
2025-09-19 11:25 ` [PATCH 13/16] log: change qemu_loglevel to unsigned Paolo Bonzini
2025-09-23 19:06   ` Stefan Hajnoczi
2025-09-19 11:25 ` [PATCH 14/16] tracetool/log: add Rust support Paolo Bonzini
2025-09-23 19:36   ` Stefan Hajnoczi
2025-09-19 11:25 ` [PATCH 15/16] tracetool/ftrace: " Paolo Bonzini
2025-09-23 19:36   ` Stefan Hajnoczi
2025-09-19 11:25 ` [PATCH 16/16] tracetool/syslog: " Paolo Bonzini
2025-09-23 19:37   ` Stefan Hajnoczi
2025-09-23 19:43 ` [PATCH 00/16] tracetool: " Stefan Hajnoczi
  -- strict thread matches above, loose matches on Subject: below --
2025-09-29 15:49 [PATCH v2 " Paolo Bonzini
2025-09-29 15:49 ` [PATCH 02/16] tracetool: remove dead code Paolo Bonzini

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=20250919112536.141782-3-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=berrange@redhat.com \
    --cc=mads@ynddal.dk \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=tanishdesai37@gmail.com \
    --cc=zhao1.liu@intel.com \
    /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).