From nobody Wed Sep 10 01:15:13 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1757340673; cv=none; d=zohomail.com; s=zohoarc; b=AFZF75y/6KRwgX7qRpBzArZHY5zfZWDn2BhN3nRk3nMUWY5kiuNcfkqnM0gcH09hTp4yaubflCih11yvR4qEhgZujpqkUuEBuaV5rjyuKXQoKIlmVrsItgco7doE88OoX1o6umnUrUGc8lh5OZyFxPMid/54p/PaInOKomCbues= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757340673; 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=ygsy+TGgiCe0Tvd3pnxtALx8Lez5Nos6Zei0INFVnAg=; b=jiB7rr3tr2zB1oYRP3FN42jy9D0ItPmj43SzNDQVdTg1L3LWu+mP2uoddPD2pmCsHv2DLHpNeQ5mfwua1UtHwIWUdgutFnQDyDzHeHjCU3MMirwFN7l2K9pSFBkt+Io7dUMHWuUO+iMpAjBHCNRTpSXYMWUGqM8XCMB9e83su94= 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 1757340673782548.1193707751864; Mon, 8 Sep 2025 07:11:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uvcWt-0001dR-0G; Mon, 08 Sep 2025 10:07:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uvcWn-0001c9-Sp for qemu-devel@nongnu.org; Mon, 08 Sep 2025 10:07:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uvcWV-00079V-Qv for qemu-devel@nongnu.org; Mon, 08 Sep 2025 10:07:29 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-128-CmU_pEVINIWxNs8wI02oEQ-1; Mon, 08 Sep 2025 10:07:00 -0400 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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6C2AC1800447; Mon, 8 Sep 2025 14:06:57 +0000 (UTC) Received: from localhost (unknown [10.2.16.148]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 897CD180035E; Mon, 8 Sep 2025 14:06:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1757340424; 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=ygsy+TGgiCe0Tvd3pnxtALx8Lez5Nos6Zei0INFVnAg=; b=HhNlV/CvT+xhTJmVNYFepN0SHRZDrrYwFOiYTEb6MocmkSnuNcdqaba123IlAKJGzR6lPy SVZv9MGfiAoGh1YoWM1WdYq+g9vXKP7DUAO3RSyvnQ9SURf8VRoIhnwfDfiofc15OwEsZ3 mc6gwBxfdeESU+5YyFbt27McZEt4SlI= X-MC-Unique: CmU_pEVINIWxNs8wI02oEQ-1 X-Mimecast-MFC-AGG-ID: CmU_pEVINIWxNs8wI02oEQ_1757340417 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Mads Ynddal , Michael Roth , Stefan Hajnoczi , Thomas Huth , Markus Armbruster , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 1/8] checkpatch: cull trailing '*/' in SPDX check Date: Mon, 8 Sep 2025 10:06:45 -0400 Message-ID: <20250908140653.170707-2-stefanha@redhat.com> In-Reply-To: <20250908140653.170707-1-stefanha@redhat.com> References: <20250908140653.170707-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 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.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1757340675632124100 From: Daniel P. Berrang=C3=A9 Sometimes SPDX expressions appear inside C comments, and this confuses checkpatch.pl. Drop the closing C comment characters to avoid this. Reviewed-by: Stefan Hajnoczi Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20250819161053.464641-2-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- scripts/checkpatch.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 833f20f555..91616c974f 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1368,6 +1368,9 @@ sub checkspdx { $expr =3D~ s/^\s*//g; $expr =3D~ s/\s*$//g; =20 + # Cull C comment end + $expr =3D~ s/\*\/.*//; + my @bits =3D split / +/, $expr; =20 my $prefer =3D "GPL-2.0-or-later"; --=20 2.51.0 From nobody Wed Sep 10 01:15:13 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1757340627; cv=none; d=zohomail.com; s=zohoarc; b=NPfhKBttB0b4zSkmnPWxlV3mH/g0aR7+bSpu7XJyWKFsN5yYcmD4hqmStokPYL/HXOn1cuWHFiavDClR1o5+RBUGS/YamC4xYGG7BSsn58Yo0fi5PuXVM8vKZgD6M1taUMqUCtVBKRPwhAueGGw2oqNRO2QkO/V1LQndvQ0nLaI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757340627; 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=CC/U+YT0IjnIpEWAp/l3Ri2sJwlhMCehWGudSW3x/40=; b=bHu9Yvo58TSP4EJnqvst2bO/f9pct9t5H3EY65tJVpTegWc2aNMmBj3ehcYlyIuX+KzHlWeKSldI/uvuvD1/1jd8Az/1Ll3DISGOixQYJG+sPx66WSlQMeY+qQY0npxiWQsfiga2FuHdNWwFlQsVHaIe5p7A/MIzZbS2oT0M7bo= 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 1757340627569130.55377992956755; Mon, 8 Sep 2025 07:10:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uvcWn-0001bs-Df; Mon, 08 Sep 2025 10:07:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uvcWk-0001Y5-Gk for qemu-devel@nongnu.org; Mon, 08 Sep 2025 10:07:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uvcWW-00079U-3Z for qemu-devel@nongnu.org; Mon, 08 Sep 2025 10:07:24 -0400 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-260-xosJd4EpP9uaOBtAqZRbfg-1; Mon, 08 Sep 2025 10:07:01 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id ABFEF19560B7; Mon, 8 Sep 2025 14:06:59 +0000 (UTC) Received: from localhost (unknown [10.2.16.148]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EA37C300018D; Mon, 8 Sep 2025 14:06:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1757340424; 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=CC/U+YT0IjnIpEWAp/l3Ri2sJwlhMCehWGudSW3x/40=; b=ho/eU0vs9n3jVNmPS1TE2/0OMwIM+cW2KU8Fe6h5sqG6MN26uA2bvPqcrlFwYvybXT2SjI pFmYtcsBGXQA41mFma6DyPxpzPZrD7gYTBKPh0LxPWU7+pjYf8MfT0GG1rztFKEa5pnZVd eUn0IB7wlmvFANlTl9Gy7+0E+nFxUQA= X-MC-Unique: xosJd4EpP9uaOBtAqZRbfg-1 X-Mimecast-MFC-AGG-ID: xosJd4EpP9uaOBtAqZRbfg_1757340419 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Mads Ynddal , Michael Roth , Stefan Hajnoczi , Thomas Huth , Markus Armbruster , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 2/8] tracetool: eliminate trailing whitespace in C format Date: Mon, 8 Sep 2025 10:06:46 -0400 Message-ID: <20250908140653.170707-3-stefanha@redhat.com> In-Reply-To: <20250908140653.170707-1-stefanha@redhat.com> References: <20250908140653.170707-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.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=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.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_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: 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: 1757340628846116600 From: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Hajnoczi Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20250819161053.464641-3-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- scripts/tracetool/format/c.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py index 69edf0d588..7aa51cd41a 100644 --- a/scripts/tracetool/format/c.py +++ b/scripts/tracetool/format/c.py @@ -36,7 +36,7 @@ def generate(events, backend, group): ' .id =3D 0,', ' .name =3D \"%(name)s\",', ' .sstate =3D %(sstate)s,', - ' .dstate =3D &%(dstate)s ', + ' .dstate =3D &%(dstate)s', '};', event =3D e.api(e.QEMU_EVENT), name =3D e.name, --=20 2.51.0 From nobody Wed Sep 10 01:15:13 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1757340624; cv=none; d=zohomail.com; s=zohoarc; b=UTtRoY3BrFfmTL1+E/pZwiKvj7EArhVwb2t+0svCy3znIbtDlLRxcEq63nc5IpqsecyE/k2or2TLDhOBgiO+Z/QVj2s/O3RW9BVc7OsOYt7X7eKcOq6KqTBT4r11RDSwSQbR96CscXoOEKbvN+obZKMxz88po/qwJJd40GRGsHI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757340624; 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=t5nF5SxGnYrJlcsvHf9YrxzHq/JupAIzUsGehPoAauY=; b=c7eYhcwELkyPdv7vD0I1ONfLCYqCdq3FNCyImC/FPuU+99r+rvjD2ZPZ9PFl8see9Ic3pKw28kBT1crpQ5Ql5cR7scnIyHP0q/Iq/P3CpZ5rTuJN/7zOBOGe85nDIwGCiBOEGQaNEvYNZCn75bn4iSeH6DUn/zDVOTTuXFMpavU= 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 1757340624767184.627855618931; Mon, 8 Sep 2025 07:10:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uvcWh-0001SI-RB; Mon, 08 Sep 2025 10:07:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uvcWf-0001Ra-B4 for qemu-devel@nongnu.org; Mon, 08 Sep 2025 10:07:21 -0400 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 1uvcWV-00079k-R6 for qemu-devel@nongnu.org; Mon, 08 Sep 2025 10:07:20 -0400 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-677-xMkLYM4XOCu-7A9hu59SrA-1; Mon, 08 Sep 2025 10:07:02 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 AA25E1800578; Mon, 8 Sep 2025 14:07:01 +0000 (UTC) Received: from localhost (unknown [10.2.16.148]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 34B7419560A2; Mon, 8 Sep 2025 14:07:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1757340426; 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=t5nF5SxGnYrJlcsvHf9YrxzHq/JupAIzUsGehPoAauY=; b=h6hz0QmpqPRPBYefyIuupl0XplC11Fot8mJ5KOWrZfw4hUvyb3gMwLLvdYw5WjAHzgoiP9 e0rUtNFhRvYg0WRmPQHIYh3XxyV0YiZxxAmWyYt48oxABrtVSuI4WTkg7inqFCXttZ94+1 ovPulLePEY2X6M3c5HuGumIgIYd1kWk= X-MC-Unique: xMkLYM4XOCu-7A9hu59SrA-1 X-Mimecast-MFC-AGG-ID: xMkLYM4XOCu-7A9hu59SrA_1757340421 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Mads Ynddal , Michael Roth , Stefan Hajnoczi , Thomas Huth , Markus Armbruster , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 3/8] tracetool: avoid space after "*" in arg types Date: Mon, 8 Sep 2025 10:06:47 -0400 Message-ID: <20250908140653.170707-4-stefanha@redhat.com> In-Reply-To: <20250908140653.170707-1-stefanha@redhat.com> References: <20250908140653.170707-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.12 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.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_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: 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: 1757340626917116600 From: Daniel P. Berrang=C3=A9 QEMU code style is to have no whitespace between "*" and the arg name. Since generated trace code will soon be added to git, make it comply with code style. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Hajnoczi Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20250819161053.464641-4-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- scripts/tracetool/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py index 2ae2e562d6..0f33758870 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -170,10 +170,16 @@ def __len__(self): =20 def __str__(self): """String suitable for declaring function arguments.""" + def onearg(t, n): + if t[-1] =3D=3D '*': + return "".join([t, n]) + else: + return " ".join([t, n]) + if len(self._args) =3D=3D 0: return "void" else: - return ", ".join([ " ".join([t, n]) for t,n in self._args ]) + return ", ".join([ onearg(t, n) for t,n in self._args ]) =20 def __repr__(self): """Evaluable string representation for this object.""" --=20 2.51.0 From nobody Wed Sep 10 01:15:13 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1757340544; cv=none; d=zohomail.com; s=zohoarc; b=Gkvg+mXFKPN/rbgEFKsPe8dWdtUJM2531dkxwYyEDdo9+SJPOxI1wojR/dFL4ZGQquOTwP23OZujAq9akyt+nE9Zx5THPY0x5bye4r4v+SSPxf9K8+QR9NaHPk3f2AQ+l0wlCswx/DgxZGLPPyq3WSGIctZqZ6zBAzEUfdGTkz0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757340544; 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=5E56q+jn2RPzB8CXErjNnuAeVqNwohx4m4KK35mg6/k=; b=MQfJxyLFsw8SV7S4B1/YYDzGXR5DDD1FMRF1/n96Cu1toZY+IFhmBoctxkr/uAAowWiR80YGcOG7Hn5j1iyd6/NFM93CKEqixrTIpKbshrbWjMWJ4+zqRhNj4yETdW0C0BleLok6+iIXi09Zw4gsqXh4uZH+rpdad02lkXQzpMg= 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 1757340544136533.4716842265216; Mon, 8 Sep 2025 07:09:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uvcWo-0001aD-UY; Mon, 08 Sep 2025 10:07:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uvcWh-0001S9-Lw for qemu-devel@nongnu.org; Mon, 08 Sep 2025 10:07:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uvcWV-00079l-Nr for qemu-devel@nongnu.org; Mon, 08 Sep 2025 10:07:22 -0400 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-554-Kk4e_yjPNCmNPA6VPEc0SQ-1; Mon, 08 Sep 2025 10:07:05 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B4EB51800578; Mon, 8 Sep 2025 14:07:03 +0000 (UTC) Received: from localhost (unknown [10.2.16.148]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3F20130001A4; Mon, 8 Sep 2025 14:07:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1757340426; 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=5E56q+jn2RPzB8CXErjNnuAeVqNwohx4m4KK35mg6/k=; b=WkBCdNK2qXCrsFAY2/8Wg5ffKYzCaumr9J8a7l+IA5GlBTRiCUrdsh/3hs57SMmDTg4mDs 2iBZiBbUpUusFHXKmDYGUcUQZFsJxIX/1U6DVq1/9+vcSJmYZtiCQmv28bXVeCUUzb1bX/ SYtxP30FTY+EBYd5N0102M5nS6Udep0= X-MC-Unique: Kk4e_yjPNCmNPA6VPEc0SQ-1 X-Mimecast-MFC-AGG-ID: Kk4e_yjPNCmNPA6VPEc0SQ_1757340423 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Mads Ynddal , Michael Roth , Stefan Hajnoczi , Thomas Huth , Markus Armbruster , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 4/8] tracetool: include SPDX-License-Identifier in generated files Date: Mon, 8 Sep 2025 10:06:48 -0400 Message-ID: <20250908140653.170707-5-stefanha@redhat.com> In-Reply-To: <20250908140653.170707-1-stefanha@redhat.com> References: <20250908140653.170707-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.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=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.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1757340546694124101 From: Daniel P. Berrang=C3=A9 While these files are auto-generated, a later commit will add reference output to git, so having SPDX-License-Identifier is desirable. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Thomas Huth Reviewed-by: Stefan Hajnoczi Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20250819161053.464641-5-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- scripts/tracetool/format/c.py | 1 + scripts/tracetool/format/d.py | 3 ++- scripts/tracetool/format/h.py | 1 + scripts/tracetool/format/log_stap.py | 1 + scripts/tracetool/format/simpletrace_stap.py | 1 + scripts/tracetool/format/stap.py | 1 + scripts/tracetool/format/ust_events_c.py | 1 + scripts/tracetool/format/ust_events_h.py | 1 + 8 files changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py index 7aa51cd41a..e473fb6c6e 100644 --- a/scripts/tracetool/format/c.py +++ b/scripts/tracetool/format/c.py @@ -22,6 +22,7 @@ def generate(events, backend, group): header =3D "trace-" + group + ".h" =20 out('/* This file is autogenerated by tracetool, do not edit. */', + '/* SPDX-License-Identifier: GPL-2.0-or-later */', '', '#include "qemu/osdep.h"', '#include "qemu/module.h"', diff --git a/scripts/tracetool/format/d.py b/scripts/tracetool/format/d.py index ebfb714200..a5e096e214 100644 --- a/scripts/tracetool/format/d.py +++ b/scripts/tracetool/format/d.py @@ -39,7 +39,8 @@ def generate(events, backend, group): if not events and platform !=3D "darwin": return =20 - out('/* This file is autogenerated by tracetool, do not edit. */' + out('/* This file is autogenerated by tracetool, do not edit. */', + '/* SPDX-License-Identifier: GPL-2.0-or-later */', '', 'provider qemu {') =20 diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index ea126b07ea..a00ae475f7 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -19,6 +19,7 @@ def generate(events, backend, group): header =3D "trace/control.h" =20 out('/* This file is autogenerated by tracetool, do not edit. */', + '/* SPDX-License-Identifier: GPL-2.0-or-later */', '', '#ifndef TRACE_%s_GENERATED_TRACERS_H' % group.upper(), '#define TRACE_%s_GENERATED_TRACERS_H' % group.upper(), diff --git a/scripts/tracetool/format/log_stap.py b/scripts/tracetool/forma= t/log_stap.py index b49afababd..710d62bffe 100644 --- a/scripts/tracetool/format/log_stap.py +++ b/scripts/tracetool/format/log_stap.py @@ -88,6 +88,7 @@ def c_fmt_to_stap(fmt): =20 def generate(events, backend, group): out('/* This file is autogenerated by tracetool, do not edit. */', + '/* SPDX-License-Identifier: GPL-2.0-or-later */', '') =20 for event_id, e in enumerate(events): diff --git a/scripts/tracetool/format/simpletrace_stap.py b/scripts/traceto= ol/format/simpletrace_stap.py index 4f4633b4e6..72971133bf 100644 --- a/scripts/tracetool/format/simpletrace_stap.py +++ b/scripts/tracetool/format/simpletrace_stap.py @@ -22,6 +22,7 @@ def global_var_name(name): =20 def generate(events, backend, group): out('/* This file is autogenerated by tracetool, do not edit. */', + '/* SPDX-License-Identifier: GPL-2.0-or-later */', '') =20 for event_id, e in enumerate(events): diff --git a/scripts/tracetool/format/stap.py b/scripts/tracetool/format/st= ap.py index a218b0445c..4d77fbc11a 100644 --- a/scripts/tracetool/format/stap.py +++ b/scripts/tracetool/format/stap.py @@ -38,6 +38,7 @@ def generate(events, backend, group): if "disable" not in e.properties] =20 out('/* This file is autogenerated by tracetool, do not edit. */', + '/* SPDX-License-Identifier: GPL-2.0-or-later */', '') =20 for e in events: diff --git a/scripts/tracetool/format/ust_events_c.py b/scripts/tracetool/f= ormat/ust_events_c.py index deced9533d..569754a304 100644 --- a/scripts/tracetool/format/ust_events_c.py +++ b/scripts/tracetool/format/ust_events_c.py @@ -20,6 +20,7 @@ def generate(events, backend, group): if "disabled" not in e.properties] =20 out('/* This file is autogenerated by tracetool, do not edit. */', + '/* SPDX-License-Identifier: GPL-2.0-or-later */', '', '#include "qemu/osdep.h"', '', diff --git a/scripts/tracetool/format/ust_events_h.py b/scripts/tracetool/f= ormat/ust_events_h.py index b99fe6896b..2a31fefeca 100644 --- a/scripts/tracetool/format/ust_events_h.py +++ b/scripts/tracetool/format/ust_events_h.py @@ -25,6 +25,7 @@ def generate(events, backend, group): include =3D "trace-ust.h" =20 out('/* This file is autogenerated by tracetool, do not edit. */', + '/* SPDX-License-Identifier: GPL-2.0-or-later */', '', '#undef TRACEPOINT_PROVIDER', '#define TRACEPOINT_PROVIDER qemu', --=20 2.51.0 From nobody Wed Sep 10 01:15:13 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1757340646; cv=none; d=zohomail.com; s=zohoarc; b=escdsjFIFP2ejt82mey+l1qb5giakeSCh1TsZ3BcnAKg8TG15PriZ6UfhQn1DMJkIhbiKTkEvLil6khWCJhXiXqYwYEoAFwMtHyI/UlqNqh0PMRD6JMOAisZhVBZfx2ymIrTFSg4uqwBplh6/Hum2GhMdlDsGbJ+HMGswC9sA48= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757340646; 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=i3ZKmQ7LAmbyB4YL7dSuF7gco0NSGQ7G/d0KWyF5wBg=; b=T6jzzQlZafoXCw1HqjUfDvtNJ08XUczvHcqK6yJV+Puy+yjgWwsRAUEe/6B1lW/L8RrdZi7F1tYAg2woY+BB957P7Mokb8SkaGDf3FaeHyQ2NGmmQJ2e3ngnNAub8NZiuSTNhHBXOQ4q3p4L/PdgWLVv/f7hWfF+p9TgaQFkoDY= 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 1757340646296211.5322511772838; Mon, 8 Sep 2025 07:10:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uvcWu-0001eI-Qu; Mon, 08 Sep 2025 10:07:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uvcWr-0001dT-3i for qemu-devel@nongnu.org; Mon, 08 Sep 2025 10:07:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uvcWZ-0007A8-AJ for qemu-devel@nongnu.org; Mon, 08 Sep 2025 10:07:32 -0400 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-160-oNn-cXiQMTKHp-MFAwP36g-1; Mon, 08 Sep 2025 10:07:06 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AE1F01800578; Mon, 8 Sep 2025 14:07:05 +0000 (UTC) Received: from localhost (unknown [10.2.16.148]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 342B630001B5; Mon, 8 Sep 2025 14:07:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1757340430; 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=i3ZKmQ7LAmbyB4YL7dSuF7gco0NSGQ7G/d0KWyF5wBg=; b=ggmfW+xX2gVhwdeM/Shm63msZA9bxEzq1duZczuT69leFRu8mEMebYzXDuAGaERdCgEMxD 6lMRbK4qnt3z0ilXUr7ZpdC0zQAhNvbSwql1I7O9xEYELgMutTfbWl6yyZpje1OteewVfm 0yO1NqFwIN8eiaklyJHuO/H6Dsv3ge4= X-MC-Unique: oNn-cXiQMTKHp-MFAwP36g-1 X-Mimecast-MFC-AGG-ID: oNn-cXiQMTKHp-MFAwP36g_1757340425 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Mads Ynddal , Michael Roth , Stefan Hajnoczi , Thomas Huth , Markus Armbruster , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 5/8] tracetool: add test suite for tracetool with reference output Date: Mon, 8 Sep 2025 10:06:49 -0400 Message-ID: <20250908140653.170707-6-stefanha@redhat.com> In-Reply-To: <20250908140653.170707-1-stefanha@redhat.com> References: <20250908140653.170707-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.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=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.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1757340647769116600 From: Daniel P. Berrang=C3=A9 When reviewing tracetool patches it is often very unclear what the expected output will be for the generated backends. Compounding this is that a default build will only enable the 'log' trace backend, so developers won't see generated code for other backends without making a special effort. Some backends are also platform specific, so can't be enabled in QEMU builds, even though tracetool could generate the code. To address this, introduce a test suite for tracetool which is conceptually similar to the qapi-schema test. It is a simple python program that runs tracetool and compares the actual output to historical reference output kept in git. The test directly emits TAP format logs for ease of integration with meson. This can be run with make check-tracetool to make it easier for developers changing generated output, the sample expected content can be auto-recreated QEMU_TEST_REGENERATE=3D1 make check-tracetool and the changes reviewed and added to the commit. This will also assist reviewers interpreting the change. Developers are reminded of this in the test output on failure: $ make check-tracetool 1/6 qemu:tracetool / dtrace OK 0.14s 2/6 qemu:tracetool / ftrace FAIL 0.06s exit status 1 =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95= =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2= =80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80= =95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95= =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2= =80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80= =95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95 1..2 ok 1 - ftrace.c # not ok 1 - ftrace.h (set QEMU_TEST_REGENERATE=3D1 to recreate reference o= utput if tracetool generator was intentionally changed) =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95= =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2= =80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80= =95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95= =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2= =80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80= =95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95 3/6 qemu:tracetool / log OK 0.06s 4/6 qemu:tracetool / simple OK 0.06s 5/6 qemu:tracetool / syslog OK 0.06s 6/6 qemu:tracetool / ust OK 0.11s Summary of Failures: 2/6 qemu:tracetool / ftrace FAIL 0.06s exit status 1 Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20250819161053.464641-6-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- MAINTAINERS | 1 + docs/devel/testing/main.rst | 28 +++++++ tests/Makefile.include | 1 + tests/tracetool/dtrace.h | 59 +++++++++++++ tests/tracetool/ftrace.h | 73 ++++++++++++++++ tests/tracetool/log.h | 57 +++++++++++++ tests/tracetool/simple.h | 54 ++++++++++++ tests/tracetool/syslog.h | 57 +++++++++++++ tests/tracetool/ust.h | 55 +++++++++++++ tests/tracetool/dtrace.c | 32 ++++++++ tests/tracetool/ftrace.c | 32 ++++++++ tests/tracetool/log.c | 32 ++++++++ tests/tracetool/simple.c | 61 ++++++++++++++ tests/tracetool/syslog.c | 32 ++++++++ tests/tracetool/ust.c | 32 ++++++++ tests/meson.build | 1 + tests/tracetool/dtrace.d | 10 +++ tests/tracetool/dtrace.log-stap | 15 ++++ tests/tracetool/dtrace.simpletrace-stap | 16 ++++ tests/tracetool/dtrace.stap | 14 ++++ tests/tracetool/meson.build | 25 ++++++ tests/tracetool/trace-events | 5 ++ tests/tracetool/tracetool-test.py | 105 ++++++++++++++++++++++++ tests/tracetool/ust.ust-events-c | 14 ++++ tests/tracetool/ust.ust-events-h | 56 +++++++++++++ 25 files changed, 867 insertions(+) create mode 100644 tests/tracetool/dtrace.h create mode 100644 tests/tracetool/ftrace.h create mode 100644 tests/tracetool/log.h create mode 100644 tests/tracetool/simple.h create mode 100644 tests/tracetool/syslog.h create mode 100644 tests/tracetool/ust.h create mode 100644 tests/tracetool/dtrace.c create mode 100644 tests/tracetool/ftrace.c create mode 100644 tests/tracetool/log.c create mode 100644 tests/tracetool/simple.c create mode 100644 tests/tracetool/syslog.c create mode 100644 tests/tracetool/ust.c create mode 100644 tests/tracetool/dtrace.d create mode 100644 tests/tracetool/dtrace.log-stap create mode 100644 tests/tracetool/dtrace.simpletrace-stap create mode 100644 tests/tracetool/dtrace.stap create mode 100644 tests/tracetool/meson.build create mode 100644 tests/tracetool/trace-events create mode 100755 tests/tracetool/tracetool-test.py create mode 100644 tests/tracetool/ust.ust-events-c create mode 100644 tests/tracetool/ust.ust-events-h diff --git a/MAINTAINERS b/MAINTAINERS index 1ae28e8804..434b72a052 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3560,6 +3560,7 @@ F: scripts/tracetool/ F: scripts/qemu-trace-stap* F: docs/tools/qemu-trace-stap.rst F: docs/devel/tracing.rst +F: tests/tracetool/ T: git https://github.com/stefanha/qemu.git tracing =20 Simpletrace diff --git a/docs/devel/testing/main.rst b/docs/devel/testing/main.rst index 2b5cb0c148..11f05c0006 100644 --- a/docs/devel/testing/main.rst +++ b/docs/devel/testing/main.rst @@ -178,6 +178,34 @@ parser (either fixing a bug or extending/modifying the= syntax). To do this: =20 ``qapi-schema +=3D foo.json`` =20 +.. _tracetool-tests: + +Tracetool tests +~~~~~~~~~~~~~~~ + +The tracetool tests validate the generated source files used for defining +probes for various tracing backends and source formats. The test operates +by running the tracetool program against a sample trace-events file, and +comparing the generated output against known good reference output. The +tests can be run with: + +.. code:: + + make check-tracetool + +The reference output is stored in files under tests/tracetool, and when +the tracetool backend/format output is intentionally changed, the reference +files need to be updated. This can be automated by setting the +QEMU_TEST_REGENERATE=3D1 environment variable: + +.. code:: + + QEMU_TEST_REGENERATE=3D1 make check-tracetool + +The resulting changes must be reviewed by the author to ensure they match +the intended results, before adding the updated reference output to the +same commit that alters the generator code. + check-block ~~~~~~~~~~~ =20 diff --git a/tests/Makefile.include b/tests/Makefile.include index 23fb722d42..3538c0c740 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -13,6 +13,7 @@ check-help: @echo " $(MAKE) check-functional-TARGET Run functional tests for a given= target" @echo " $(MAKE) check-unit Run qobject tests" @echo " $(MAKE) check-qapi-schema Run QAPI schema tests" + @echo " $(MAKE) check-tracetool Run tracetool generator tests" @echo " $(MAKE) check-block Run block tests" ifneq ($(filter $(all-check-targets), check-softfloat),) @echo " $(MAKE) check-tcg Run TCG tests" diff --git a/tests/tracetool/dtrace.h b/tests/tracetool/dtrace.h new file mode 100644 index 0000000000..c2e5110672 --- /dev/null +++ b/tests/tracetool/dtrace.h @@ -0,0 +1,59 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef TRACE_TESTSUITE_GENERATED_TRACERS_H +#define TRACE_TESTSUITE_GENERATED_TRACERS_H + +#include "trace/control.h" + +extern TraceEvent _TRACE_TEST_BLAH_EVENT; +extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; +extern uint16_t _TRACE_TEST_BLAH_DSTATE; +extern uint16_t _TRACE_TEST_WIBBLE_DSTATE; +#define TRACE_TEST_BLAH_ENABLED 1 +#define TRACE_TEST_WIBBLE_ENABLED 1 +#ifndef SDT_USE_VARIADIC +#define SDT_USE_VARIADIC 1 +#endif +#include "trace-dtrace-testsuite.h" + +#undef SDT_USE_VARIADIC +#ifndef QEMU_TEST_BLAH_ENABLED +#define QEMU_TEST_BLAH_ENABLED() true +#endif +#ifndef QEMU_TEST_WIBBLE_ENABLED +#define QEMU_TEST_WIBBLE_ENABLED() true +#endif + +#define TRACE_TEST_BLAH_BACKEND_DSTATE() ( \ + QEMU_TEST_BLAH_ENABLED() || \ + false) + +static inline void _nocheck__trace_test_blah(void *context, const char *fi= lename) +{ + QEMU_TEST_BLAH(context, filename); +} + +static inline void trace_test_blah(void *context, const char *filename) +{ + if (true) { + _nocheck__trace_test_blah(context, filename); + } +} + +#define TRACE_TEST_WIBBLE_BACKEND_DSTATE() ( \ + QEMU_TEST_WIBBLE_ENABLED() || \ + false) + +static inline void _nocheck__trace_test_wibble(void *context, int value) +{ + QEMU_TEST_WIBBLE(context, value); +} + +static inline void trace_test_wibble(void *context, int value) +{ + if (true) { + _nocheck__trace_test_wibble(context, value); + } +} +#endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/tests/tracetool/ftrace.h b/tests/tracetool/ftrace.h new file mode 100644 index 0000000000..f1ff3b0a62 --- /dev/null +++ b/tests/tracetool/ftrace.h @@ -0,0 +1,73 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef TRACE_TESTSUITE_GENERATED_TRACERS_H +#define TRACE_TESTSUITE_GENERATED_TRACERS_H + +#include "trace/control.h" + +extern TraceEvent _TRACE_TEST_BLAH_EVENT; +extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; +extern uint16_t _TRACE_TEST_BLAH_DSTATE; +extern uint16_t _TRACE_TEST_WIBBLE_DSTATE; +#define TRACE_TEST_BLAH_ENABLED 1 +#define TRACE_TEST_WIBBLE_ENABLED 1 +#include "trace/ftrace.h" + + +#define TRACE_TEST_BLAH_BACKEND_DSTATE() ( \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ + false) + +static inline void _nocheck__trace_test_blah(void *context, const char *fi= lename) +{ + { + char ftrace_buf[MAX_TRACE_STRLEN]; + int unused __attribute__ ((unused)); + int trlen; + if (trace_event_get_state(TRACE_TEST_BLAH)) { +#line 4 "trace-events" + trlen =3D snprintf(ftrace_buf, MAX_TRACE_STRLEN, + "test_blah " "Blah context=3D%p filename=3D%s= " "\n" , context, filename); +#line 33 "ftrace.h" + trlen =3D MIN(trlen, MAX_TRACE_STRLEN - 1); + unused =3D write(trace_marker_fd, ftrace_buf, trlen); + } + } +} + +static inline void trace_test_blah(void *context, const char *filename) +{ + if (true) { + _nocheck__trace_test_blah(context, filename); + } +} + +#define TRACE_TEST_WIBBLE_BACKEND_DSTATE() ( \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ + false) + +static inline void _nocheck__trace_test_wibble(void *context, int value) +{ + { + char ftrace_buf[MAX_TRACE_STRLEN]; + int unused __attribute__ ((unused)); + int trlen; + if (trace_event_get_state(TRACE_TEST_WIBBLE)) { +#line 5 "trace-events" + trlen =3D snprintf(ftrace_buf, MAX_TRACE_STRLEN, + "test_wibble " "Wibble context=3D%p value=3D%= d" "\n" , context, value); +#line 61 "ftrace.h" + trlen =3D MIN(trlen, MAX_TRACE_STRLEN - 1); + unused =3D write(trace_marker_fd, ftrace_buf, trlen); + } + } +} + +static inline void trace_test_wibble(void *context, int value) +{ + if (true) { + _nocheck__trace_test_wibble(context, value); + } +} +#endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/tests/tracetool/log.h b/tests/tracetool/log.h new file mode 100644 index 0000000000..4293f1010e --- /dev/null +++ b/tests/tracetool/log.h @@ -0,0 +1,57 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef TRACE_TESTSUITE_GENERATED_TRACERS_H +#define TRACE_TESTSUITE_GENERATED_TRACERS_H + +#include "trace/control.h" + +extern TraceEvent _TRACE_TEST_BLAH_EVENT; +extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; +extern uint16_t _TRACE_TEST_BLAH_DSTATE; +extern uint16_t _TRACE_TEST_WIBBLE_DSTATE; +#define TRACE_TEST_BLAH_ENABLED 1 +#define TRACE_TEST_WIBBLE_ENABLED 1 +#include "qemu/log-for-trace.h" + + +#define TRACE_TEST_BLAH_BACKEND_DSTATE() ( \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ + false) + +static inline void _nocheck__trace_test_blah(void *context, const char *fi= lename) +{ + if (trace_event_get_state(TRACE_TEST_BLAH) && qemu_loglevel_mask(LOG_T= RACE)) { +#line 4 "trace-events" + qemu_log("test_blah " "Blah context=3D%p filename=3D%s" "\n", cont= ext, filename); +#line 28 "log.h" + } +} + +static inline void trace_test_blah(void *context, const char *filename) +{ + if (true) { + _nocheck__trace_test_blah(context, filename); + } +} + +#define TRACE_TEST_WIBBLE_BACKEND_DSTATE() ( \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ + false) + +static inline void _nocheck__trace_test_wibble(void *context, int value) +{ + if (trace_event_get_state(TRACE_TEST_WIBBLE) && qemu_loglevel_mask(LOG= _TRACE)) { +#line 5 "trace-events" + qemu_log("test_wibble " "Wibble context=3D%p value=3D%d" "\n", con= text, value); +#line 48 "log.h" + } +} + +static inline void trace_test_wibble(void *context, int value) +{ + if (true) { + _nocheck__trace_test_wibble(context, value); + } +} +#endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/tests/tracetool/simple.h b/tests/tracetool/simple.h new file mode 100644 index 0000000000..3c9de68c43 --- /dev/null +++ b/tests/tracetool/simple.h @@ -0,0 +1,54 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef TRACE_TESTSUITE_GENERATED_TRACERS_H +#define TRACE_TESTSUITE_GENERATED_TRACERS_H + +#include "trace/control.h" + +extern TraceEvent _TRACE_TEST_BLAH_EVENT; +extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; +extern uint16_t _TRACE_TEST_BLAH_DSTATE; +extern uint16_t _TRACE_TEST_WIBBLE_DSTATE; +#define TRACE_TEST_BLAH_ENABLED 1 +#define TRACE_TEST_WIBBLE_ENABLED 1 +void _simple_trace_test_blah(void *context, const char *filename); +void _simple_trace_test_wibble(void *context, int value); + + +#define TRACE_TEST_BLAH_BACKEND_DSTATE() ( \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ + false) + +static inline void _nocheck__trace_test_blah(void *context, const char *fi= lename) +{ + if (trace_event_get_state(TRACE_TEST_BLAH)) { + _simple_trace_test_blah(context, filename); + } +} + +static inline void trace_test_blah(void *context, const char *filename) +{ + if (true) { + _nocheck__trace_test_blah(context, filename); + } +} + +#define TRACE_TEST_WIBBLE_BACKEND_DSTATE() ( \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ + false) + +static inline void _nocheck__trace_test_wibble(void *context, int value) +{ + if (trace_event_get_state(TRACE_TEST_WIBBLE)) { + _simple_trace_test_wibble(context, value); + } +} + +static inline void trace_test_wibble(void *context, int value) +{ + if (true) { + _nocheck__trace_test_wibble(context, value); + } +} +#endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/tests/tracetool/syslog.h b/tests/tracetool/syslog.h new file mode 100644 index 0000000000..498bbfb99e --- /dev/null +++ b/tests/tracetool/syslog.h @@ -0,0 +1,57 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef TRACE_TESTSUITE_GENERATED_TRACERS_H +#define TRACE_TESTSUITE_GENERATED_TRACERS_H + +#include "trace/control.h" + +extern TraceEvent _TRACE_TEST_BLAH_EVENT; +extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; +extern uint16_t _TRACE_TEST_BLAH_DSTATE; +extern uint16_t _TRACE_TEST_WIBBLE_DSTATE; +#define TRACE_TEST_BLAH_ENABLED 1 +#define TRACE_TEST_WIBBLE_ENABLED 1 +#include + + +#define TRACE_TEST_BLAH_BACKEND_DSTATE() ( \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ + false) + +static inline void _nocheck__trace_test_blah(void *context, const char *fi= lename) +{ + if (trace_event_get_state(TRACE_TEST_BLAH)) { +#line 4 "trace-events" + syslog(LOG_INFO, "test_blah " "Blah context=3D%p filename=3D%s" , = context, filename); +#line 28 "syslog.h" + } +} + +static inline void trace_test_blah(void *context, const char *filename) +{ + if (true) { + _nocheck__trace_test_blah(context, filename); + } +} + +#define TRACE_TEST_WIBBLE_BACKEND_DSTATE() ( \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ + false) + +static inline void _nocheck__trace_test_wibble(void *context, int value) +{ + if (trace_event_get_state(TRACE_TEST_WIBBLE)) { +#line 5 "trace-events" + syslog(LOG_INFO, "test_wibble " "Wibble context=3D%p value=3D%d" ,= context, value); +#line 48 "syslog.h" + } +} + +static inline void trace_test_wibble(void *context, int value) +{ + if (true) { + _nocheck__trace_test_wibble(context, value); + } +} +#endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/tests/tracetool/ust.h b/tests/tracetool/ust.h new file mode 100644 index 0000000000..1184ddd870 --- /dev/null +++ b/tests/tracetool/ust.h @@ -0,0 +1,55 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef TRACE_TESTSUITE_GENERATED_TRACERS_H +#define TRACE_TESTSUITE_GENERATED_TRACERS_H + +#include "trace/control.h" + +extern TraceEvent _TRACE_TEST_BLAH_EVENT; +extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; +extern uint16_t _TRACE_TEST_BLAH_DSTATE; +extern uint16_t _TRACE_TEST_WIBBLE_DSTATE; +#define TRACE_TEST_BLAH_ENABLED 1 +#define TRACE_TEST_WIBBLE_ENABLED 1 +#include +#include "trace-ust-testsuite.h" + +/* tracepoint_enabled() was introduced in LTTng UST 2.7 */ +#ifndef tracepoint_enabled +#define tracepoint_enabled(a, b) true +#endif + + +#define TRACE_TEST_BLAH_BACKEND_DSTATE() ( \ + tracepoint_enabled(qemu, test_blah) || \ + false) + +static inline void _nocheck__trace_test_blah(void *context, const char *fi= lename) +{ + tracepoint(qemu, test_blah, context, filename); +} + +static inline void trace_test_blah(void *context, const char *filename) +{ + if (true) { + _nocheck__trace_test_blah(context, filename); + } +} + +#define TRACE_TEST_WIBBLE_BACKEND_DSTATE() ( \ + tracepoint_enabled(qemu, test_wibble) || \ + false) + +static inline void _nocheck__trace_test_wibble(void *context, int value) +{ + tracepoint(qemu, test_wibble, context, value); +} + +static inline void trace_test_wibble(void *context, int value) +{ + if (true) { + _nocheck__trace_test_wibble(context, value); + } +} +#endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/tests/tracetool/dtrace.c b/tests/tracetool/dtrace.c new file mode 100644 index 0000000000..9f862fa14d --- /dev/null +++ b/tests/tracetool/dtrace.c @@ -0,0 +1,32 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "qemu/osdep.h" +#include "qemu/module.h" +#include "trace-testsuite.h" + +uint16_t _TRACE_TEST_BLAH_DSTATE; +uint16_t _TRACE_TEST_WIBBLE_DSTATE; +TraceEvent _TRACE_TEST_BLAH_EVENT =3D { + .id =3D 0, + .name =3D "test_blah", + .sstate =3D TRACE_TEST_BLAH_ENABLED, + .dstate =3D &_TRACE_TEST_BLAH_DSTATE +}; +TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { + .id =3D 0, + .name =3D "test_wibble", + .sstate =3D TRACE_TEST_WIBBLE_ENABLED, + .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE +}; +TraceEvent *testsuite_trace_events[] =3D { + &_TRACE_TEST_BLAH_EVENT, + &_TRACE_TEST_WIBBLE_EVENT, + NULL, +}; + +static void trace_testsuite_register_events(void) +{ + trace_event_register_group(testsuite_trace_events); +} +trace_init(trace_testsuite_register_events) diff --git a/tests/tracetool/ftrace.c b/tests/tracetool/ftrace.c new file mode 100644 index 0000000000..9f862fa14d --- /dev/null +++ b/tests/tracetool/ftrace.c @@ -0,0 +1,32 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "qemu/osdep.h" +#include "qemu/module.h" +#include "trace-testsuite.h" + +uint16_t _TRACE_TEST_BLAH_DSTATE; +uint16_t _TRACE_TEST_WIBBLE_DSTATE; +TraceEvent _TRACE_TEST_BLAH_EVENT =3D { + .id =3D 0, + .name =3D "test_blah", + .sstate =3D TRACE_TEST_BLAH_ENABLED, + .dstate =3D &_TRACE_TEST_BLAH_DSTATE +}; +TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { + .id =3D 0, + .name =3D "test_wibble", + .sstate =3D TRACE_TEST_WIBBLE_ENABLED, + .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE +}; +TraceEvent *testsuite_trace_events[] =3D { + &_TRACE_TEST_BLAH_EVENT, + &_TRACE_TEST_WIBBLE_EVENT, + NULL, +}; + +static void trace_testsuite_register_events(void) +{ + trace_event_register_group(testsuite_trace_events); +} +trace_init(trace_testsuite_register_events) diff --git a/tests/tracetool/log.c b/tests/tracetool/log.c new file mode 100644 index 0000000000..9f862fa14d --- /dev/null +++ b/tests/tracetool/log.c @@ -0,0 +1,32 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "qemu/osdep.h" +#include "qemu/module.h" +#include "trace-testsuite.h" + +uint16_t _TRACE_TEST_BLAH_DSTATE; +uint16_t _TRACE_TEST_WIBBLE_DSTATE; +TraceEvent _TRACE_TEST_BLAH_EVENT =3D { + .id =3D 0, + .name =3D "test_blah", + .sstate =3D TRACE_TEST_BLAH_ENABLED, + .dstate =3D &_TRACE_TEST_BLAH_DSTATE +}; +TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { + .id =3D 0, + .name =3D "test_wibble", + .sstate =3D TRACE_TEST_WIBBLE_ENABLED, + .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE +}; +TraceEvent *testsuite_trace_events[] =3D { + &_TRACE_TEST_BLAH_EVENT, + &_TRACE_TEST_WIBBLE_EVENT, + NULL, +}; + +static void trace_testsuite_register_events(void) +{ + trace_event_register_group(testsuite_trace_events); +} +trace_init(trace_testsuite_register_events) diff --git a/tests/tracetool/simple.c b/tests/tracetool/simple.c new file mode 100644 index 0000000000..0484177481 --- /dev/null +++ b/tests/tracetool/simple.c @@ -0,0 +1,61 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "qemu/osdep.h" +#include "qemu/module.h" +#include "trace-testsuite.h" + +uint16_t _TRACE_TEST_BLAH_DSTATE; +uint16_t _TRACE_TEST_WIBBLE_DSTATE; +TraceEvent _TRACE_TEST_BLAH_EVENT =3D { + .id =3D 0, + .name =3D "test_blah", + .sstate =3D TRACE_TEST_BLAH_ENABLED, + .dstate =3D &_TRACE_TEST_BLAH_DSTATE +}; +TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { + .id =3D 0, + .name =3D "test_wibble", + .sstate =3D TRACE_TEST_WIBBLE_ENABLED, + .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE +}; +TraceEvent *testsuite_trace_events[] =3D { + &_TRACE_TEST_BLAH_EVENT, + &_TRACE_TEST_WIBBLE_EVENT, + NULL, +}; + +static void trace_testsuite_register_events(void) +{ + trace_event_register_group(testsuite_trace_events); +} +trace_init(trace_testsuite_register_events) +#include "qemu/osdep.h" +#include "trace/control.h" +#include "trace/simple.h" + +void _simple_trace_test_blah(void *context, const char *filename) +{ + TraceBufferRecord rec; + size_t argfilename_len =3D filename ? MIN(strlen(filename), MAX_TRACE_= STRLEN) : 0; + + if (trace_record_start(&rec, _TRACE_TEST_BLAH_EVENT.id, 8 + 4 + argfil= ename_len)) { + return; /* Trace Buffer Full, Event Dropped ! */ + } + trace_record_write_u64(&rec, (uintptr_t)(uint64_t *)context); + trace_record_write_str(&rec, filename, argfilename_len); + trace_record_finish(&rec); +} + +void _simple_trace_test_wibble(void *context, int value) +{ + TraceBufferRecord rec; + + if (trace_record_start(&rec, _TRACE_TEST_WIBBLE_EVENT.id, 8 + 8)) { + return; /* Trace Buffer Full, Event Dropped ! */ + } + trace_record_write_u64(&rec, (uintptr_t)(uint64_t *)context); + trace_record_write_u64(&rec, (uint64_t)value); + trace_record_finish(&rec); +} + diff --git a/tests/tracetool/syslog.c b/tests/tracetool/syslog.c new file mode 100644 index 0000000000..9f862fa14d --- /dev/null +++ b/tests/tracetool/syslog.c @@ -0,0 +1,32 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "qemu/osdep.h" +#include "qemu/module.h" +#include "trace-testsuite.h" + +uint16_t _TRACE_TEST_BLAH_DSTATE; +uint16_t _TRACE_TEST_WIBBLE_DSTATE; +TraceEvent _TRACE_TEST_BLAH_EVENT =3D { + .id =3D 0, + .name =3D "test_blah", + .sstate =3D TRACE_TEST_BLAH_ENABLED, + .dstate =3D &_TRACE_TEST_BLAH_DSTATE +}; +TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { + .id =3D 0, + .name =3D "test_wibble", + .sstate =3D TRACE_TEST_WIBBLE_ENABLED, + .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE +}; +TraceEvent *testsuite_trace_events[] =3D { + &_TRACE_TEST_BLAH_EVENT, + &_TRACE_TEST_WIBBLE_EVENT, + NULL, +}; + +static void trace_testsuite_register_events(void) +{ + trace_event_register_group(testsuite_trace_events); +} +trace_init(trace_testsuite_register_events) diff --git a/tests/tracetool/ust.c b/tests/tracetool/ust.c new file mode 100644 index 0000000000..9f862fa14d --- /dev/null +++ b/tests/tracetool/ust.c @@ -0,0 +1,32 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "qemu/osdep.h" +#include "qemu/module.h" +#include "trace-testsuite.h" + +uint16_t _TRACE_TEST_BLAH_DSTATE; +uint16_t _TRACE_TEST_WIBBLE_DSTATE; +TraceEvent _TRACE_TEST_BLAH_EVENT =3D { + .id =3D 0, + .name =3D "test_blah", + .sstate =3D TRACE_TEST_BLAH_ENABLED, + .dstate =3D &_TRACE_TEST_BLAH_DSTATE +}; +TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { + .id =3D 0, + .name =3D "test_wibble", + .sstate =3D TRACE_TEST_WIBBLE_ENABLED, + .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE +}; +TraceEvent *testsuite_trace_events[] =3D { + &_TRACE_TEST_BLAH_EVENT, + &_TRACE_TEST_WIBBLE_EVENT, + NULL, +}; + +static void trace_testsuite_register_events(void) +{ + trace_event_register_group(testsuite_trace_events); +} +trace_init(trace_testsuite_register_events) diff --git a/tests/meson.build b/tests/meson.build index c59619220f..cbe7916241 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -88,3 +88,4 @@ subdir('qapi-schema') subdir('qtest') subdir('migration-stress') subdir('functional') +subdir('tracetool') diff --git a/tests/tracetool/dtrace.d b/tests/tracetool/dtrace.d new file mode 100644 index 0000000000..5cc06f9f4f --- /dev/null +++ b/tests/tracetool/dtrace.d @@ -0,0 +1,10 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +provider qemu { + +probe test_blah(void * context,const char * filename); + +probe test_wibble(void * context,int value); + +}; diff --git a/tests/tracetool/dtrace.log-stap b/tests/tracetool/dtrace.log-s= tap new file mode 100644 index 0000000000..092986e0b6 --- /dev/null +++ b/tests/tracetool/dtrace.log-stap @@ -0,0 +1,15 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +probe qemu.log.test_blah =3D qemu.test_blah ? +{ + try { + argfilename_str =3D filename ? user_string_n(filename, 512) : "" + } catch {} + printf("%d@%d test_blah Blah context=3D%p filename=3D%s\n", pid(), get= timeofday_ns(), context, argfilename_str) +} +probe qemu.log.test_wibble =3D qemu.test_wibble ? +{ + printf("%d@%d test_wibble Wibble context=3D%p value=3D%d\n", pid(), ge= ttimeofday_ns(), context, value) +} + diff --git a/tests/tracetool/dtrace.simpletrace-stap b/tests/tracetool/dtra= ce.simpletrace-stap new file mode 100644 index 0000000000..d064e3e286 --- /dev/null +++ b/tests/tracetool/dtrace.simpletrace-stap @@ -0,0 +1,16 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +probe qemu.simpletrace.test_blah =3D qemu.test_blah ? +{ + try { + argfilename_str =3D filename ? user_string_n(filename, 512) : "" + } catch {} + argfilename_len =3D strlen(argfilename_str) + printf("%8b%8b%8b%4b%4b%8b%4b%.*s", 1, 0, gettimeofday_ns(), 24 + 8 + = 4 + argfilename_len, pid(), context, argfilename_len, argfilename_len, argf= ilename_str) +} +probe qemu.simpletrace.test_wibble =3D qemu.test_wibble ? +{ + printf("%8b%8b%8b%4b%4b%8b%8b", 1, 1, gettimeofday_ns(), 24 + 8 + 8, p= id(), context, value) +} + diff --git a/tests/tracetool/dtrace.stap b/tests/tracetool/dtrace.stap new file mode 100644 index 0000000000..9c5d8a527c --- /dev/null +++ b/tests/tracetool/dtrace.stap @@ -0,0 +1,14 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +probe qemu.test_blah =3D process("qemu").mark("test_blah") +{ + context =3D $arg1; + filename =3D $arg2; +} +probe qemu.test_wibble =3D process("qemu").mark("test_wibble") +{ + context =3D $arg1; + value =3D $arg2; +} + diff --git a/tests/tracetool/meson.build b/tests/tracetool/meson.build new file mode 100644 index 0000000000..74720fa3a3 --- /dev/null +++ b/tests/tracetool/meson.build @@ -0,0 +1,25 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +test_env =3D environment() +test_env.set('PYTHONPATH', meson.project_source_root() / 'scripts') +test_env.set('PYTHONIOENCODING', 'utf-8') + +backends =3D [ + 'dtrace', + 'ftrace', + 'log', + 'simple', + 'syslog', + 'ust' +] + +foreach backend: backends + test(backend, + python, + args: [meson.current_source_dir() / 'tracetool-test.py', + meson.project_source_root() / 'scripts' / 'tracetool.py', + backend, + meson.current_source_dir(), + meson.current_build_dir()], + suite: ['tracetool']) +endforeach diff --git a/tests/tracetool/trace-events b/tests/tracetool/trace-events new file mode 100644 index 0000000000..72cf4d6f70 --- /dev/null +++ b/tests/tracetool/trace-events @@ -0,0 +1,5 @@ +# See docs/devel/tracing.rst for syntax documentation. +# SPDX-License-Identifier: GPL-2.0-or-later + +test_blah(void *context, const char *filename) "Blah context=3D%p filename= =3D%s" +test_wibble(void *context, int value) "Wibble context=3D%p value=3D%d" diff --git a/tests/tracetool/tracetool-test.py b/tests/tracetool/tracetool-= test.py new file mode 100755 index 0000000000..a420597fc4 --- /dev/null +++ b/tests/tracetool/tracetool-test.py @@ -0,0 +1,105 @@ +#!/usr/bin/python3 +# SPDX-License-Identifier: GPL-2.0-or-later + +import os +from pathlib import Path +from shutil import copyfile +from subprocess import check_call +import sys + + +def get_formats(backend): + formats =3D [ + "c", + "h", + ] + if backend =3D=3D "dtrace": + formats +=3D [ + "d", + "log-stap", + "simpletrace-stap", + "stap", + ] + if backend =3D=3D "ust": + formats +=3D [ + "ust-events-c", + "ust-events-h", + ] + return formats + + +def test_tracetool_one(tracetool, backend, fmt, src_dir, build_dir): + rel_filename =3D backend + "." + fmt + actual_file =3D Path(build_dir, rel_filename) + expect_file =3D Path(src_dir, rel_filename) + + args =3D [tracetool, f"--format=3D{fmt}", f"--backends=3D{backend}", "= --group=3Dtestsuite"] + + if fmt.find("stap") !=3D -1: + args +=3D ["--binary=3Dqemu", "--probe-prefix=3Dqemu"] + + # Use relative files for both, as these filenames end + # up in '#line' statements in the output + args +=3D ["trace-events", rel_filename] + + try: + check_call(args, cwd=3Dbuild_dir) + actual =3D actual_file.read_text() + finally: + actual_file.unlink() + + if os.getenv("QEMU_TEST_REGENERATE", False): + print(f"# regenerate {expect_file}") + expect_file.write_text(actual) + + expect =3D expect_file.read_text() + + assert expect =3D=3D actual + + +def test_tracetool(tracetool, backend, source_dir, build_dir): + fail =3D False + scenarios =3D len(get_formats(backend)) + + print(f"1..{scenarios}") + + src_events =3D Path(source_dir, "trace-events") + build_events =3D Path(build_dir, "trace-events") + + try: + # We need a stable relative filename under build dir + # for the '#line' statements, so copy over the input + copyfile(src_events, build_events) + + num =3D 1 + for fmt in get_formats(backend): + status =3D "not ok" + hint =3D "" + try: + test_tracetool_one(tracetool, backend, fmt, source_dir, bu= ild_dir) + status =3D "ok" + except Exception as e: + print(f"# {e}") + fail =3D True + hint =3D ( + " (set QEMU_TEST_REGENERATE=3D1 to recreate reference " + + "output if tracetool generator was intentionally cha= nged)" + ) + finally: + print(f"{status} {num} - {backend}.{fmt}{hint}") + finally: + build_events.unlink() + + return fail + + +if __name__ =3D=3D "__main__": + if len(sys.argv) !=3D 5: + argv0 =3D sys.argv[0] + print("syntax: {argv0} TRACE-TOOL BACKEND SRC-DIR BUILD-DIR", file= =3Dsys.stderr) + sys.exit(1) + + fail =3D test_tracetool(sys.argv[1], sys.argv[2], sys.argv[3], sys.arg= v[4]) + if fail: + sys.exit(1) + sys.exit(0) diff --git a/tests/tracetool/ust.ust-events-c b/tests/tracetool/ust.ust-eve= nts-c new file mode 100644 index 0000000000..db23224056 --- /dev/null +++ b/tests/tracetool/ust.ust-events-c @@ -0,0 +1,14 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "qemu/osdep.h" + +#define TRACEPOINT_DEFINE +#define TRACEPOINT_CREATE_PROBES + +/* If gcc version 4.7 or older is used, LTTng ust gives a warning when com= piling with + -Wredundant-decls. + */ +#pragma GCC diagnostic ignored "-Wredundant-decls" + +#include "trace-ust-all.h" diff --git a/tests/tracetool/ust.ust-events-h b/tests/tracetool/ust.ust-eve= nts-h new file mode 100644 index 0000000000..4621a995fc --- /dev/null +++ b/tests/tracetool/ust.ust-events-h @@ -0,0 +1,56 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#undef TRACEPOINT_PROVIDER +#define TRACEPOINT_PROVIDER qemu + +#undef TRACEPOINT_INCLUDE +#define TRACEPOINT_INCLUDE "./trace-ust.h" + +#if !defined (TRACE_TESTSUITE_GENERATED_UST_H) || \ + defined(TRACEPOINT_HEADER_MULTI_READ) +#define TRACE_TESTSUITE_GENERATED_UST_H + +#include + +/* + * LTTng ust 2.0 does not allow you to use TP_ARGS(void) for tracepoints + * requiring no arguments. We define these macros introduced in more recen= t * versions of LTTng ust as a workaround + */ +#ifndef _TP_EXPROTO1 +#define _TP_EXPROTO1(a) void +#endif +#ifndef _TP_EXDATA_PROTO1 +#define _TP_EXDATA_PROTO1(a) void *__tp_data +#endif +#ifndef _TP_EXDATA_VAR1 +#define _TP_EXDATA_VAR1(a) __tp_data +#endif +#ifndef _TP_EXVAR1 +#define _TP_EXVAR1(a) +#endif + +TRACEPOINT_EVENT( + qemu, + test_blah, + TP_ARGS(void *, context, const char *, filename), + TP_FIELDS( + ctf_integer_hex(void *, context, context) + ctf_string(filename, filename) + ) +) + +TRACEPOINT_EVENT( + qemu, + test_wibble, + TP_ARGS(void *, context, int, value), + TP_FIELDS( + ctf_integer_hex(void *, context, context) + ctf_integer(int, value, value) + ) +) + +#endif /* TRACE_TESTSUITE_GENERATED_UST_H */ + +/* This part must be outside ifdef protection */ +#include --=20 2.51.0 From nobody Wed Sep 10 01:15:13 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1757340630; cv=none; d=zohomail.com; s=zohoarc; b=a0W8i+t+gnVwlzTIvogbfXYTk9BEBZMKbwQgYDNCqvq/gY9DtERKE3Qo1/GaUTwF7ImHLjtKKWS9Et7Dpf+lkpUhZJC1wAQQczt7mQeqndt2K4gbJWJUZv0PKBymfosFDyxnjep8Ajj7X10DkUI9yOLlJuxUDp7ycZd0p8bM80M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757340630; 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=2W8YgrmAPyn8CoekyTrTRLxs16xNV/W78ERDsq7EZs0=; b=krjxuuIKGvFdI3EHPX0U/0ripwF97bu+VgAx+Yi/5wdeyipXT5YwQO5CFNz16/Hwdaodub1+pRhJYqbXoYkG2wNfamWEh93aLFaWhVfiFTaSE/DlAYJLpnkj4jmc+sDQUs0fr6hN7rC2jRmdE4hKCBolWSZTq06CT5Vh8ZGItJQ= 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 17573406304135.869561749610966; Mon, 8 Sep 2025 07:10:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uvcWs-0001e0-VF; Mon, 08 Sep 2025 10:07:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uvcWr-0001dD-8N for qemu-devel@nongnu.org; Mon, 08 Sep 2025 10:07:33 -0400 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 1uvcWY-0007A7-KN for qemu-devel@nongnu.org; Mon, 08 Sep 2025 10:07:31 -0400 Received: from mx-prod-mc-04.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-443--aNKnQBLN9GuGmE8lGYSJQ-1; Mon, 08 Sep 2025 10:07:08 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A6EC219560AD; Mon, 8 Sep 2025 14:07:07 +0000 (UTC) Received: from localhost (unknown [10.2.16.148]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3DD4A300018D; Mon, 8 Sep 2025 14:07:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1757340430; 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=2W8YgrmAPyn8CoekyTrTRLxs16xNV/W78ERDsq7EZs0=; b=Fq5bdS+7/RRNEzligeXQOaakSG5jHyFWNoS8QO9wsSVRACyO8B7Qb1flyyOhXyeXBpdt8O fB1pJ7k+4OQe7UYY4SF4zz9Zrvs5EVQBRBVUMTkAko21tbjnfB9P/vky9RQfpHkIy+sp/A QKCFW0mGGWgzhk7F2k7zqOJ7VfwbtZg= X-MC-Unique: -aNKnQBLN9GuGmE8lGYSJQ-1 X-Mimecast-MFC-AGG-ID: -aNKnQBLN9GuGmE8lGYSJQ_1757340427 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Mads Ynddal , Michael Roth , Stefan Hajnoczi , Thomas Huth , Markus Armbruster , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 6/8] tracetool: drop the probe "__nocheck__" wrapping Date: Mon, 8 Sep 2025 10:06:50 -0400 Message-ID: <20250908140653.170707-7-stefanha@redhat.com> In-Reply-To: <20250908140653.170707-1-stefanha@redhat.com> References: <20250908140653.170707-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.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1757340633498116600 From: Daniel P. Berrang=C3=A9 Every generated inline probe function is wrapped with a trivial caller that has a hard-coded condition test: static inline void _nocheck__trace_test_wibble(void * context, int value) { tracepoint(qemu, test_wibble, context, value); } static inline void trace_test_wibble(void * context, int value) { if (true) { _nocheck__trace_test_wibble(context, value); } } This was introduced for TCG probes back in 864a2178: trace: [tcg] Do not generate TCG code to trace dynamically-disa= bled events but is obsolete since 126d4123 tracing: excise the tcg related from tracetool This commit removes the wrapping such that we have static inline void trace_test_wibble(void * context, int value) { tracepoint(qemu, test_wibble, context, value); } The default build of qemu-system-x86_64 on Fedora with the 'log' backend, has its size reduced by 1 MB Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Hajnoczi Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20250819161053.464641-7-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- tests/tracetool/dtrace.h | 18 ++---------------- tests/tracetool/ftrace.h | 20 +++----------------- tests/tracetool/log.h | 20 +++----------------- tests/tracetool/simple.h | 18 ++---------------- tests/tracetool/syslog.h | 20 +++----------------- tests/tracetool/ust.h | 18 ++---------------- scripts/tracetool/__init__.py | 1 - scripts/tracetool/format/h.py | 16 +--------------- 8 files changed, 16 insertions(+), 115 deletions(-) diff --git a/tests/tracetool/dtrace.h b/tests/tracetool/dtrace.h index c2e5110672..c8931a8d7b 100644 --- a/tests/tracetool/dtrace.h +++ b/tests/tracetool/dtrace.h @@ -29,31 +29,17 @@ extern uint16_t _TRACE_TEST_WIBBLE_DSTATE; QEMU_TEST_BLAH_ENABLED() || \ false) =20 -static inline void _nocheck__trace_test_blah(void *context, const char *fi= lename) -{ - QEMU_TEST_BLAH(context, filename); -} - static inline void trace_test_blah(void *context, const char *filename) { - if (true) { - _nocheck__trace_test_blah(context, filename); - } + QEMU_TEST_BLAH(context, filename); } =20 #define TRACE_TEST_WIBBLE_BACKEND_DSTATE() ( \ QEMU_TEST_WIBBLE_ENABLED() || \ false) =20 -static inline void _nocheck__trace_test_wibble(void *context, int value) +static inline void trace_test_wibble(void *context, int value) { QEMU_TEST_WIBBLE(context, value); } - -static inline void trace_test_wibble(void *context, int value) -{ - if (true) { - _nocheck__trace_test_wibble(context, value); - } -} #endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/tests/tracetool/ftrace.h b/tests/tracetool/ftrace.h index f1ff3b0a62..fe22ea0f09 100644 --- a/tests/tracetool/ftrace.h +++ b/tests/tracetool/ftrace.h @@ -19,7 +19,7 @@ extern uint16_t _TRACE_TEST_WIBBLE_DSTATE; trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ false) =20 -static inline void _nocheck__trace_test_blah(void *context, const char *fi= lename) +static inline void trace_test_blah(void *context, const char *filename) { { char ftrace_buf[MAX_TRACE_STRLEN]; @@ -36,18 +36,11 @@ static inline void _nocheck__trace_test_blah(void *cont= ext, const char *filename } } =20 -static inline void trace_test_blah(void *context, const char *filename) -{ - if (true) { - _nocheck__trace_test_blah(context, filename); - } -} - #define TRACE_TEST_WIBBLE_BACKEND_DSTATE() ( \ trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ false) =20 -static inline void _nocheck__trace_test_wibble(void *context, int value) +static inline void trace_test_wibble(void *context, int value) { { char ftrace_buf[MAX_TRACE_STRLEN]; @@ -57,17 +50,10 @@ static inline void _nocheck__trace_test_wibble(void *co= ntext, int value) #line 5 "trace-events" trlen =3D snprintf(ftrace_buf, MAX_TRACE_STRLEN, "test_wibble " "Wibble context=3D%p value=3D%= d" "\n" , context, value); -#line 61 "ftrace.h" +#line 54 "ftrace.h" trlen =3D MIN(trlen, MAX_TRACE_STRLEN - 1); unused =3D write(trace_marker_fd, ftrace_buf, trlen); } } } - -static inline void trace_test_wibble(void *context, int value) -{ - if (true) { - _nocheck__trace_test_wibble(context, value); - } -} #endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/tests/tracetool/log.h b/tests/tracetool/log.h index 4293f1010e..edcc7f9d47 100644 --- a/tests/tracetool/log.h +++ b/tests/tracetool/log.h @@ -19,7 +19,7 @@ extern uint16_t _TRACE_TEST_WIBBLE_DSTATE; trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ false) =20 -static inline void _nocheck__trace_test_blah(void *context, const char *fi= lename) +static inline void trace_test_blah(void *context, const char *filename) { if (trace_event_get_state(TRACE_TEST_BLAH) && qemu_loglevel_mask(LOG_T= RACE)) { #line 4 "trace-events" @@ -28,30 +28,16 @@ static inline void _nocheck__trace_test_blah(void *cont= ext, const char *filename } } =20 -static inline void trace_test_blah(void *context, const char *filename) -{ - if (true) { - _nocheck__trace_test_blah(context, filename); - } -} - #define TRACE_TEST_WIBBLE_BACKEND_DSTATE() ( \ trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ false) =20 -static inline void _nocheck__trace_test_wibble(void *context, int value) +static inline void trace_test_wibble(void *context, int value) { if (trace_event_get_state(TRACE_TEST_WIBBLE) && qemu_loglevel_mask(LOG= _TRACE)) { #line 5 "trace-events" qemu_log("test_wibble " "Wibble context=3D%p value=3D%d" "\n", con= text, value); -#line 48 "log.h" - } -} - -static inline void trace_test_wibble(void *context, int value) -{ - if (true) { - _nocheck__trace_test_wibble(context, value); +#line 41 "log.h" } } #endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/tests/tracetool/simple.h b/tests/tracetool/simple.h index 3c9de68c43..ec6fcb22c3 100644 --- a/tests/tracetool/simple.h +++ b/tests/tracetool/simple.h @@ -20,35 +20,21 @@ void _simple_trace_test_wibble(void *context, int value= ); trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ false) =20 -static inline void _nocheck__trace_test_blah(void *context, const char *fi= lename) +static inline void trace_test_blah(void *context, const char *filename) { if (trace_event_get_state(TRACE_TEST_BLAH)) { _simple_trace_test_blah(context, filename); } } =20 -static inline void trace_test_blah(void *context, const char *filename) -{ - if (true) { - _nocheck__trace_test_blah(context, filename); - } -} - #define TRACE_TEST_WIBBLE_BACKEND_DSTATE() ( \ trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ false) =20 -static inline void _nocheck__trace_test_wibble(void *context, int value) +static inline void trace_test_wibble(void *context, int value) { if (trace_event_get_state(TRACE_TEST_WIBBLE)) { _simple_trace_test_wibble(context, value); } } - -static inline void trace_test_wibble(void *context, int value) -{ - if (true) { - _nocheck__trace_test_wibble(context, value); - } -} #endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/tests/tracetool/syslog.h b/tests/tracetool/syslog.h index 498bbfb99e..ed4305554c 100644 --- a/tests/tracetool/syslog.h +++ b/tests/tracetool/syslog.h @@ -19,7 +19,7 @@ extern uint16_t _TRACE_TEST_WIBBLE_DSTATE; trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ false) =20 -static inline void _nocheck__trace_test_blah(void *context, const char *fi= lename) +static inline void trace_test_blah(void *context, const char *filename) { if (trace_event_get_state(TRACE_TEST_BLAH)) { #line 4 "trace-events" @@ -28,30 +28,16 @@ static inline void _nocheck__trace_test_blah(void *cont= ext, const char *filename } } =20 -static inline void trace_test_blah(void *context, const char *filename) -{ - if (true) { - _nocheck__trace_test_blah(context, filename); - } -} - #define TRACE_TEST_WIBBLE_BACKEND_DSTATE() ( \ trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ false) =20 -static inline void _nocheck__trace_test_wibble(void *context, int value) +static inline void trace_test_wibble(void *context, int value) { if (trace_event_get_state(TRACE_TEST_WIBBLE)) { #line 5 "trace-events" syslog(LOG_INFO, "test_wibble " "Wibble context=3D%p value=3D%d" ,= context, value); -#line 48 "syslog.h" - } -} - -static inline void trace_test_wibble(void *context, int value) -{ - if (true) { - _nocheck__trace_test_wibble(context, value); +#line 41 "syslog.h" } } #endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/tests/tracetool/ust.h b/tests/tracetool/ust.h index 1184ddd870..b7acd0c39b 100644 --- a/tests/tracetool/ust.h +++ b/tests/tracetool/ust.h @@ -25,31 +25,17 @@ extern uint16_t _TRACE_TEST_WIBBLE_DSTATE; tracepoint_enabled(qemu, test_blah) || \ false) =20 -static inline void _nocheck__trace_test_blah(void *context, const char *fi= lename) -{ - tracepoint(qemu, test_blah, context, filename); -} - static inline void trace_test_blah(void *context, const char *filename) { - if (true) { - _nocheck__trace_test_blah(context, filename); - } + tracepoint(qemu, test_blah, context, filename); } =20 #define TRACE_TEST_WIBBLE_BACKEND_DSTATE() ( \ tracepoint_enabled(qemu, test_wibble) || \ false) =20 -static inline void _nocheck__trace_test_wibble(void *context, int value) +static inline void trace_test_wibble(void *context, int value) { tracepoint(qemu, test_wibble, context, value); } - -static inline void trace_test_wibble(void *context, int value) -{ - if (true) { - _nocheck__trace_test_wibble(context, value); - } -} #endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py index 0f33758870..1d5238a084 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -338,7 +338,6 @@ def formats(self): return self._FMT.findall(self.fmt) =20 QEMU_TRACE =3D "trace_%(name)s" - QEMU_TRACE_NOCHECK =3D "_nocheck__" + QEMU_TRACE QEMU_TRACE_TCG =3D QEMU_TRACE + "_tcg" QEMU_DSTATE =3D "_TRACE_%(NAME)s_DSTATE" QEMU_BACKEND_DSTATE =3D "TRACE_%(NAME)s_BACKEND_DSTATE" diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index a00ae475f7..b42a8268a8 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -64,7 +64,7 @@ def generate(events, backend, group): out('', 'static inline void %(api)s(%(args)s)', '{', - api=3De.api(e.QEMU_TRACE_NOCHECK), + api=3De.api(), args=3De.args) =20 if "disable" not in e.properties: @@ -72,20 +72,6 @@ def generate(events, backend, group): =20 out('}') =20 - cond =3D "true" - - out('', - 'static inline void %(api)s(%(args)s)', - '{', - ' if (%(cond)s) {', - ' %(api_nocheck)s(%(names)s);', - ' }', - '}', - api=3De.api(), - api_nocheck=3De.api(e.QEMU_TRACE_NOCHECK), - args=3De.args, - names=3D", ".join(e.args.names()), - cond=3Dcond) =20 backend.generate_end(events, group) =20 --=20 2.51.0 From nobody Wed Sep 10 01:15:13 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1757340582; cv=none; d=zohomail.com; s=zohoarc; b=DJk+LJcBhNbsBiJwVeLB1dduYU07NkPN/RLkp4ndn96L2h+8eXLI0EbAoWrynih9zxfOvNj5e+Z+/Y/+W2LkFSeOwBOakndmDm5bxDzhJYRoXA8mCBOcBc/uij1ap9r+DIcKdcT2p3qdgHNYRjJPsWQpi1PvUitIkDjKFZRpxJ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757340582; 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=LaRG7OdBMmnrOpcGiK6L7gyA3PnpDfGguSRlhtavI80=; b=P5yW4SMxHtDCrDHLPz0WkYxcUZnZTk/nFO/OcsJd/5S2dH0i32/j0ui+jhu0mzl9CQvsIOo5dVTRUAwDiHyJ3WrNJvl7qEjP4Lexkr6dRm72IWFSgEhssIX7wLtXVftJEGUpwuyhbWT8yjA4ORGwTkTWTQmHqw+U3NKPrCxmnJM= 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 1757340582211405.32154273132574; Mon, 8 Sep 2025 07:09:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uvcWz-0001fv-4o; Mon, 08 Sep 2025 10:07:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uvcWw-0001ei-2k for qemu-devel@nongnu.org; Mon, 08 Sep 2025 10:07:38 -0400 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 1uvcWi-0007Ae-8X for qemu-devel@nongnu.org; Mon, 08 Sep 2025 10:07:35 -0400 Received: from mx-prod-mc-04.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-141-z2sAZP4xOrOj2aT-FD987w-1; Mon, 08 Sep 2025 10:07:11 -0400 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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D10E719560AD; Mon, 8 Sep 2025 14:07:09 +0000 (UTC) Received: from localhost (unknown [10.2.16.148]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2756E19540EE; Mon, 8 Sep 2025 14:07:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1757340434; 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=LaRG7OdBMmnrOpcGiK6L7gyA3PnpDfGguSRlhtavI80=; b=X6pUo4ZYdwvSILPxWa3IQGz3hSushaV9KmGCC1yTFL8+H0Dyh4r0465ic5B5MCQd7nhdCx bIGhugUzWQl9rfEtKA8oOCqDs7WreaOZojv70j4WoYWE0euKKabAyGH9jbYObgK2vcVDNt BHt3WyrKTFjlznWtiv/DcvQgK7yJnBQ= X-MC-Unique: z2sAZP4xOrOj2aT-FD987w-1 X-Mimecast-MFC-AGG-ID: z2sAZP4xOrOj2aT-FD987w_1757340430 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Mads Ynddal , Michael Roth , Stefan Hajnoczi , Thomas Huth , Markus Armbruster , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 7/8] qapi: switch to use QEMU_TEST_REGENERATE env var Date: Mon, 8 Sep 2025 10:06:51 -0400 Message-ID: <20250908140653.170707-8-stefanha@redhat.com> In-Reply-To: <20250908140653.170707-1-stefanha@redhat.com> References: <20250908140653.170707-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 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.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_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: 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: 1757340584586116600 From: Daniel P. Berrang=C3=A9 The QAPI_TEST_UPDATE env var can be set when running the QAPI schema tests to regenerate the reference output. For consistent naming with the tracetool test, change the env var name to QEMU_TEST_REGENERATE. The test is modified to provide a hint about use of the new env var and it is also added to the developer documentation.document its us= age. Reviewed-by: Stefan Hajnoczi Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20250819161053.464641-8-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- docs/devel/testing/main.rst | 12 ++++++++++++ tests/qapi-schema/test-qapi.py | 7 +++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/devel/testing/main.rst b/docs/devel/testing/main.rst index 11f05c0006..0662766b5c 100644 --- a/docs/devel/testing/main.rst +++ b/docs/devel/testing/main.rst @@ -178,6 +178,18 @@ parser (either fixing a bug or extending/modifying the= syntax). To do this: =20 ``qapi-schema +=3D foo.json`` =20 +The reference output can be automatically updated to match the latest QAPI +code generator by running the tests with the QEMU_TEST_REGENERATE environm= ent +variable set. + +.. code:: + + QEMU_TEST_REGENERATE=3D1 make check-qapi-schema + +The resulting changes must be reviewed by the author to ensure they match +the intended results before adding the updated reference output to the +same commit that alters the generator code. + .. _tracetool-tests: =20 Tracetool tests diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py index 4be930228c..cf7fb8a6df 100755 --- a/tests/qapi-schema/test-qapi.py +++ b/tests/qapi-schema/test-qapi.py @@ -165,7 +165,7 @@ def test_and_diff(test_name, dir_name, update): if actual_out =3D=3D expected_out and actual_err =3D=3D expected_err: return 0 =20 - print("%s %s" % (test_name, 'UPDATE' if update else 'FAIL'), + print("%s: %s" % (test_name, 'UPDATE' if update else 'FAIL'), file=3Dsys.stderr) out_diff =3D difflib.unified_diff(expected_out, actual_out, outfp.name) err_diff =3D difflib.unified_diff(expected_err, actual_err, errfp.name) @@ -173,6 +173,9 @@ def test_and_diff(test_name, dir_name, update): sys.stdout.writelines(err_diff) =20 if not update: + print(("\n%s: set QEMU_TEST_REGENERATE=3D1 to recreate reference o= utput" + + "if the QAPI schema generator was intentionally changed") %= test_name, + file=3Dsys.stderr) return 1 =20 try: @@ -197,7 +200,7 @@ def main(argv): parser.add_argument('-d', '--dir', action=3D'store', default=3D'', help=3D"directory containing tests") parser.add_argument('-u', '--update', action=3D'store_true', - default=3D'QAPI_TEST_UPDATE' in os.environ, + default=3D'QEMU_TEST_REGENERATE' in os.environ, help=3D"update expected test results") parser.add_argument('tests', nargs=3D'*', metavar=3D'TEST', action=3D'= store') args =3D parser.parse_args() --=20 2.51.0 From nobody Wed Sep 10 01:15:13 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1757340641; cv=none; d=zohomail.com; s=zohoarc; b=dwMrRWBG4WL6UwZJQ3WbSg9NBJ/f7AeMN1FAA6sw8p3oJipmm9mxMByTAkdamqrOEfPWp5RvFUDh7LejXqnW8TKwlWtvXVaOjzStKP2k43hH/1fqFi7eIhKIY8ipEP/sfWS49UNxHtwL8HgyGx/adFtJ5RzoKOAOu3Bme3dHIYw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757340641; 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=SzDMkrTQqQYkXQ+Kj3K0maxVf1kSvWOty+kUosiSzgA=; b=e547HmdXqK2bjNkZdmlKNlvLlyd+MFy5Wt2Ihs5teWKV2mk2DCB0D+/7+/8ALylLWkZ4aVCn51Cp8ZVhTNSctuTxDXfl2sxZfljow8M/K4vFuemXJpdlRTwdCeS9Vv23Px0M8ZQjkK2L1krhD+7nwJb79VcYI7my0WBkmSntyV0= 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 1757340641119148.9546163303013; Mon, 8 Sep 2025 07:10:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uvcX6-0001h7-7p; Mon, 08 Sep 2025 10:07:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uvcWy-0001fx-5f for qemu-devel@nongnu.org; Mon, 08 Sep 2025 10:07:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uvcWh-0007At-Fv for qemu-devel@nongnu.org; Mon, 08 Sep 2025 10:07:39 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-600-CTn2ntRyPcGcWCnppEGo-g-1; Mon, 08 Sep 2025 10:07:14 -0400 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 16A2218002C2; Mon, 8 Sep 2025 14:07:12 +0000 (UTC) Received: from localhost (unknown [10.2.16.148]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 56F2C1800451; Mon, 8 Sep 2025 14:07:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1757340435; 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=SzDMkrTQqQYkXQ+Kj3K0maxVf1kSvWOty+kUosiSzgA=; b=BK8jDn6eukC2b+tpU8qeiW6gCffTzKETczkYjRoCuOShFigeEu7JnS7KbmcbT+3gMeqZvu nxEr9+JPyIsI8QBwN2kZvtBhE16CkVzE/EMKy8Vo1NLXnmv+JcQHuKDc+ZGNLv4qgAurO4 YbBKDSPB38zBSoGJB0x1bFe1HHnkwec= X-MC-Unique: CTn2ntRyPcGcWCnppEGo-g-1 X-Mimecast-MFC-AGG-ID: CTn2ntRyPcGcWCnppEGo-g_1757340432 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Mads Ynddal , Michael Roth , Stefan Hajnoczi , Thomas Huth , Markus Armbruster , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 8/8] tracetool-test: allow to run in parallel Date: Mon, 8 Sep 2025 10:06:52 -0400 Message-ID: <20250908140653.170707-9-stefanha@redhat.com> In-Reply-To: <20250908140653.170707-1-stefanha@redhat.com> References: <20250908140653.170707-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.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 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.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1757340643326124100 From: Marc-Andr=C3=A9 Lureau Create a temporary build subdirectory, to avoid conflicting with other running tests. This fixes "meson test" with tracetool-test which is parallel default. Signed-off-by: Marc-Andr=C3=A9 Lureau Message-ID: <20250908114652.1880366-1-marcandre.lureau@redhat.com> Signed-off-by: Stefan Hajnoczi --- tests/tracetool/tracetool-test.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/tracetool/tracetool-test.py b/tests/tracetool/tracetool-= test.py index a420597fc4..65430fdedc 100755 --- a/tests/tracetool/tracetool-test.py +++ b/tests/tracetool/tracetool-test.py @@ -6,6 +6,7 @@ from shutil import copyfile from subprocess import check_call import sys +import tempfile =20 =20 def get_formats(backend): @@ -99,7 +100,8 @@ def test_tracetool(tracetool, backend, source_dir, build= _dir): print("syntax: {argv0} TRACE-TOOL BACKEND SRC-DIR BUILD-DIR", file= =3Dsys.stderr) sys.exit(1) =20 - fail =3D test_tracetool(sys.argv[1], sys.argv[2], sys.argv[3], sys.arg= v[4]) - if fail: - sys.exit(1) + with tempfile.TemporaryDirectory(prefix=3Dsys.argv[4]) as tmpdir: + fail =3D test_tracetool(sys.argv[1], sys.argv[2], sys.argv[3], tmp= dir) + if fail: + sys.exit(1) sys.exit(0) --=20 2.51.0