From nobody Sat Feb 7 08:53:19 2026 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=1768849737; cv=none; d=zohomail.com; s=zohoarc; b=DUjW6pj1+s9HmkbBGxhqOPXCZcO+OUS90AUQyCsrTbsz59COxucC2Mt6KEgNOmdulKYtDpuzPPGkyJM1qTPCZ1/G4mDpweIaaaXHsnEWrFd6Xj5LcInA2BpXa3pLMr7yUBGo+oXrW8K/HHWHFKi7V2w4N5hfWKpOgi09DfFri9c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768849737; h=Content-Type: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=zscoSxtkSHlwUoNuyPuo1TQzLT/EYP4bx/VvekL2rR0=; b=BGe31hHotFflEjuFqXTXpq07jWJEBOgbVEfSwdvXHc9H1mXs2GFMdWMRq2wOKoT3MfeFEj9gEE1OGb4J20/vpLaulG10DZhC1V34YD2yCMBkIdsoKngJiiDHcc/1bO8xR4IdL+i3xp566/THHaVpDV1L7Yw4yyLrXRwLK/Cr74g= 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 1768849737789369.328418128815; Mon, 19 Jan 2026 11:08:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vhucF-00026g-Fb; Mon, 19 Jan 2026 14:08:43 -0500 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 1vhuc6-00022A-78 for qemu-devel@nongnu.org; Mon, 19 Jan 2026 14:08:35 -0500 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 1vhuc4-0000u1-NN for qemu-devel@nongnu.org; Mon, 19 Jan 2026 14:08:33 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-532-q_Fho1I9PsC-HzhtoGXf2A-1; Mon, 19 Jan 2026 14:08:28 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9234D195608E; Mon, 19 Jan 2026 19:08:27 +0000 (UTC) Received: from localhost (unknown [10.2.16.150]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E5853180049F; Mon, 19 Jan 2026 19:08:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768849712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zscoSxtkSHlwUoNuyPuo1TQzLT/EYP4bx/VvekL2rR0=; b=imaDwS46rY48WDwM3s7QdaxZmwPb5kbx2IuOA96txfhG4kqmmJH9wne9DY9UhshhpOF5Ti RDqbrNFH11w16IyrIzoHlc9KWJdVBdt09NmAInPKBAjWZv1JmfG/yoJ1iy2XfeQKZmbtEu iZioqon3DHI2csXq4senETYdCA4nTAo= X-MC-Unique: q_Fho1I9PsC-HzhtoGXf2A-1 X-Mimecast-MFC-AGG-ID: q_Fho1I9PsC-HzhtoGXf2A_1768849708 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: Cleber Rosa , Stefan Hajnoczi , Mads Ynddal , Richard Henderson , John Snow , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 1/8] tracetool: rename variable with conflicting types Date: Mon, 19 Jan 2026 14:08:16 -0500 Message-ID: <20260119190823.867761-2-stefanha@redhat.com> In-Reply-To: <20260119190823.867761-1-stefanha@redhat.com> References: <20260119190823.867761-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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 (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=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.016, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: qemu development 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: 1768849739638154100 From: Paolo Bonzini "backend" is used as both a string and a backend.Wrapper. In preparation for adding type annotations, use different names. Signed-off-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrang=C3=A9 Message-ID: <20251008063546.376603-2-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi --- scripts/tracetool/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py index 61ba6f1ba8..fab98bf67e 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -567,9 +567,9 @@ def generate(events, group, format, backends, =20 if len(backends) =3D=3D 0: raise TracetoolError("no backends specified") - for backend in backends: - if not tracetool.backend.exists(backend): - raise TracetoolError("unknown backend: %s" % backend) + for backend_name in backends: + if not tracetool.backend.exists(backend_name): + raise TracetoolError("unknown backend: %s" % backend_name) backend =3D tracetool.backend.Wrapper(backends, format) =20 import tracetool.backend.dtrace --=20 2.52.0 From nobody Sat Feb 7 08:53:19 2026 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=1768849748; cv=none; d=zohomail.com; s=zohoarc; b=Ruoei291pJmE1GaouFrrdZnoGkzTaMfKs/lcEGraJmAWCMsirTtJRoeW+zlkkGXRd6U5HwIaLNY2RcWcxVKMZgrOhT9JNc3FAbZJ5ULpl2PaOSafJKEmMYEmPo8TffgRlxiaAhcXnEqgqqk45An/s8bVSXjtT4ZROCivqQrWJn4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768849748; h=Content-Type: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=4pQtSxw25lsseQxtlDKzKY2GXSF9H+AJrIAZz2l5pKI=; b=DbI2ykJ+vFUMmvsuFZxyo5ONMcUQ1+SVCgjuL24ToI9zRHDZV9O4LClxPOUGAkOVUibJb6onmBg2lDU2kIEsoju4OFrmvuPqXLBo4Ot4LYdMtt9zEH0fADHuVjz5MVQicdiYy4f+M6l/hjB1Iybvifc1TvwXLYHbFMLwWIJQ5hg= 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 1768849748465581.10736860136; Mon, 19 Jan 2026 11:09:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vhucJ-0002C0-Lp; Mon, 19 Jan 2026 14:08:49 -0500 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 1vhuc9-00023a-CX for qemu-devel@nongnu.org; Mon, 19 Jan 2026 14:08:37 -0500 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 1vhuc5-0000u9-2l for qemu-devel@nongnu.org; Mon, 19 Jan 2026 14:08:35 -0500 Received: from mx-prod-mc-06.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-572-biK80lY4MFOz5hxu5b0EzA-1; Mon, 19 Jan 2026 14:08:30 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 97FE218005B8; Mon, 19 Jan 2026 19:08:29 +0000 (UTC) Received: from localhost (unknown [10.2.16.150]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2C4FB180049F; Mon, 19 Jan 2026 19:08:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768849712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4pQtSxw25lsseQxtlDKzKY2GXSF9H+AJrIAZz2l5pKI=; b=TB9oXzKnGK8cZxPLUgKieRhYDe0mxwLh3/mRggA/tUXXBHggpFBWnzg2NmkoNTGtxR4Ccj KeXs+qsinnyG5tzpyp+qYi2eFUfWhHqzoVcF7WX9fW6R/yBCCFIKSojvHgFy1nByI47kWg Ra0/AFxkMGKNxHw7klGrcxMJ+Y9lhVk= X-MC-Unique: biK80lY4MFOz5hxu5b0EzA-1 X-Mimecast-MFC-AGG-ID: biK80lY4MFOz5hxu5b0EzA_1768849710 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: Cleber Rosa , Stefan Hajnoczi , Mads Ynddal , Richard Henderson , John Snow , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 2/8] tracetool: apply isort and add check Date: Mon, 19 Jan 2026 14:08:17 -0500 Message-ID: <20260119190823.867761-3-stefanha@redhat.com> In-Reply-To: <20260119190823.867761-1-stefanha@redhat.com> References: <20260119190823.867761-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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 (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=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.016, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: qemu development 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: 1768849750738158500 From: Paolo Bonzini Sort imports automatically, to keep the coding style more uniform. Signed-off-by: Paolo Bonzini Reviewed-by: Daniel P. Berrang=C3=A9 Message-ID: <20251008063546.376603-3-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi --- python/tests/tracetool-isort.sh | 4 ++++ scripts/tracetool.py | 5 ++--- scripts/tracetool/backend/dtrace.py | 1 - scripts/tracetool/backend/ftrace.py | 3 +-- scripts/tracetool/backend/log.py | 3 +-- scripts/tracetool/backend/simple.py | 1 - scripts/tracetool/backend/syslog.py | 3 +-- scripts/tracetool/backend/ust.py | 1 - scripts/tracetool/format/d.py | 2 +- scripts/tracetool/format/log_stap.py | 1 - scripts/tracetool/format/stap.py | 1 - 11 files changed, 10 insertions(+), 15 deletions(-) create mode 100755 python/tests/tracetool-isort.sh diff --git a/python/tests/tracetool-isort.sh b/python/tests/tracetool-isort= .sh new file mode 100755 index 0000000000..b23f3d4844 --- /dev/null +++ b/python/tests/tracetool-isort.sh @@ -0,0 +1,4 @@ +#!/bin/sh -e +# SPDX-License-Identifier: GPL-2.0-or-later + +python3 -m isort --sp . -c ../scripts/tracetool/ diff --git a/scripts/tracetool.py b/scripts/tracetool.py index 0fdc9cb947..22fdc29e01 100755 --- a/scripts/tracetool.py +++ b/scripts/tracetool.py @@ -12,13 +12,12 @@ __email__ =3D "stefanha@redhat.com" =20 =20 -import sys import getopt +import sys =20 -from tracetool import error_write, out, out_open import tracetool.backend import tracetool.format - +from tracetool import error_write, out, out_open =20 _SCRIPT =3D "" =20 diff --git a/scripts/tracetool/backend/dtrace.py b/scripts/tracetool/backen= d/dtrace.py index f0b58cc158..5f313ddaed 100644 --- a/scripts/tracetool/backend/dtrace.py +++ b/scripts/tracetool/backend/dtrace.py @@ -14,7 +14,6 @@ =20 from tracetool import out =20 - PUBLIC =3D True =20 =20 diff --git a/scripts/tracetool/backend/ftrace.py b/scripts/tracetool/backen= d/ftrace.py index e03698a2ed..0d77bd23a5 100644 --- a/scripts/tracetool/backend/ftrace.py +++ b/scripts/tracetool/backend/ftrace.py @@ -12,8 +12,7 @@ __email__ =3D "stefanha@redhat.com" =20 =20 -from tracetool import out, expand_format_string - +from tracetool import expand_format_string, out =20 PUBLIC =3D True CHECK_TRACE_EVENT_GET_STATE =3D True diff --git a/scripts/tracetool/backend/log.py b/scripts/tracetool/backend/l= og.py index 9e3e5046f5..bbfb56911d 100644 --- a/scripts/tracetool/backend/log.py +++ b/scripts/tracetool/backend/log.py @@ -12,8 +12,7 @@ __email__ =3D "stefanha@redhat.com" =20 =20 -from tracetool import out, expand_format_string - +from tracetool import expand_format_string, out =20 PUBLIC =3D True CHECK_TRACE_EVENT_GET_STATE =3D True diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/backen= d/simple.py index b131e4fc19..b67257ce7e 100644 --- a/scripts/tracetool/backend/simple.py +++ b/scripts/tracetool/backend/simple.py @@ -14,7 +14,6 @@ =20 from tracetool import out =20 - PUBLIC =3D True CHECK_TRACE_EVENT_GET_STATE =3D True =20 diff --git a/scripts/tracetool/backend/syslog.py b/scripts/tracetool/backen= d/syslog.py index 12b826593d..c3efab036c 100644 --- a/scripts/tracetool/backend/syslog.py +++ b/scripts/tracetool/backend/syslog.py @@ -12,8 +12,7 @@ __email__ =3D "stefanha@redhat.com" =20 =20 -from tracetool import out, expand_format_string - +from tracetool import expand_format_string, out =20 PUBLIC =3D True CHECK_TRACE_EVENT_GET_STATE =3D True diff --git a/scripts/tracetool/backend/ust.py b/scripts/tracetool/backend/u= st.py index 3aa9bb1da2..a70e3d83e1 100644 --- a/scripts/tracetool/backend/ust.py +++ b/scripts/tracetool/backend/ust.py @@ -14,7 +14,6 @@ =20 from tracetool import out =20 - PUBLIC =3D True =20 =20 diff --git a/scripts/tracetool/format/d.py b/scripts/tracetool/format/d.py index e9e33dfe30..0befd444e8 100644 --- a/scripts/tracetool/format/d.py +++ b/scripts/tracetool/format/d.py @@ -12,9 +12,9 @@ __email__ =3D "stefanha@redhat.com" =20 =20 -from tracetool import out from sys import platform =20 +from tracetool import out =20 # Reserved keywords from # https://wikis.oracle.com/display/DTrace/Types,+Operators+and+Expressions diff --git a/scripts/tracetool/format/log_stap.py b/scripts/tracetool/forma= t/log_stap.py index 259303a189..99c6181f38 100644 --- a/scripts/tracetool/format/log_stap.py +++ b/scripts/tracetool/format/log_stap.py @@ -18,7 +18,6 @@ from tracetool.backend.simple import is_string from tracetool.format.stap import stap_escape =20 - STATE_SKIP =3D 0 STATE_LITERAL =3D 1 STATE_MACRO =3D 2 diff --git a/scripts/tracetool/format/stap.py b/scripts/tracetool/format/st= ap.py index 285c9203ba..f917bd7545 100644 --- a/scripts/tracetool/format/stap.py +++ b/scripts/tracetool/format/stap.py @@ -15,7 +15,6 @@ from tracetool import out from tracetool.backend.dtrace import binary, probeprefix =20 - # Technically 'self' is not used by systemtap yet, but # they recommended we keep it in the reserved list anyway RESERVED_WORDS =3D ( --=20 2.52.0 From nobody Sat Feb 7 08:53:19 2026 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=1768849777; cv=none; d=zohomail.com; s=zohoarc; b=Tx61gf//hBpMhXf2Zxaz6Q9DSrj424XCVd6/l1dSue9wwDe+TfsMy192U5oNhzEN/MRs1bYZOZRGCLU0toy0Fh2RPXGZs/sXbSPMxpNlESaPWYHTYDDogJ74mAVCsdISP5xgBfK1k9QrVDYnTh9UlMkg+9Q2l+6htGQxpqJEm/c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768849777; h=Content-Type: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=iDD3m9+6vrdoCwdV9CML/lAYXwH542ggYVyS9HO3KmE=; b=l1wfywZ+70Utj0soGXGzq07EvZrRfDhciKuHl9zPmSTM1JOGfKC1nU1b/dJsvhG9wdz+yUghEzCrOivADa1z7fHu9C50VGfZLs0fWbaptkyMfemNf979UXo851TiLRR5bl2DGjm+0cwfPpKDXh9tvYrtKFbgsxMiEhvO9TYKYfU= 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 1768849777310190.76100355417066; Mon, 19 Jan 2026 11:09:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vhucL-0002CW-Rf; Mon, 19 Jan 2026 14:08:49 -0500 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 1vhuc9-00023b-Cd for qemu-devel@nongnu.org; Mon, 19 Jan 2026 14:08:37 -0500 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 1vhuc6-0000uR-PN for qemu-devel@nongnu.org; Mon, 19 Jan 2026 14:08:36 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-106-j0iQmdHiMWWjDGRu-SmYiA-1; Mon, 19 Jan 2026 14:08:32 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8EB92195608E; Mon, 19 Jan 2026 19:08:31 +0000 (UTC) Received: from localhost (unknown [10.2.16.150]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D3C2119560AB; Mon, 19 Jan 2026 19:08:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768849714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iDD3m9+6vrdoCwdV9CML/lAYXwH542ggYVyS9HO3KmE=; b=AnbrZ6J08ZjYyaQzNotn7VUdGkNGpJAL5e85DHFt9/KgemErGRV+oBX4OgXrZdKRou7KsX 9wTdvsudgYsRgehfOu1wkN612YITZXjyI9NsXFoOoMWfl/0lW3kim2JNCi/S+5vjWUlkQ6 JbBDBxPyEabiePZc5AqCX2slzCf3ZLw= X-MC-Unique: j0iQmdHiMWWjDGRu-SmYiA-1 X-Mimecast-MFC-AGG-ID: j0iQmdHiMWWjDGRu-SmYiA_1768849711 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: Cleber Rosa , Stefan Hajnoczi , Mads Ynddal , Richard Henderson , John Snow , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 3/8] tracetool: "import annotations" Date: Mon, 19 Jan 2026 14:08:18 -0500 Message-ID: <20260119190823.867761-4-stefanha@redhat.com> In-Reply-To: <20260119190823.867761-1-stefanha@redhat.com> References: <20260119190823.867761-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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 (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=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.016, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: qemu development 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: 1768849780068154100 From: Paolo Bonzini In preparations for adding type annotations, make Python process them lazil= y. This avoids the need to express some annotations as strings. Signed-off-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrang=C3=A9 Message-ID: <20251008063546.376603-4-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi --- scripts/tracetool.py | 2 ++ scripts/tracetool/__init__.py | 2 ++ scripts/tracetool/backend/__init__.py | 2 ++ scripts/tracetool/backend/dtrace.py | 2 ++ scripts/tracetool/backend/ftrace.py | 2 ++ scripts/tracetool/backend/log.py | 2 ++ scripts/tracetool/backend/simple.py | 2 ++ scripts/tracetool/backend/syslog.py | 2 ++ scripts/tracetool/backend/ust.py | 2 ++ scripts/tracetool/format/__init__.py | 2 ++ scripts/tracetool/format/c.py | 2 ++ scripts/tracetool/format/d.py | 2 ++ scripts/tracetool/format/h.py | 2 ++ scripts/tracetool/format/log_stap.py | 2 ++ scripts/tracetool/format/rs.py | 2 ++ scripts/tracetool/format/simpletrace_stap.py | 2 ++ scripts/tracetool/format/stap.py | 2 ++ scripts/tracetool/format/ust_events_c.py | 2 ++ scripts/tracetool/format/ust_events_h.py | 2 ++ 19 files changed, 38 insertions(+) diff --git a/scripts/tracetool.py b/scripts/tracetool.py index 22fdc29e01..390f1a371b 100755 --- a/scripts/tracetool.py +++ b/scripts/tracetool.py @@ -4,6 +4,8 @@ Command-line wrapper for the tracetool machinery. """ =20 +from __future__ import annotations + __author__ =3D "Llu=C3=ADs Vilanova " __copyright__ =3D "Copyright 2012-2014, Llu=C3=ADs Vilanova " __license__ =3D "GPL version 2 or (at your option) any later version" diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py index fab98bf67e..0316f3f852 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -4,6 +4,8 @@ Machinery for generating tracing-related intermediate files. """ =20 +from __future__ import annotations + __author__ =3D "Llu=C3=ADs Vilanova " __copyright__ =3D "Copyright 2012-2017, Llu=C3=ADs Vilanova " __license__ =3D "GPL version 2 or (at your option) any later version" diff --git a/scripts/tracetool/backend/__init__.py b/scripts/tracetool/back= end/__init__.py index 9109a783c7..8cc9c82138 100644 --- a/scripts/tracetool/backend/__init__.py +++ b/scripts/tracetool/backend/__init__.py @@ -49,6 +49,8 @@ =20 """ =20 +from __future__ import annotations + __author__ =3D "Llu=C3=ADs Vilanova " __copyright__ =3D "Copyright 2012-2014, Llu=C3=ADs Vilanova " __license__ =3D "GPL version 2 or (at your option) any later version" diff --git a/scripts/tracetool/backend/dtrace.py b/scripts/tracetool/backen= d/dtrace.py index 5f313ddaed..c21a04c653 100644 --- a/scripts/tracetool/backend/dtrace.py +++ b/scripts/tracetool/backend/dtrace.py @@ -4,6 +4,8 @@ DTrace/SystemTAP backend. """ =20 +from __future__ import annotations + __author__ =3D "Llu=C3=ADs Vilanova " __copyright__ =3D "Copyright 2012-2017, Llu=C3=ADs Vilanova " __license__ =3D "GPL version 2 or (at your option) any later version" diff --git a/scripts/tracetool/backend/ftrace.py b/scripts/tracetool/backen= d/ftrace.py index 0d77bd23a5..40bb323f5e 100644 --- a/scripts/tracetool/backend/ftrace.py +++ b/scripts/tracetool/backend/ftrace.py @@ -4,6 +4,8 @@ Ftrace built-in backend. """ =20 +from __future__ import annotations + __author__ =3D "Eiichi Tsukata " __copyright__ =3D "Copyright (C) 2013 Hitachi, Ltd." __license__ =3D "GPL version 2 or (at your option) any later version" diff --git a/scripts/tracetool/backend/log.py b/scripts/tracetool/backend/l= og.py index bbfb56911d..d346a19e40 100644 --- a/scripts/tracetool/backend/log.py +++ b/scripts/tracetool/backend/log.py @@ -4,6 +4,8 @@ Stderr built-in backend. """ =20 +from __future__ import annotations + __author__ =3D "Llu=C3=ADs Vilanova " __copyright__ =3D "Copyright 2012-2017, Llu=C3=ADs Vilanova " __license__ =3D "GPL version 2 or (at your option) any later version" diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/backen= d/simple.py index b67257ce7e..9c691dc231 100644 --- a/scripts/tracetool/backend/simple.py +++ b/scripts/tracetool/backend/simple.py @@ -4,6 +4,8 @@ Simple built-in backend. """ =20 +from __future__ import annotations + __author__ =3D "Llu=C3=ADs Vilanova " __copyright__ =3D "Copyright 2012-2017, Llu=C3=ADs Vilanova " __license__ =3D "GPL version 2 or (at your option) any later version" diff --git a/scripts/tracetool/backend/syslog.py b/scripts/tracetool/backen= d/syslog.py index c3efab036c..9311453c5a 100644 --- a/scripts/tracetool/backend/syslog.py +++ b/scripts/tracetool/backend/syslog.py @@ -4,6 +4,8 @@ Syslog built-in backend. """ =20 +from __future__ import annotations + __author__ =3D "Paul Durrant " __copyright__ =3D "Copyright 2016, Citrix Systems Inc." __license__ =3D "GPL version 2 or (at your option) any later version" diff --git a/scripts/tracetool/backend/ust.py b/scripts/tracetool/backend/u= st.py index a70e3d83e1..f227072512 100644 --- a/scripts/tracetool/backend/ust.py +++ b/scripts/tracetool/backend/ust.py @@ -4,6 +4,8 @@ LTTng User Space Tracing backend. """ =20 +from __future__ import annotations + __author__ =3D "Llu=C3=ADs Vilanova " __copyright__ =3D "Copyright 2012-2017, Llu=C3=ADs Vilanova " __license__ =3D "GPL version 2 or (at your option) any later version" diff --git a/scripts/tracetool/format/__init__.py b/scripts/tracetool/forma= t/__init__.py index 7b9d1b5782..4c606d5757 100644 --- a/scripts/tracetool/format/__init__.py +++ b/scripts/tracetool/format/__init__.py @@ -27,6 +27,8 @@ =20 """ =20 +from __future__ import annotations + __author__ =3D "Llu=C3=ADs Vilanova " __copyright__ =3D "Copyright 2012-2014, Llu=C3=ADs Vilanova " __license__ =3D "GPL version 2 or (at your option) any later version" diff --git a/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py index 50e03313cb..5b3459f2be 100644 --- a/scripts/tracetool/format/c.py +++ b/scripts/tracetool/format/c.py @@ -4,6 +4,8 @@ trace/generated-tracers.c """ =20 +from __future__ import annotations + __author__ =3D "Llu=C3=ADs Vilanova " __copyright__ =3D "Copyright 2012-2014, Llu=C3=ADs Vilanova " __license__ =3D "GPL version 2 or (at your option) any later version" diff --git a/scripts/tracetool/format/d.py b/scripts/tracetool/format/d.py index 0befd444e8..dda80eeb76 100644 --- a/scripts/tracetool/format/d.py +++ b/scripts/tracetool/format/d.py @@ -4,6 +4,8 @@ trace/generated-tracers.dtrace (DTrace only). """ =20 +from __future__ import annotations + __author__ =3D "Llu=C3=ADs Vilanova " __copyright__ =3D "Copyright 2012-2014, Llu=C3=ADs Vilanova " __license__ =3D "GPL version 2 or (at your option) any later version" diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index dd58713a15..d04cabc63e 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -4,6 +4,8 @@ trace/generated-tracers.h """ =20 +from __future__ import annotations + __author__ =3D "Llu=C3=ADs Vilanova " __copyright__ =3D "Copyright 2012-2017, Llu=C3=ADs Vilanova " __license__ =3D "GPL version 2 or (at your option) any later version" diff --git a/scripts/tracetool/format/log_stap.py b/scripts/tracetool/forma= t/log_stap.py index 99c6181f38..6551444203 100644 --- a/scripts/tracetool/format/log_stap.py +++ b/scripts/tracetool/format/log_stap.py @@ -4,6 +4,8 @@ Generate .stp file that printfs log messages (DTrace with SystemTAP only). """ =20 +from __future__ import annotations + __author__ =3D "Daniel P. Berrange " __copyright__ =3D "Copyright (C) 2014-2019, Red Hat, Inc." __license__ =3D "GPL version 2 or (at your option) any later version" diff --git a/scripts/tracetool/format/rs.py b/scripts/tracetool/format/rs.py index 7d9af7edfe..1dc43a3b34 100644 --- a/scripts/tracetool/format/rs.py +++ b/scripts/tracetool/format/rs.py @@ -4,6 +4,8 @@ trace-DIR.rs """ =20 +from __future__ import annotations + __author__ =3D "Tanish Desai " __copyright__ =3D "Copyright 2025, Tanish Desai " __license__ =3D "GPL version 2 or (at your option) any later version" diff --git a/scripts/tracetool/format/simpletrace_stap.py b/scripts/traceto= ol/format/simpletrace_stap.py index c7bde97a85..eb58b4b959 100644 --- a/scripts/tracetool/format/simpletrace_stap.py +++ b/scripts/tracetool/format/simpletrace_stap.py @@ -4,6 +4,8 @@ Generate .stp file that outputs simpletrace binary traces (DTrace with Sys= temTAP only). """ =20 +from __future__ import annotations + __author__ =3D "Stefan Hajnoczi " __copyright__ =3D "Copyright (C) 2014, Red Hat, Inc." __license__ =3D "GPL version 2 or (at your option) any later version" diff --git a/scripts/tracetool/format/stap.py b/scripts/tracetool/format/st= ap.py index f917bd7545..808fb478b5 100644 --- a/scripts/tracetool/format/stap.py +++ b/scripts/tracetool/format/stap.py @@ -4,6 +4,8 @@ Generate .stp file (DTrace with SystemTAP only). """ =20 +from __future__ import annotations + __author__ =3D "Llu=C3=ADs Vilanova " __copyright__ =3D "Copyright 2012-2014, Llu=C3=ADs Vilanova " __license__ =3D "GPL version 2 or (at your option) any later version" diff --git a/scripts/tracetool/format/ust_events_c.py b/scripts/tracetool/f= ormat/ust_events_c.py index 074226bfd3..fa7d543798 100644 --- a/scripts/tracetool/format/ust_events_c.py +++ b/scripts/tracetool/format/ust_events_c.py @@ -4,6 +4,8 @@ trace/generated-ust.c """ =20 +from __future__ import annotations + __author__ =3D "Mohamad Gebai " __copyright__ =3D "Copyright 2012, Mohamad Gebai " __license__ =3D "GPL version 2 or (at your option) any later version" diff --git a/scripts/tracetool/format/ust_events_h.py b/scripts/tracetool/f= ormat/ust_events_h.py index cee7970a40..1057d02577 100644 --- a/scripts/tracetool/format/ust_events_h.py +++ b/scripts/tracetool/format/ust_events_h.py @@ -4,6 +4,8 @@ trace/generated-ust-provider.h """ =20 +from __future__ import annotations + __author__ =3D "Mohamad Gebai " __copyright__ =3D "Copyright 2012, Mohamad Gebai " __license__ =3D "GPL version 2 or (at your option) any later version" --=20 2.52.0 From nobody Sat Feb 7 08:53:19 2026 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=1768849779; cv=none; d=zohomail.com; s=zohoarc; b=Qg5PzUP1qkWkhf4zICuIE+GnxvKrX9ZBfTCrhZcWSCEwF4djUapkAjePPcHqj9vdTWS97lOHWkYBNK0XErwGQ2Y0xbdQ8TsS66XPg1ULTpoy1bjWcDvJ6jW6l4K7tXY4JIoZsnGW9atje1x4LqVzB+iCeWK1nbj9ewJ9iK9Mpeo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768849779; 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=D+Zs1MQT076hrWr8oPohlhJ/KZenoAoXSpTdwuz04yA=; b=jBEJ9HoSvu41HqC00FOCjoneMmsywbEr1a/T82r7m+Wjzxhv35GPVwmwTMvd5zkoLSF2VjLmA9hB28UnhYMmw2IxgbjHyVuLNElgU6SmNWSEP2V8IMo+UNmv8KTQVXI54HWrmWftHklQ2vjzubTMRl7coeLcqcc5/GpuhWYTAvg= 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 1768849779533819.8433407558122; Mon, 19 Jan 2026 11:09:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vhucM-0002DK-No; Mon, 19 Jan 2026 14:08:50 -0500 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 1vhucE-00027i-7J for qemu-devel@nongnu.org; Mon, 19 Jan 2026 14:08:43 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vhucA-0000ux-If for qemu-devel@nongnu.org; Mon, 19 Jan 2026 14:08:41 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-33-R9fBAaTRNn2rsdUgqGtSmw-1; Mon, 19 Jan 2026 14:08:34 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 55E9819560A1; Mon, 19 Jan 2026 19:08:33 +0000 (UTC) Received: from localhost (unknown [10.2.16.150]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EFFF8180049F; Mon, 19 Jan 2026 19:08:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768849717; 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=D+Zs1MQT076hrWr8oPohlhJ/KZenoAoXSpTdwuz04yA=; b=YO+H4B9FXVi6nRLmloI3PzYc0RuyLAWtBziPcK/HaFhZGHmeBbd26321PTD2gse/v7lmu7 3C32pMZtupw4ZF98fXjf4WL/pADh2wAC7l7wYX+0DbJVOhOzqVBvrpevh8/mi4JJoTq1xQ LMKqYoJYcwN5NwvnLZI6rKjchM3eUO0= X-MC-Unique: R9fBAaTRNn2rsdUgqGtSmw-1 X-Mimecast-MFC-AGG-ID: R9fBAaTRNn2rsdUgqGtSmw_1768849713 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: Cleber Rosa , Stefan Hajnoczi , Mads Ynddal , Richard Henderson , John Snow , Paolo Bonzini Subject: [PULL 4/8] tracetool: add type annotations Date: Mon, 19 Jan 2026 14:08:19 -0500 Message-ID: <20260119190823.867761-5-stefanha@redhat.com> In-Reply-To: <20260119190823.867761-1-stefanha@redhat.com> References: <20260119190823.867761-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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 (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.129.124; envelope-from=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.016, 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_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: qemu development 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: 1768849782119154100 Content-Type: text/plain; charset="utf-8" From: Paolo Bonzini Created with a profiling-based tool, righttyper. I used this script: python -m righttyper --generate-stubs --no-sampling --overwrite -- ./tra= cetool.py --help find . -name "*.pyi" | while read fname; do merge-pyi --in-place -b bak.$fmt ${fname%i} $fname done for fmt in c h rs d log-stap simpletrace-stap stap ust-events-c ust-event= s-h; do find . -name '*.pyi*' | xargs rm python -m righttyper --generate-stubs --no-sampling --overwrite ./trace= tool.py \ --format=3D$fmt --backends=3Dust,simple,syslog,ftrace,dtrace,log --gr= oup=3Dtestsuite \ --binary=3Dqemu --probe-prefix=3Dqemu ../tests/tracetool/trace-events= outfile.$fmt find . -name "*.pyi" | while read fname; do merge-pyi --in-place -b bak.$fmt ${fname%i} $fname done done python -m isort $(find tracetool -name "*.py") Running the script took about 5 minutes. The errors were mostly due to misunderstanding the "try_import" function: tracetool/backend/__init__.py:83: error: Incompatible types in assignment= (expression has type Module, variable has type "tuple[bool, Module]") [as= signment] tracetool/backend/__init__.py:117: error: Incompatible types in assignmen= t (expression has type Module, variable has type "str") [assignment] tracetool/__init__.py:543: error: Incompatible return value type (got "tu= ple[bool, None]", expected "tuple[bool, Module]") [return-value] tracetool/format/__init__.py:60: error: Incompatible types in assignment = (expression has type Module, variable has type "tuple[bool, Module]") [ass= ignment] tracetool/format/__init__.py:85: error: Argument 2 to "try_import" has in= compatible type "str"; expected "None" [arg-type] tracetool/format/__init__.py:88: error: Module not callable [operator] On top of this I fixed a little weirdness, while leaving the unannotated functions unchanged. Being profiling-based, righttyper did not annotate anything not covered by the check-tracetool testsuite: - error cases - PRIxxx macros It also reported list[Never] for always-empty lists, which is incorrect. Righttyper also has a few limitations: it does not annotate nested functions (there were only four of them), or "*args" argument lists. These are fixed in the next patch. Signed-off-by: Paolo Bonzini Acked-by: Stefan Hajnoczi Message-ID: <20251008063546.376603-5-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi --- scripts/tracetool.py | 5 +- scripts/tracetool/__init__.py | 54 ++++++++++---------- scripts/tracetool/backend/__init__.py | 19 +++---- scripts/tracetool/backend/dtrace.py | 16 +++--- scripts/tracetool/backend/ftrace.py | 10 ++-- scripts/tracetool/backend/log.py | 10 ++-- scripts/tracetool/backend/simple.py | 16 +++--- scripts/tracetool/backend/syslog.py | 10 ++-- scripts/tracetool/backend/ust.py | 8 +-- scripts/tracetool/format/__init__.py | 7 +-- scripts/tracetool/format/c.py | 5 +- scripts/tracetool/format/d.py | 5 +- scripts/tracetool/format/h.py | 5 +- scripts/tracetool/format/log_stap.py | 7 +-- scripts/tracetool/format/rs.py | 5 +- scripts/tracetool/format/simpletrace_stap.py | 5 +- scripts/tracetool/format/stap.py | 7 +-- scripts/tracetool/format/ust_events_c.py | 5 +- scripts/tracetool/format/ust_events_h.py | 5 +- 19 files changed, 109 insertions(+), 95 deletions(-) diff --git a/scripts/tracetool.py b/scripts/tracetool.py index 390f1a371b..0688c9cf5f 100755 --- a/scripts/tracetool.py +++ b/scripts/tracetool.py @@ -16,6 +16,7 @@ =20 import getopt import sys +from typing import NoReturn =20 import tracetool.backend import tracetool.format @@ -23,7 +24,7 @@ =20 _SCRIPT =3D "" =20 -def error_opt(msg =3D None): +def error_opt(msg: str | None =3D None) -> NoReturn: if msg is not None: error_write("Error: " + msg + "\n") =20 @@ -58,7 +59,7 @@ def error_opt(msg =3D None): else: sys.exit(1) =20 -def main(args): +def main(args: list[str]) -> None: global _SCRIPT _SCRIPT =3D args[0] =20 diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py index 0316f3f852..f2692de477 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -17,13 +17,15 @@ import os import re import sys +from io import TextIOWrapper from pathlib import PurePath +from typing import Any, Iterator =20 import tracetool.backend import tracetool.format =20 =20 -def error_write(*lines): +def error_write(*lines) -> None: """Write a set of error lines.""" sys.stderr.writelines("\n".join(lines) + "\n") =20 @@ -48,7 +50,7 @@ def error(*lines): 'MAX': 'j', } =20 -def expand_format_string(c_fmt, prefix=3D""): +def expand_format_string(c_fmt: str, prefix: str=3D"") -> str: def pri_macro_to_fmt(pri_macro): assert pri_macro.startswith("PRI") fmt_type =3D pri_macro[3] # 'd', 'i', 'u', or 'x' @@ -80,12 +82,12 @@ def pri_macro_to_fmt(pri_macro): out_filename =3D '' out_fobj =3D sys.stdout =20 -def out_open(filename): +def out_open(filename: str) -> None: global out_filename, out_fobj out_filename =3D posix_relpath(filename) out_fobj =3D open(filename, 'wt') =20 -def out(*lines, **kwargs): +def out(*lines, **kwargs) -> None: """Write a set of output lines. =20 You can use kwargs as a shorthand for mapping variables when formattin= g all @@ -177,7 +179,7 @@ def out(*lines, **kwargs): "bool", } =20 -def validate_type(name): +def validate_type(name: str) -> None: bits =3D name.split(" ") for bit in bits: bit =3D re.sub(r"\*", "", bit) @@ -192,7 +194,7 @@ def validate_type(name): "other complex pointer types should be " "declared as 'void *'" % name) =20 -def c_type_to_rust(name): +def c_type_to_rust(name: str) -> str: ptr =3D False const =3D False name =3D name.rstrip() @@ -227,7 +229,7 @@ def c_type_to_rust(name): class Arguments: """Event arguments description.""" =20 - def __init__(self, args): + def __init__(self, args: list[tuple[str, str]]) -> None: """ Parameters ---------- @@ -242,7 +244,7 @@ def __init__(self, args): self._args.append(arg) =20 @staticmethod - def build(arg_str): + def build(arg_str: str) -> Arguments: """Build and Arguments instance from an argument string. =20 Parameters @@ -275,15 +277,15 @@ def __getitem__(self, index): else: return self._args[index] =20 - def __iter__(self): + def __iter__(self) -> Iterator[tuple[str, str]]: """Iterate over the (type, name) pairs.""" return iter(self._args) =20 - def __len__(self): + def __len__(self) -> int: """Number of arguments.""" return len(self._args) =20 - def __str__(self): + def __str__(self) -> str: """String suitable for declaring function arguments.""" def onearg(t, n): if t[-1] =3D=3D '*': @@ -300,11 +302,11 @@ def __repr__(self): """Evaluable string representation for this object.""" return "Arguments(\"%s\")" % str(self) =20 - def names(self): + def names(self) -> list[str]: """List of argument names.""" return [ name for _, name in self._args ] =20 - def types(self): + def types(self) -> list[str]: """List of argument types.""" return [ type_ for type_, _ in self._args ] =20 @@ -312,12 +314,12 @@ def casted(self): """List of argument names casted to their type.""" return ["(%s)%s" % (type_, name) for type_, name in self._args] =20 - def rust_decl_extern(self): + def rust_decl_extern(self) -> str: """Return a Rust argument list for an extern "C" function""" return ", ".join((f"_{name}: {c_type_to_rust(type_)}" for type_, name in self._args)) =20 - def rust_decl(self): + def rust_decl(self) -> str: """Return a Rust argument list for a tracepoint function""" def decl_type(type_): if type_ =3D=3D "const char *": @@ -327,7 +329,7 @@ def decl_type(type_): return ", ".join((f"_{name}: {decl_type(type_)}" for type_, name in self._args)) =20 - def rust_call_extern(self): + def rust_call_extern(self) -> str: """Return a Rust argument list for a call to an extern "C" functio= n""" def rust_cast(name, type_): if type_ =3D=3D "const char *": @@ -336,7 +338,7 @@ def rust_cast(name, type_): =20 return ", ".join((rust_cast(name, type_) for type_, name in self._= args)) =20 - def rust_call_varargs(self): + def rust_call_varargs(self) -> str: """Return a Rust argument list for a call to a C varargs function"= "" def rust_cast(name, type_): if type_ =3D=3D "const char *": @@ -379,7 +381,7 @@ class Event(object): =20 _VALID_PROPS =3D set(["disable"]) =20 - def __init__(self, name, props, fmt, args, lineno, filename): + def __init__(self, name: str, props: list[str], fmt: str, args: Argume= nts, lineno: int, filename: str) -> None: """ Parameters ---------- @@ -415,7 +417,7 @@ def __init__(self, name, props, fmt, args, lineno, file= name): =20 =20 @staticmethod - def build(line_str, lineno, filename): + def build(line_str: str, lineno: int, filename: str) -> Event: """Build an Event instance from a string. =20 Parameters @@ -457,7 +459,7 @@ def __repr__(self): # arguments with that format, hence the non-greedy version of it. _FMT =3D re.compile(r"(%[\d\.]*\w+|%.*?PRI\S+)") =20 - def formats(self): + def formats(self) -> list[str]: """List conversion specifiers in the argument print format string.= """ return self._FMT.findall(self.fmt) =20 @@ -468,13 +470,13 @@ def formats(self): QEMU_BACKEND_DSTATE =3D "TRACE_%(NAME)s_BACKEND_DSTATE" QEMU_EVENT =3D "_TRACE_%(NAME)s_EVENT" =20 - def api(self, fmt=3DNone): + def api(self, fmt: str|None=3DNone) -> str: if fmt is None: fmt =3D Event.QEMU_TRACE return fmt % {"name": self.name, "NAME": self.name.upper()} =20 =20 -def read_events(fobj, fname): +def read_events(fobj: TextIOWrapper, fname: str) -> list[Event]: """Generate the output for the given (format, backends) pair. =20 Parameters @@ -513,7 +515,7 @@ class TracetoolError (Exception): pass =20 =20 -def try_import(mod_name, attr_name=3DNone, attr_default=3DNone): +def try_import(mod_name: str, attr_name: str | None=3DNone, attr_default: = Any=3DNone) -> tuple[bool, Any]: """Try to import a module and get an attribute from it. =20 Parameters @@ -539,8 +541,8 @@ def try_import(mod_name, attr_name=3DNone, attr_default= =3DNone): return False, None =20 =20 -def generate(events, group, format, backends, - binary=3DNone, probe_prefix=3DNone): +def generate(events: list[Event], group: str, format: str, backends: list[= str], + binary: str|None=3DNone, probe_prefix: str|None=3DNone) -> No= ne: """Generate the output for the given (format, backends) pair. =20 Parameters @@ -580,7 +582,7 @@ def generate(events, group, format, backends, =20 tracetool.format.generate(events, format, backend, group) =20 -def posix_relpath(path, start=3DNone): +def posix_relpath(path: str, start: str|None=3DNone) -> str: try: path =3D os.path.relpath(path, start) except ValueError: diff --git a/scripts/tracetool/backend/__init__.py b/scripts/tracetool/back= end/__init__.py index 8cc9c82138..645e78ece0 100644 --- a/scripts/tracetool/backend/__init__.py +++ b/scripts/tracetool/backend/__init__.py @@ -60,11 +60,12 @@ =20 =20 import os +from typing import Any, Iterator =20 import tracetool =20 =20 -def get_list(only_public =3D False): +def get_list(only_public: bool =3D False) -> list[tuple[str, str]]: """Get a list of (name, description) pairs.""" res =3D [("nop", "Tracing disabled.")] modnames =3D [] @@ -93,7 +94,7 @@ def get_list(only_public =3D False): return res =20 =20 -def exists(name): +def exists(name: str) -> bool: """Return whether the given backend exists.""" if len(name) =3D=3D 0: return False @@ -104,7 +105,7 @@ def exists(name): =20 =20 class Wrapper: - def __init__(self, backends, format): + def __init__(self, backends: list[str], format: str) -> None: self._backends =3D [backend.replace("-", "_") for backend in backe= nds] self._format =3D format.replace("-", "_") self.check_trace_event_get_state =3D False @@ -115,13 +116,13 @@ def __init__(self, backends, format): check_trace_event_get_state =3D getattr(backend, "CHECK_TRACE_= EVENT_GET_STATE", False) self.check_trace_event_get_state =3D self.check_trace_event_ge= t_state or check_trace_event_get_state =20 - def backend_modules(self): + def backend_modules(self) -> Iterator[Any]: for backend in self._backends: module =3D tracetool.try_import("tracetool.backend." + backen= d)[1] if module is not None: yield module =20 - def _run_function(self, name, *args, check_trace_event_get_state=3DNon= e, **kwargs): + def _run_function(self, name: str, *args, check_trace_event_get_state:= bool | None=3DNone, **kwargs) -> None: for backend in self.backend_modules(): func =3D getattr(backend, name % self._format, None) if func is not None and \ @@ -129,14 +130,14 @@ def _run_function(self, name, *args, check_trace_even= t_get_state=3DNone, **kwargs) check_trace_event_get_state =3D=3D getattr(backend, 'CHEC= K_TRACE_EVENT_GET_STATE', False)): func(*args, **kwargs) =20 - def generate_begin(self, events, group): + def generate_begin(self, events: list[tracetool.Event], group: str) ->= None: self._run_function("generate_%s_begin", events, group) =20 - def generate(self, event, group, check_trace_event_get_state=3DNone): + def generate(self, event: tracetool.Event, group: str, check_trace_eve= nt_get_state: bool | None=3DNone) -> None: self._run_function("generate_%s", event, group, check_trace_event_= get_state=3Dcheck_trace_event_get_state) =20 - def generate_backend_dstate(self, event, group): + def generate_backend_dstate(self, event: tracetool.Event, group: str) = -> None: self._run_function("generate_%s_backend_dstate", event, group) =20 - def generate_end(self, events, group): + def generate_end(self, events: list[tracetool.Event], group: str) -> N= one: self._run_function("generate_%s_end", events, group) diff --git a/scripts/tracetool/backend/dtrace.py b/scripts/tracetool/backen= d/dtrace.py index c21a04c653..2ad607c551 100644 --- a/scripts/tracetool/backend/dtrace.py +++ b/scripts/tracetool/backend/dtrace.py @@ -14,28 +14,28 @@ __email__ =3D "stefanha@redhat.com" =20 =20 -from tracetool import out +from tracetool import Event, out =20 PUBLIC =3D True =20 =20 -PROBEPREFIX =3D None +PROBEPREFIX: str|None =3D None =20 -def probeprefix(): +def probeprefix() -> str: if PROBEPREFIX is None: raise ValueError("you must set PROBEPREFIX") return PROBEPREFIX =20 =20 -BINARY =3D None +BINARY: str|None =3D None =20 -def binary(): +def binary() -> str: if BINARY is None: raise ValueError("you must set BINARY") return BINARY =20 =20 -def generate_h_begin(events, group): +def generate_h_begin(events: list[Event], group: str) -> None: if group =3D=3D "root": header =3D "trace-dtrace-root.h" else: @@ -62,13 +62,13 @@ def generate_h_begin(events, group): '#endif', uppername=3De.name.upper()) =20 -def generate_h(event, group): +def generate_h(event: Event, group: str) -> None: out(' QEMU_%(uppername)s(%(argnames)s);', uppername=3Devent.name.upper(), argnames=3D", ".join(event.args.names())) =20 =20 -def generate_h_backend_dstate(event, group): +def generate_h_backend_dstate(event: Event, group: str) -> None: out(' QEMU_%(uppername)s_ENABLED() || \\', uppername=3Devent.name.upper()) =20 diff --git a/scripts/tracetool/backend/ftrace.py b/scripts/tracetool/backen= d/ftrace.py index 40bb323f5e..fa4a40d44a 100644 --- a/scripts/tracetool/backend/ftrace.py +++ b/scripts/tracetool/backend/ftrace.py @@ -14,18 +14,18 @@ __email__ =3D "stefanha@redhat.com" =20 =20 -from tracetool import expand_format_string, out +from tracetool import Event, expand_format_string, out =20 PUBLIC =3D True CHECK_TRACE_EVENT_GET_STATE =3D True =20 =20 -def generate_h_begin(events, group): +def generate_h_begin(events: list[Event], group: str) -> None: out('#include "trace/ftrace.h"', '') =20 =20 -def generate_h(event, group): +def generate_h(event: Event, group: str) -> None: argnames =3D ", ".join(event.args.names()) if len(event.args) > 0: argnames =3D ", " + argnames @@ -41,11 +41,11 @@ def generate_h(event, group): argnames=3Dargnames) =20 =20 -def generate_h_backend_dstate(event, group): +def generate_h_backend_dstate(event: Event, group: str) -> None: out(' trace_event_get_state_dynamic_by_id(%(event_id)s) || \\', event_id=3D"TRACE_" + event.name.upper()) =20 -def generate_rs(event, group): +def generate_rs(event: Event, group: str) -> None: out(' let format_string =3D c"%(fmt)s";', ' unsafe {bindings::ftrace_write(format_string.as_ptr() as = *const c_char, %(args)s);}', fmt=3Dexpand_format_string(event.fmt), diff --git a/scripts/tracetool/backend/log.py b/scripts/tracetool/backend/l= og.py index d346a19e40..39d777218b 100644 --- a/scripts/tracetool/backend/log.py +++ b/scripts/tracetool/backend/log.py @@ -14,18 +14,18 @@ __email__ =3D "stefanha@redhat.com" =20 =20 -from tracetool import expand_format_string, out +from tracetool import Event, expand_format_string, out =20 PUBLIC =3D True CHECK_TRACE_EVENT_GET_STATE =3D True =20 =20 -def generate_h_begin(events, group): +def generate_h_begin(events: list[Event], group: str) -> None: out('#include "qemu/log-for-trace.h"', '') =20 =20 -def generate_h(event, group): +def generate_h(event: Event, group: str) -> None: argnames =3D ", ".join(event.args.names()) if len(event.args) > 0: argnames =3D ", " + argnames @@ -42,11 +42,11 @@ def generate_h(event, group): argnames=3Dargnames) =20 =20 -def generate_h_backend_dstate(event, group): +def generate_h_backend_dstate(event: Event, group: str) -> None: out(' trace_event_get_state_dynamic_by_id(%(event_id)s) || \\', event_id=3D"TRACE_" + event.name.upper()) =20 -def generate_rs(event, group): +def generate_rs(event: Event, group: str) -> None: out(' let format_string =3D c"%(fmt)s\\n";', ' if (unsafe { bindings::qemu_loglevel } & bindings::LOG_TR= ACE) !=3D 0 {', ' unsafe { bindings::qemu_log(format_string.as_ptr() as= *const c_char, %(args)s);}', diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/backen= d/simple.py index 9c691dc231..519f7a09e5 100644 --- a/scripts/tracetool/backend/simple.py +++ b/scripts/tracetool/backend/simple.py @@ -14,13 +14,13 @@ __email__ =3D "stefanha@redhat.com" =20 =20 -from tracetool import out +from tracetool import Event, out =20 PUBLIC =3D True CHECK_TRACE_EVENT_GET_STATE =3D True =20 =20 -def is_string(arg): +def is_string(arg: str) -> bool: strtype =3D ('const char*', 'char*', 'const char *', 'char *') arg_strip =3D arg.lstrip() if arg_strip.startswith(strtype) and arg_strip.count('*') =3D=3D 1: @@ -29,7 +29,7 @@ def is_string(arg): return False =20 =20 -def generate_h_begin(events, group): +def generate_h_begin(events: list[Event], group: str) -> None: for event in events: out('void _simple_%(api)s(%(args)s);', api=3Devent.api(), @@ -37,25 +37,25 @@ def generate_h_begin(events, group): out('') =20 =20 -def generate_h(event, group): +def generate_h(event: Event, group: str) -> None: out(' _simple_%(api)s(%(args)s);', api=3Devent.api(), args=3D", ".join(event.args.names())) =20 =20 -def generate_h_backend_dstate(event, group): +def generate_h_backend_dstate(event: Event, group: str) -> None: out(' trace_event_get_state_dynamic_by_id(%(event_id)s) || \\', event_id=3D"TRACE_" + event.name.upper()) =20 =20 -def generate_c_begin(events, group): +def generate_c_begin(events: list[Event], group: str) -> None: out('#include "qemu/osdep.h"', '#include "trace/control.h"', '#include "trace/simple.h"', '') =20 =20 -def generate_c(event, group): +def generate_c(event: Event, group: str) -> None: out('void _simple_%(api)s(%(args)s)', '{', ' TraceBufferRecord rec;', @@ -100,7 +100,7 @@ def generate_c(event, group): '}', '') =20 -def generate_rs(event, group): +def generate_rs(event: Event, group: str) -> None: out(' extern "C" { fn _simple_%(api)s(%(rust_args)s); }', ' unsafe { _simple_%(api)s(%(args)s); }', api=3Devent.api(), diff --git a/scripts/tracetool/backend/syslog.py b/scripts/tracetool/backen= d/syslog.py index 9311453c5a..dd39df6af6 100644 --- a/scripts/tracetool/backend/syslog.py +++ b/scripts/tracetool/backend/syslog.py @@ -14,18 +14,18 @@ __email__ =3D "stefanha@redhat.com" =20 =20 -from tracetool import expand_format_string, out +from tracetool import Event, expand_format_string, out =20 PUBLIC =3D True CHECK_TRACE_EVENT_GET_STATE =3D True =20 =20 -def generate_h_begin(events, group): +def generate_h_begin(events: list[Event], group: str) -> None: out('#include ', '') =20 =20 -def generate_h(event, group): +def generate_h(event: Event, group: str) -> None: argnames =3D ", ".join(event.args.names()) if len(event.args) > 0: argnames =3D ", " + argnames @@ -39,12 +39,12 @@ def generate_h(event, group): fmt=3Devent.fmt.rstrip("\n"), argnames=3Dargnames) =20 -def generate_rs(event, group): +def generate_rs(event: Event, group: str) -> None: out(' let format_string =3D c"%(fmt)s";', ' unsafe {::trace::syslog(::trace::LOG_INFO, format_string.= as_ptr() as *const c_char, %(args)s);}', fmt=3Dexpand_format_string(event.fmt), args=3Devent.args.rust_call_varargs()) =20 -def generate_h_backend_dstate(event, group): +def generate_h_backend_dstate(event: Event, group: str) -> None: out(' trace_event_get_state_dynamic_by_id(%(event_id)s) || \\', event_id=3D"TRACE_" + event.name.upper()) diff --git a/scripts/tracetool/backend/ust.py b/scripts/tracetool/backend/u= st.py index f227072512..a26cd7ace6 100644 --- a/scripts/tracetool/backend/ust.py +++ b/scripts/tracetool/backend/ust.py @@ -14,12 +14,12 @@ __email__ =3D "stefanha@redhat.com" =20 =20 -from tracetool import out +from tracetool import Event, out =20 PUBLIC =3D True =20 =20 -def generate_h_begin(events, group): +def generate_h_begin(events: list[Event], group: str) -> None: header =3D 'trace-ust-' + group + '.h' out('#include ', '#include "%s"' % header, @@ -31,7 +31,7 @@ def generate_h_begin(events, group): '') =20 =20 -def generate_h(event, group): +def generate_h(event: Event, group: str) -> None: argnames =3D ", ".join(event.args.names()) if len(event.args) > 0: argnames =3D ", " + argnames @@ -41,6 +41,6 @@ def generate_h(event, group): tp_args=3Dargnames) =20 =20 -def generate_h_backend_dstate(event, group): +def generate_h_backend_dstate(event: Event, group: str) -> None: out(' tracepoint_enabled(qemu, %(name)s) || \\', name=3Devent.name) diff --git a/scripts/tracetool/format/__init__.py b/scripts/tracetool/forma= t/__init__.py index 4c606d5757..c287e93ed3 100644 --- a/scripts/tracetool/format/__init__.py +++ b/scripts/tracetool/format/__init__.py @@ -40,9 +40,10 @@ import os =20 import tracetool +from tracetool.backend import Wrapper =20 =20 -def get_list(): +def get_list() -> list[tuple[str, str]]: """Get a list of (name, description) pairs.""" res =3D [] modnames =3D [] @@ -67,7 +68,7 @@ def get_list(): return res =20 =20 -def exists(name): +def exists(name: str) -> bool: """Return whether the given format exists.""" if len(name) =3D=3D 0: return False @@ -75,7 +76,7 @@ def exists(name): return tracetool.try_import("tracetool.format." + name)[0] =20 =20 -def generate(events, format, backend, group): +def generate(events: list[tracetool.Event], format: str, backend: Wrapper,= group: str) -> None: if not exists(format): raise ValueError("unknown format: %s" % format) format =3D format.replace("-", "_") diff --git a/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py index 5b3459f2be..e8848c5105 100644 --- a/scripts/tracetool/format/c.py +++ b/scripts/tracetool/format/c.py @@ -14,10 +14,11 @@ __email__ =3D "stefanha@redhat.com" =20 =20 -from tracetool import out +from tracetool import Event, out +from tracetool.backend import Wrapper =20 =20 -def generate(events, backend, group): +def generate(events: list[Event], backend: Wrapper, group: str) -> None: active_events =3D [e for e in events if "disable" not in e.properties] =20 diff --git a/scripts/tracetool/format/d.py b/scripts/tracetool/format/d.py index dda80eeb76..2abf8bc24b 100644 --- a/scripts/tracetool/format/d.py +++ b/scripts/tracetool/format/d.py @@ -16,7 +16,8 @@ =20 from sys import platform =20 -from tracetool import out +from tracetool import Event, out +from tracetool.backend import Wrapper =20 # Reserved keywords from # https://wikis.oracle.com/display/DTrace/Types,+Operators+and+Expressions @@ -31,7 +32,7 @@ ) =20 =20 -def generate(events, backend, group): +def generate(events: list[Event], backend: Wrapper, group: str) -> None: events =3D [e for e in events if "disable" not in e.properties] =20 diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index d04cabc63e..2324234dd2 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -14,10 +14,11 @@ __email__ =3D "stefanha@redhat.com" =20 =20 -from tracetool import out +from tracetool import Event, out +from tracetool.backend import Wrapper =20 =20 -def generate(events, backend, group): +def generate(events: list[Event], backend: Wrapper, group: str) -> None: header =3D "trace/control.h" =20 out('/* This file is autogenerated by tracetool, do not edit. */', diff --git a/scripts/tracetool/format/log_stap.py b/scripts/tracetool/forma= t/log_stap.py index 6551444203..d7ad0bb6a7 100644 --- a/scripts/tracetool/format/log_stap.py +++ b/scripts/tracetool/format/log_stap.py @@ -15,7 +15,8 @@ =20 import re =20 -from tracetool import out +from tracetool import Event, out +from tracetool.backend import Wrapper from tracetool.backend.dtrace import binary, probeprefix from tracetool.backend.simple import is_string from tracetool.format.stap import stap_escape @@ -30,7 +31,7 @@ def c_macro_to_format(macro): =20 raise Exception("Unhandled macro '%s'" % macro) =20 -def c_fmt_to_stap(fmt): +def c_fmt_to_stap(fmt: str) -> str: state =3D 0 bits =3D [] literal =3D "" @@ -85,7 +86,7 @@ def c_fmt_to_stap(fmt): fmt =3D re.sub(r"%(\d*)(l+|z)(x|u|d)", r"%\1\3", "".join(bits)) return fmt =20 -def generate(events, backend, group): +def generate(events: list[Event], backend: Wrapper, group: str) -> None: out('/* This file is autogenerated by tracetool, do not edit. */', '/* SPDX-License-Identifier: GPL-2.0-or-later */', '') diff --git a/scripts/tracetool/format/rs.py b/scripts/tracetool/format/rs.py index 1dc43a3b34..41e4636d97 100644 --- a/scripts/tracetool/format/rs.py +++ b/scripts/tracetool/format/rs.py @@ -14,10 +14,11 @@ __email__ =3D "stefanha@redhat.com" =20 =20 -from tracetool import out +from tracetool import Event, out +from tracetool.backend import Wrapper =20 =20 -def generate(events, backend, group): +def generate(events: list[Event], backend: Wrapper, group: str) -> None: out('// SPDX-License-Identifier: GPL-2.0-or-later', '// This file is @generated by tracetool, do not edit.', '', diff --git a/scripts/tracetool/format/simpletrace_stap.py b/scripts/traceto= ol/format/simpletrace_stap.py index eb58b4b959..c76cf42685 100644 --- a/scripts/tracetool/format/simpletrace_stap.py +++ b/scripts/tracetool/format/simpletrace_stap.py @@ -14,13 +14,14 @@ __email__ =3D "stefanha@redhat.com" =20 =20 -from tracetool import out +from tracetool import Event, out +from tracetool.backend import Wrapper from tracetool.backend.dtrace import probeprefix from tracetool.backend.simple import is_string from tracetool.format.stap import stap_escape =20 =20 -def generate(events, backend, group): +def generate(events: list[Event], backend: Wrapper, group: str) -> None: out('/* This file is autogenerated by tracetool, do not edit. */', '/* SPDX-License-Identifier: GPL-2.0-or-later */', '') diff --git a/scripts/tracetool/format/stap.py b/scripts/tracetool/format/st= ap.py index 808fb478b5..af98f3c44a 100644 --- a/scripts/tracetool/format/stap.py +++ b/scripts/tracetool/format/stap.py @@ -14,7 +14,8 @@ __email__ =3D "stefanha@redhat.com" =20 =20 -from tracetool import out +from tracetool import Event, out +from tracetool.backend import Wrapper from tracetool.backend.dtrace import binary, probeprefix =20 # Technically 'self' is not used by systemtap yet, but @@ -27,14 +28,14 @@ ) =20 =20 -def stap_escape(identifier): +def stap_escape(identifier: str) -> str: # Append underscore to reserved keywords if identifier in RESERVED_WORDS: return identifier + '_' return identifier =20 =20 -def generate(events, backend, group): +def generate(events: list[Event], backend: Wrapper, group: str) -> None: events =3D [e for e in events if "disable" not in e.properties] =20 diff --git a/scripts/tracetool/format/ust_events_c.py b/scripts/tracetool/f= ormat/ust_events_c.py index fa7d543798..2c8256ed7a 100644 --- a/scripts/tracetool/format/ust_events_c.py +++ b/scripts/tracetool/format/ust_events_c.py @@ -14,10 +14,11 @@ __email__ =3D "stefanha@redhat.com" =20 =20 -from tracetool import out +from tracetool import Event, out +from tracetool.backend import Wrapper =20 =20 -def generate(events, backend, group): +def generate(events: list[Event], backend: Wrapper, group: str) -> None: events =3D [e for e in events if "disabled" not in e.properties] =20 diff --git a/scripts/tracetool/format/ust_events_h.py b/scripts/tracetool/f= ormat/ust_events_h.py index 1057d02577..f0ffcae694 100644 --- a/scripts/tracetool/format/ust_events_h.py +++ b/scripts/tracetool/format/ust_events_h.py @@ -14,10 +14,11 @@ __email__ =3D "stefanha@redhat.com" =20 =20 -from tracetool import out +from tracetool import Event, out +from tracetool.backend import Wrapper =20 =20 -def generate(events, backend, group): +def generate(events: list[Event], backend: Wrapper, group: str) -> None: events =3D [e for e in events if "disabled" not in e.properties] =20 --=20 2.52.0 From nobody Sat Feb 7 08:53:19 2026 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=1768849780; cv=none; d=zohomail.com; s=zohoarc; b=kmCXZLj00JtQ73oSL85YdyimliPwF01Ej2xA6thnZ48cSG1kEDn5nuFH2IJnvUqfRV1pzQjfjn0Ys7BXt4CzmSmixJb4SI5Bu1lL8xp/2l+ZMoBA9jyhg6jiTApzvklQoQZGO8IABJJP9RcD2XT5Z/Dr0iiC8/rUAGUqyfTidbI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768849780; 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=nYAdUCpNPly738H4K/k4k18nVcwI9iuT+Hc0aUcbLTA=; b=S6IzgmLhabVdmBhQykg+fyc//wkumEF8flBI6c1G26zpb/PKjtVsDOEJmE2pWJFAMAmK+6Eq0QqClNsCe3J4LQruShFziDv9n0fBC+ZcAqOqDO5h/Y/c0zdxcj1sXO4Sc7xpJbJEctlktIUE2F5LmTQvLXYZja6JjajPOYAe5wc= 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 1768849780738452.15691335909605; Mon, 19 Jan 2026 11:09:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vhucM-0002DL-NS; Mon, 19 Jan 2026 14:08:50 -0500 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 1vhucF-00028g-JC for qemu-devel@nongnu.org; Mon, 19 Jan 2026 14:08:43 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vhucD-0000v9-AA for qemu-devel@nongnu.org; Mon, 19 Jan 2026 14:08:43 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-159-cLW-OONFMEaRNOkOkZ7C3A-1; Mon, 19 Jan 2026 14:08:36 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0E1E01954B17; Mon, 19 Jan 2026 19:08:35 +0000 (UTC) Received: from localhost (unknown [10.2.16.150]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 979B319560AB; Mon, 19 Jan 2026 19:08:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768849720; 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=nYAdUCpNPly738H4K/k4k18nVcwI9iuT+Hc0aUcbLTA=; b=EnTKgf2eO6E6LkAl+BPf3mREtAbS6f3nFSl/myKIQcbqqtulI2ahsSxYvCcgMqGskVZV87 I/KoyCtOgQM151TnbIhWID/Va4XRYcxmjrO8DSrpFtVFJVSVsfFFJSbSGT16tioW4hGYct 3Vi/lRJw8MlgXCIITDnkBLN2ujmavdo= X-MC-Unique: cLW-OONFMEaRNOkOkZ7C3A-1 X-Mimecast-MFC-AGG-ID: cLW-OONFMEaRNOkOkZ7C3A_1768849715 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: Cleber Rosa , Stefan Hajnoczi , Mads Ynddal , Richard Henderson , John Snow , Paolo Bonzini Subject: [PULL 5/8] tracetool: complete typing annotations Date: Mon, 19 Jan 2026 14:08:20 -0500 Message-ID: <20260119190823.867761-6-stefanha@redhat.com> In-Reply-To: <20260119190823.867761-1-stefanha@redhat.com> References: <20260119190823.867761-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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 (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.129.124; envelope-from=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.016, 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_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: qemu development 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: 1768849782801158500 Content-Type: text/plain; charset="utf-8" From: Paolo Bonzini Add more annotations so that "mypy --strict". These have to be done manually due to limitations of RightTyper. Signed-off-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Message-ID: <20251008063546.376603-6-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi --- scripts/tracetool/__init__.py | 30 +++++++++++++-------------- scripts/tracetool/backend/__init__.py | 2 +- scripts/tracetool/format/log_stap.py | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py index f2692de477..e191201819 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -19,17 +19,17 @@ import sys from io import TextIOWrapper from pathlib import PurePath -from typing import Any, Iterator +from typing import Any, Iterator, Sequence =20 import tracetool.backend import tracetool.format =20 =20 -def error_write(*lines) -> None: +def error_write(*lines: str) -> None: """Write a set of error lines.""" sys.stderr.writelines("\n".join(lines) + "\n") =20 -def error(*lines): +def error(*lines: str) -> None: """Write a set of error lines and exit.""" error_write(*lines) sys.exit(1) @@ -51,7 +51,7 @@ def error(*lines): } =20 def expand_format_string(c_fmt: str, prefix: str=3D"") -> str: - def pri_macro_to_fmt(pri_macro): + def pri_macro_to_fmt(pri_macro: str) -> str: assert pri_macro.startswith("PRI") fmt_type =3D pri_macro[3] # 'd', 'i', 'u', or 'x' fmt_size =3D pri_macro[4:] # '8', '16', '32', '64', 'PTR', 'MAX' @@ -87,7 +87,7 @@ def out_open(filename: str) -> None: out_filename =3D posix_relpath(filename) out_fobj =3D open(filename, 'wt') =20 -def out(*lines, **kwargs) -> None: +def out(*lines: str, **kwargs: Any) -> None: """Write a set of output lines. =20 You can use kwargs as a shorthand for mapping variables when formattin= g all @@ -229,14 +229,14 @@ def c_type_to_rust(name: str) -> str: class Arguments: """Event arguments description.""" =20 - def __init__(self, args: list[tuple[str, str]]) -> None: + def __init__(self, args: Sequence[tuple[str, str] | Arguments]) -> Non= e: """ Parameters ---------- args : List of (type, name) tuples or Arguments objects. """ - self._args =3D [] + self._args: list[tuple[str, str]] =3D [] for arg in args: if isinstance(arg, Arguments): self._args.extend(arg._args) @@ -271,7 +271,7 @@ def build(arg_str: str) -> Arguments: res.append((arg_type, identifier)) return Arguments(res) =20 - def __getitem__(self, index): + def __getitem__(self, index: int | slice) -> Arguments | tuple[str, st= r]: if isinstance(index, slice): return Arguments(self._args[index]) else: @@ -287,7 +287,7 @@ def __len__(self) -> int: =20 def __str__(self) -> str: """String suitable for declaring function arguments.""" - def onearg(t, n): + def onearg(t: str, n: str) -> str: if t[-1] =3D=3D '*': return "".join([t, n]) else: @@ -298,7 +298,7 @@ def onearg(t, n): else: return ", ".join([ onearg(t, n) for t,n in self._args ]) =20 - def __repr__(self): + def __repr__(self) -> str: """Evaluable string representation for this object.""" return "Arguments(\"%s\")" % str(self) =20 @@ -310,7 +310,7 @@ def types(self) -> list[str]: """List of argument types.""" return [ type_ for type_, _ in self._args ] =20 - def casted(self): + def casted(self) -> list[str]: """List of argument names casted to their type.""" return ["(%s)%s" % (type_, name) for type_, name in self._args] =20 @@ -321,7 +321,7 @@ def rust_decl_extern(self) -> str: =20 def rust_decl(self) -> str: """Return a Rust argument list for a tracepoint function""" - def decl_type(type_): + def decl_type(type_: str) -> str: if type_ =3D=3D "const char *": return "&std::ffi::CStr" return c_type_to_rust(type_) @@ -331,7 +331,7 @@ def decl_type(type_): =20 def rust_call_extern(self) -> str: """Return a Rust argument list for a call to an extern "C" functio= n""" - def rust_cast(name, type_): + def rust_cast(name: str, type_: str) -> str: if type_ =3D=3D "const char *": return f"_{name}.as_ptr()" return f"_{name}" @@ -340,7 +340,7 @@ def rust_cast(name, type_): =20 def rust_call_varargs(self) -> str: """Return a Rust argument list for a call to a C varargs function"= "" - def rust_cast(name, type_): + def rust_cast(name: str, type_: str) -> str: if type_ =3D=3D "const char *": return f"_{name}.as_ptr()" =20 @@ -449,7 +449,7 @@ def build(line_str: str, lineno: int, filename: str) ->= Event: =20 return Event(name, props, fmt, args, lineno, posix_relpath(filenam= e)) =20 - def __repr__(self): + def __repr__(self) -> str: """Evaluable string representation for this object.""" return "Event('%s %s(%s) %s')" % (" ".join(self.properties), self.name, diff --git a/scripts/tracetool/backend/__init__.py b/scripts/tracetool/back= end/__init__.py index 645e78ece0..84bab3f42a 100644 --- a/scripts/tracetool/backend/__init__.py +++ b/scripts/tracetool/backend/__init__.py @@ -122,7 +122,7 @@ def backend_modules(self) -> Iterator[Any]: if module is not None: yield module =20 - def _run_function(self, name: str, *args, check_trace_event_get_state:= bool | None=3DNone, **kwargs) -> None: + def _run_function(self, name: str, *args: Any, check_trace_event_get_s= tate: bool | None=3DNone, **kwargs: Any) -> None: for backend in self.backend_modules(): func =3D getattr(backend, name % self._format, None) if func is not None and \ diff --git a/scripts/tracetool/format/log_stap.py b/scripts/tracetool/forma= t/log_stap.py index d7ad0bb6a7..914e4674ff 100644 --- a/scripts/tracetool/format/log_stap.py +++ b/scripts/tracetool/format/log_stap.py @@ -25,7 +25,7 @@ STATE_LITERAL =3D 1 STATE_MACRO =3D 2 =20 -def c_macro_to_format(macro): +def c_macro_to_format(macro: str) -> str: if macro.startswith("PRI"): return macro[3] =20 --=20 2.52.0 From nobody Sat Feb 7 08:53:19 2026 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=1768849784; cv=none; d=zohomail.com; s=zohoarc; b=XF7MmZ8UZN0isHhtAmaC0pPQU38twfxSdUdTqTrlbmnayHxtNlBspUcxRzm6oSBKQclrovqtoJSMb0/fYUWJ0v7s8Hsv0r3p4YyzjL3VwkntMWxQaWke1unIwLUZPyWCZLphXUGF/mDfmIxln5PHGGIK7rcR9gRObsVNr+cy+Ek= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768849784; h=Content-Type: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=S2/WlujMto/hk2nifTo+9BC2Qnqjdyyht0QRwsoIpAE=; b=Sc/a73oN0/+qtxxoJd1nUd072sZqZJb8tCN0GnzTs9n1EpNrTJZu+7clPant3JdmL/f0sHzMSVHBEfwtQmPhpPXdRnkxYHgBY4q8r6XsMvNvFHv0cw3q7yDT3YwYsE2pxZ0ccHznimPWS4YApWjvopKjCblNvSS62v/FfuyYQ2Y= 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 1768849784619939.504024505321; Mon, 19 Jan 2026 11:09:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vhucM-0002D1-Fu; Mon, 19 Jan 2026 14:08:50 -0500 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 1vhucE-00027h-6v for qemu-devel@nongnu.org; Mon, 19 Jan 2026 14:08:43 -0500 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 1vhucC-0000v5-GI for qemu-devel@nongnu.org; Mon, 19 Jan 2026 14:08:41 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-664-28YYAGWmNCCPctL_Izjmxg-1; Mon, 19 Jan 2026 14:08:37 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A84F119560B5; Mon, 19 Jan 2026 19:08:36 +0000 (UTC) Received: from localhost (unknown [10.2.16.150]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 41DDC180049F; Mon, 19 Jan 2026 19:08:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768849719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S2/WlujMto/hk2nifTo+9BC2Qnqjdyyht0QRwsoIpAE=; b=PwtVLPqr6hMLUvuDUAg9zazHiMeA0pWWWsaQ2+LSUzcPkGqhRF8wG4/DPsbXrmHIRjf/MF i9supLQNczlGve9FHOxVOwr3MU4XScmvb5Nx+qiX9kSANY3oW83vjJcwnem8bl80e44/0W OzgQOdx8YtbksqX/vHQgv7+trpToLRw= X-MC-Unique: 28YYAGWmNCCPctL_Izjmxg-1 X-Mimecast-MFC-AGG-ID: 28YYAGWmNCCPctL_Izjmxg_1768849716 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: Cleber Rosa , Stefan Hajnoczi , Mads Ynddal , Richard Henderson , John Snow , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 6/8] tracetool: add typing checks to "make -C python check" Date: Mon, 19 Jan 2026 14:08:21 -0500 Message-ID: <20260119190823.867761-7-stefanha@redhat.com> In-Reply-To: <20260119190823.867761-1-stefanha@redhat.com> References: <20260119190823.867761-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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 (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=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.016, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: qemu development 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: 1768849786039154100 From: Paolo Bonzini Signed-off-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrang=C3=A9 Message-ID: <20251008063546.376603-7-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi --- python/tests/tracetool-mypy.sh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 python/tests/tracetool-mypy.sh diff --git a/python/tests/tracetool-mypy.sh b/python/tests/tracetool-mypy.sh new file mode 100755 index 0000000000..7b4011e52d --- /dev/null +++ b/python/tests/tracetool-mypy.sh @@ -0,0 +1,5 @@ +#!/bin/sh -e +# SPDX-License-Identifier: GPL-2.0-or-later + +cd ../scripts +python3 -m mypy --strict tracetool --=20 2.52.0 From nobody Sat Feb 7 08:53:19 2026 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=1768849765; cv=none; d=zohomail.com; s=zohoarc; b=RvPva7GoY533tr/miTzt+iWO61x+50ly555GwvjSvBv5Py7VPhOlIt7HCxGmu+Wq8cuGVxZ6NRruODUx7ukzWPhd7zNTevXPma6campCn02hkwT8tNYNZTGogHPzGhuTh05sAXDdNJ37rjdmSOJTNrCemtwd8/UxyF2ZAEY0ABw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768849765; 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=xnnVxcxJSgyRHmA2GeMtGwFRqrJfAtlH4GWWSt0T7Tk=; b=BkQGld8hj9EDoBAhbFjqZgvt15wItzP422tWhnlC+tvTHv8xMOtw8RCgHaW0llCMLMHrxdkdAal5TRys5K3jke0rfqQzsrjQj3WvkMR3DdblQJW++n1XSLTWy6bMK0hy91S5W30xSrwJFNWm1Db2A7Jabw5lG7bndZcP7MpjWS0= 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 1768849765552809.6997095457613; Mon, 19 Jan 2026 11:09:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vhucL-0002CY-VQ; Mon, 19 Jan 2026 14:08:49 -0500 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 1vhucF-00027p-CN for qemu-devel@nongnu.org; Mon, 19 Jan 2026 14:08:43 -0500 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 1vhucD-0000vD-Jw for qemu-devel@nongnu.org; Mon, 19 Jan 2026 14:08:43 -0500 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-312-ALDLg4QzM1WeTzONTUu6xA-1; Mon, 19 Jan 2026 14:08:39 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 6A3571800447; Mon, 19 Jan 2026 19:08:38 +0000 (UTC) Received: from localhost (unknown [10.2.16.150]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CBA8C1800993; Mon, 19 Jan 2026 19:08:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768849720; 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=xnnVxcxJSgyRHmA2GeMtGwFRqrJfAtlH4GWWSt0T7Tk=; b=Nc11fB1MEFUNQKiHqfoLfnJUheHMQnA442USLSVO/peHtvcnUmHylT/50HkoxXyuORcTgP MyJhMAjlgprBjXJVzrtNLZO3bZQGtYBc4c0Ls6+HlRqbdU8jfgn03UWDx35s1Kxw9ejnFw Rx2tTLk5Jb+dAQOGS6oVsk9iUKy4qQA= X-MC-Unique: ALDLg4QzM1WeTzONTUu6xA-1 X-Mimecast-MFC-AGG-ID: ALDLg4QzM1WeTzONTUu6xA_1768849718 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: Cleber Rosa , Stefan Hajnoczi , Mads Ynddal , Richard Henderson , John Snow Subject: [PULL 7/8] tracetool-test: add QEMU_TEST_KEEP_SCRATCH=1 support Date: Mon, 19 Jan 2026 14:08:22 -0500 Message-ID: <20260119190823.867761-8-stefanha@redhat.com> In-Reply-To: <20260119190823.867761-1-stefanha@redhat.com> References: <20260119190823.867761-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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 (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=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.016, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: qemu development 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: 1768849766613158500 Content-Type: text/plain; charset="utf-8" It can be useful to preserve the temporary files generated by the test for manual inspection or diffing against expected output. Signed-off-by: Stefan Hajnoczi Message-id: 20251118183915.177192-1-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- tests/tracetool/tracetool-test.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/tests/tracetool/tracetool-test.py b/tests/tracetool/tracetool-= test.py index 30006a9919..10e362a407 100755 --- a/tests/tracetool/tracetool-test.py +++ b/tests/tracetool/tracetool-test.py @@ -9,6 +9,9 @@ import tempfile =20 =20 +DELETE_TEMPFILE =3D not os.getenv("QEMU_TEST_KEEP_SCRATCH", False) + + def get_formats(backend): formats =3D [ "c", @@ -49,7 +52,8 @@ def test_tracetool_one(tracetool, backend, fmt, src_dir, = build_dir): check_call(args, cwd=3Dbuild_dir) actual =3D actual_file.read_text() finally: - actual_file.unlink() + if DELETE_TEMPFILE: + actual_file.unlink() =20 if os.getenv("QEMU_TEST_REGENERATE", False): print(f"# regenerate {expect_file}") @@ -84,14 +88,25 @@ def test_tracetool(tracetool, backend, source_dir, buil= d_dir): except Exception as e: print(f"# {e}") fail =3D True + + if DELETE_TEMPFILE: + tempfile_hint =3D ( + "QEMU_TEST_KEEP_SCRATCH=3D1 to preserve test outpu= t " + + "files" + ) + else: + tempfile_hint =3D f"check test output files in {build_= dir}" + hint =3D ( " (set QEMU_TEST_REGENERATE=3D1 to recreate reference " - + "output if tracetool generator was intentionally cha= nged)" + + "output if tracetool generator was intentionally " + + "changed or " + tempfile_hint + ")" ) finally: print(f"{status} {num} - {backend}.{fmt}{hint}") finally: - build_events.unlink() + if DELETE_TEMPFILE: + build_events.unlink() =20 return fail =20 @@ -102,7 +117,8 @@ def test_tracetool(tracetool, backend, source_dir, buil= d_dir): print("syntax: {argv0} TRACE-TOOL BACKEND SRC-DIR BUILD-DIR", file= =3Dsys.stderr) sys.exit(1) =20 - with tempfile.TemporaryDirectory(prefix=3Dsys.argv[4]) as tmpdir: + with tempfile.TemporaryDirectory(prefix=3Dsys.argv[4], + delete=3DDELETE_TEMPFILE) as tmpdir: fail =3D test_tracetool(sys.argv[1], sys.argv[2], sys.argv[3], tmp= dir) if fail: sys.exit(1) --=20 2.52.0 From nobody Sat Feb 7 08:53:19 2026 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=1768849760; cv=none; d=zohomail.com; s=zohoarc; b=DapEOEbeQ52cc6GDqBap3TtMVsnrx8UdhkzoZwmz+9DwIIh/vnVT29Oa8MB1b9HIqEUnKz6aMJnpqOLAWSm9LX9F8prVFjPE2TtO4TRVCPgCEs8FPQZmq6ZS4uGaBEXZB5vPd61hXujPJUGZOA5+IcalCZ5Lvq/xWjGaOswgjX8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768849760; h=Content-Type: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=XwZfVhIWIVz+4atlC56uUtVZJ/PaIRcfoFiobmlE1bY=; b=bMX1/ZsiwxcFpFAcnO2Ah74hAw/UTbGD3WteAJeiuxpr5n2bQLEJVloaK2tBPJt90L8pn3X7ua8r4GuAIsGw7bsJ0AFLMmcckq2j8iXLBrIrpEewDobMo+CXsAme2EAPqB68eGujyPnYXRmQcxwyqhBXnJ2ffFBY/kaSEqWHb3U= 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 1768849760234645.5717319903733; Mon, 19 Jan 2026 11:09:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vhucN-0002Dj-2E; Mon, 19 Jan 2026 14:08:51 -0500 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 1vhucJ-0002Bq-Jf for qemu-devel@nongnu.org; Mon, 19 Jan 2026 14:08:47 -0500 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 1vhucI-0000vt-7r for qemu-devel@nongnu.org; Mon, 19 Jan 2026 14:08:47 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-422-1T_2VTp3OHy2e8bezsIaHQ-1; Mon, 19 Jan 2026 14:08:41 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4CE51195605F; Mon, 19 Jan 2026 19:08:40 +0000 (UTC) Received: from localhost (unknown [10.2.16.150]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CF782180049F; Mon, 19 Jan 2026 19:08:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768849725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XwZfVhIWIVz+4atlC56uUtVZJ/PaIRcfoFiobmlE1bY=; b=dji8v7UUCGUHDjpUZ1oxqOsMX2n0UWajEKtGok8M8eVlsfyvgAyjggoOyFShKISRIZPzNb nz40iIPcGi7bMYIaKJv+xy43gWtGnT2jcuLTqCbUMaREzyV7r0IbrReSb8xRs6KtD27uR/ F19uSTYIZ1soqwzi6zsxl6uR1wdIhOc= X-MC-Unique: 1T_2VTp3OHy2e8bezsIaHQ-1 X-Mimecast-MFC-AGG-ID: 1T_2VTp3OHy2e8bezsIaHQ_1768849720 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: Cleber Rosa , Stefan Hajnoczi , Mads Ynddal , Richard Henderson , John Snow , Thomas Huth , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 8/8] tests/tracetool: Honor the Python interpreter that "configure" detected Date: Mon, 19 Jan 2026 14:08:23 -0500 Message-ID: <20260119190823.867761-9-stefanha@redhat.com> In-Reply-To: <20260119190823.867761-1-stefanha@redhat.com> References: <20260119190823.867761-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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 (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=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.016, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: qemu development 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: 1768849761719154100 From: Thomas Huth The tracetool tests currently fail if the host installation does not have a "python3" binary (and you compiled QEMU by selecting a different one during the "configure" step). This happens because tracetool-test.py executes scripts/tracetool.py directly, so that this script is run via its shebang line. To fix the issue, use the same Python interpreter to run scripts/tracetool.py as we are using to run the tracetool-test.py script. Suggested-by: Paolo Bonzini Signed-off-by: Thomas Huth Reviewed-by: Daniel P. Berrang=C3=A9 Message-id: 20260115155318.37823-1-thuth@redhat.com Signed-off-by: Stefan Hajnoczi --- tests/tracetool/tracetool-test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/tracetool/tracetool-test.py b/tests/tracetool/tracetool-= test.py index 10e362a407..b99a0cd6d2 100755 --- a/tests/tracetool/tracetool-test.py +++ b/tests/tracetool/tracetool-test.py @@ -39,7 +39,8 @@ def test_tracetool_one(tracetool, backend, fmt, src_dir, = build_dir): actual_file =3D Path(build_dir, rel_filename) expect_file =3D Path(src_dir, rel_filename) =20 - args =3D [tracetool, f"--format=3D{fmt}", f"--backends=3D{backend}", "= --group=3Dtestsuite"] + args =3D [sys.executable, tracetool, + f"--format=3D{fmt}", f"--backends=3D{backend}", "--group=3Dtes= tsuite"] =20 if fmt.find("stap") !=3D -1: args +=3D ["--binary=3Dqemu", "--probe-prefix=3Dqemu"] --=20 2.52.0