From nobody Sun Sep 28 16:59:04 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1758281200; cv=none; d=zohomail.com; s=zohoarc; b=fzsTK5fo4N/pErXsfcm74aSIDNwVLQSvlFFy9Mz55KMBtKaJr6Q/wzb4qeO+Q9Lt5YSzsOnmJOX8AlKGl6b+i2LJerkmpr57UlOaX/bhsr5xW4IBAktVYx23OGPtKKcHIdXZ+h9umOCUUCIbVq6zgMNKs27W3g0wJlY8GxDXW8k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758281200; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=KUo28CHP7FCCXh5r1Z6RrGofUxFzz8ZREv636OwD0Dc=; b=TFgaS3GWCAj/3hxiQOHT76qgSfVPxlKfzPk2LTSEZzrjupdrelugIkviC4J+R7LT1ZPfm9+5ukd+9Yo4nvoyiVHwC1ntp5GbAIcYGVMXbrH0w9m2WBM7mdncYezChhYTwJ94fhdgB8ziJJvhbkV2V8UM/7CDMUMRVRs8WE+kuyg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758281200440895.7414096263379; Fri, 19 Sep 2025 04:26:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uzZFg-00017s-FC; Fri, 19 Sep 2025 07:26:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uzZFZ-00014W-2J for qemu-devel@nongnu.org; Fri, 19 Sep 2025 07:26:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uzZFW-000165-RA for qemu-devel@nongnu.org; Fri, 19 Sep 2025 07:26:00 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-278-RzMVCz-FOSS3wTJnxOHmiA-1; Fri, 19 Sep 2025 07:25:53 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 32ED11800343; Fri, 19 Sep 2025 11:25:52 +0000 (UTC) Received: from avogadro.redhat.com (unknown [10.44.33.250]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9038230002C8; Fri, 19 Sep 2025 11:25:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1758281156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KUo28CHP7FCCXh5r1Z6RrGofUxFzz8ZREv636OwD0Dc=; b=R6Mj2U3klgo8BwLVoxg4uE9i81FTVARL16VjqliJNVJ7rptr3afsCgEWT3SiPJgh6y8+4S UDZgCpN9OYYlVl+opKyZLdPXwfjqgp5rZrZUTJGkPG7cHBH8BahebYALIMRrHSi41N6W5k RJKPglOU4+uOknfzhdYEyL790HyKpjs= X-MC-Unique: RzMVCz-FOSS3wTJnxOHmiA-1 X-Mimecast-MFC-AGG-ID: RzMVCz-FOSS3wTJnxOHmiA_1758281152 From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Tanish Desai , Zhao Liu , Stefan Hajnoczi , Manos Pitsidianakis , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Mads Ynddal Subject: [PATCH 02/16] tracetool: remove dead code Date: Fri, 19 Sep 2025 13:25:22 +0200 Message-ID: <20250919112536.141782-3-pbonzini@redhat.com> In-Reply-To: <20250919112536.141782-1-pbonzini@redhat.com> References: <20250919112536.141782-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.105, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1758281202658116600 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Stefan Hajnoczi --- 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) =20 - 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\w+)" r"\((?P[^)]*)\)" r"\s*" - r"(?:(?:(?P\".+),)?\s*(?P\".+))?" + r"(?P\".+)?" r"\s*") =20 _VALID_PROPS =3D set(["disable"]) =20 - def __init__(self, name, props, fmt, args, lineno, filename, orig=3DNo= ne, - event_trans=3DNone, event_exec=3DNone): + def __init__(self, name, props, fmt, args, lineno, filename): """ Parameters ---------- @@ -236,20 +231,14 @@ def __init__(self, name, props, fmt, args, lineno, fi= lename, orig=3DNone, 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). =20 """ self.name =3D name @@ -258,29 +247,16 @@ def __init__(self, name, props, fmt, args, lineno, fi= lename, orig=3DNone, self.args =3D args self.lineno =3D int(lineno) self.filename =3D str(filename) - self.event_trans =3D event_trans - self.event_exec =3D event_exec =20 if len(args) > 10: raise ValueError("Event '%s' has more than maximum permitted " "argument count" % name) =20 - if orig is None: - self.original =3D weakref.ref(self) - else: - self.original =3D orig - unknown_props =3D 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) =3D=3D 2 =20 - 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) =20 @staticmethod def build(line_str, lineno, filename): @@ -302,8 +278,7 @@ def build(line_str, lineno, filename): name =3D groups["name"] props =3D groups["props"].split() fmt =3D groups["fmt"] - fmt_trans =3D groups["fmt_trans"] - if fmt.find("%m") !=3D -1 or fmt_trans.find("%m") !=3D -1: + if fmt.find("%m") !=3D -1: raise ValueError("Event format '%m' is forbidden, pass the err= or " "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= ") =20 - if len(fmt_trans) > 0: - fmt =3D [fmt_trans, fmt] args =3D Arguments.build(groups["args"]) =20 return Event(name, props, fmt, args, lineno, posix_relpath(filenam= e)) =20 def __repr__(self): """Evaluable string representation for this object.""" - if isinstance(self.fmt, str): - fmt =3D self.fmt - else: - fmt =3D "%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 =3D re.compile(r"(%[\d\.]*\w+|%.*?PRI\S+)") =20 def formats(self): """List conversion specifiers in the argument print format string.= """ - assert not isinstance(self.fmt, list) return self._FMT.findall(self.fmt) =20 QEMU_TRACE =3D "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 =3D 0 else: enabled =3D 1 - if "tcg-exec" in e.properties: - # a single define for the two "sub-events" - out('#define TRACE_%(name)s_ENABLED %(enabled)d', - name=3De.original.name.upper(), - enabled=3Denabled) out('#define TRACE_%s_ENABLED %d' % (e.name.upper(), enabled)) =20 backend.generate_begin(events, group) --=20 2.51.0