From nobody Sun Dec 14 01:53:27 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=1754424248; cv=none; d=zohomail.com; s=zohoarc; b=S4xutFyzV/IMOWa73OnbIuRcJ0XE91ruCMsn2JBjpMwDQy31Cl3GjU/2y7cLp0wDzFhSxmbtv3sZ9Y794S4iFqUFVshsJzXjrLOhG3b+GkLjsT8W2jHvDXlXX9zWNoDWFw+n89wKNgrBw+waSXSSmns3cv8ySOxVJf4C3KVBrjQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754424248; 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=gTq9lNHivi7j2Ovmik/Mgi62Uey4aAlpi1I4rDsxGZg=; b=RtqbyNROzQQmCyP/rKb3Z4u+WuWhU4grDS+d5vZbEbQFc7h6A54ZnksDJnU6mijPlAezkKZGE87YsUC0IRLezCPcY1vjUkO+/KRb8lV7I9Ug4CqQOxFik9A5nzuUidBodhiK/cpzYAA2kzKbrKJkT1eb3FEF0+QQJl2/5xttfJc= 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 1754424248273745.4523424552219; Tue, 5 Aug 2025 13:04:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ujNt3-0007Xf-Un; Tue, 05 Aug 2025 16:03:53 -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 1ujNsy-0007Wk-Ng for qemu-devel@nongnu.org; Tue, 05 Aug 2025 16:03:48 -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 1ujNsx-0003mS-A9 for qemu-devel@nongnu.org; Tue, 05 Aug 2025 16:03:48 -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-18-R9-a-Zw4OtqCRNphFdYjZQ-1; Tue, 05 Aug 2025 16:03:43 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 71A1B1800EC8; Tue, 5 Aug 2025 20:03:42 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.80]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 032E530001BE; Tue, 5 Aug 2025 20:03:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754424226; 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=gTq9lNHivi7j2Ovmik/Mgi62Uey4aAlpi1I4rDsxGZg=; b=DAbi6ZI0OA6gr+mCyhlrdA6/pWi50+YQl0fUSJk08QoMdxCPG/GRSCozPjxu4Y/dFjFXrn DKAGQAmuNKTLrUYI01yp6iqI7/pjvrVDA8i4t7vQFIBHgLApq+w/t7OFX6s51wAn0EP9FD e2IniPKNeR6XZr0FNhtU6yrioZFcQc0= X-MC-Unique: R9-a-Zw4OtqCRNphFdYjZQ-1 X-Mimecast-MFC-AGG-ID: R9-a-Zw4OtqCRNphFdYjZQ_1754424222 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Mads Ynddal , Paolo Bonzini , Thomas Huth , Stefan Hajnoczi , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 1/6] checkpatch: cull trailing '*/' in SPDX check Date: Tue, 5 Aug 2025 21:03:29 +0100 Message-ID: <20250805200334.629493-2-berrange@redhat.com> In-Reply-To: <20250805200334.629493-1-berrange@redhat.com> References: <20250805200334.629493-1-berrange@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=berrange@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: 1754424250747116600 Sometimes SPDX expressions appear inside C comments, and this confuses checkpatch.pl. Drop the closing C comment characters to avoid this. Signed-off-by: Daniel P. Berrang=C3=A9 --- 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.50.1 From nobody Sun Dec 14 01:53:27 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=1754424301; cv=none; d=zohomail.com; s=zohoarc; b=ZwStERZKctETWaVhZ+xUrUM2tiPA7B5R6O8I/IqwBdlY3WgSAI0+Mm/GAfkN07DeUu0rjjfxMdpU5JFx1Po/5VanTi4/qr3OvhBkTq3BeTBEvtIa/VbY4/KxJE7AMXdXa06NqAPH7HmogBtNEceBbKxlOVElkZAUsXucoTPTEzg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754424301; 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=xmaiEWk9zlhO1ti9tWkWP0gNGMcGWO+beNj99U2xOUQ=; b=VEhw9YdcAbbcubG8LhZnwEfa0Ol2By6s8WirwW4qwPjbtbR4jlECPkOY/wLmYKM81bC5Mji2dJIl+w2ttlfoMbZXhmL69afCQEt2bvRQQm+zPGwHsIzHDpRqf5MfvKHbd5SulLoE0wVvawTdRQIDUe0MWLn3S4SdmAjjGkb1efs= 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 1754424301496131.32992194119015; Tue, 5 Aug 2025 13:05:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ujNtC-0007Zl-85; Tue, 05 Aug 2025 16:04:02 -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 1ujNt4-0007YG-4c for qemu-devel@nongnu.org; Tue, 05 Aug 2025 16:03:54 -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 1ujNt2-0003nd-IH for qemu-devel@nongnu.org; Tue, 05 Aug 2025 16:03:53 -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-457-CPU0aTPXPumfyj-z9r45Yw-1; Tue, 05 Aug 2025 16:03:47 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 936FE18011C1; Tue, 5 Aug 2025 20:03:46 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.80]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2D57530002C6; Tue, 5 Aug 2025 20:03:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754424230; 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=xmaiEWk9zlhO1ti9tWkWP0gNGMcGWO+beNj99U2xOUQ=; b=h6tojWKsNBSTGqWVqLhydPzh52WuuQI0YNJVy075V/HsJrgivEurAQyzUS4l5goiYZTBJi 6HgRO6k5hjY6v4p33eacuHxOVpaRokPIaRR6h1CHJdW2gXd/iRZ+f9QFacK/pOA3lmYOYj Jlvo2FPNzIZZ8MRZxgWsGgUgPx8uwCc= X-MC-Unique: CPU0aTPXPumfyj-z9r45Yw-1 X-Mimecast-MFC-AGG-ID: CPU0aTPXPumfyj-z9r45Yw_1754424226 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Mads Ynddal , Paolo Bonzini , Thomas Huth , Stefan Hajnoczi , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 2/6] tracetool: eliminate trailing whitespace in C format Date: Tue, 5 Aug 2025 21:03:30 +0100 Message-ID: <20250805200334.629493-3-berrange@redhat.com> In-Reply-To: <20250805200334.629493-1-berrange@redhat.com> References: <20250805200334.629493-1-berrange@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=berrange@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: 1754424303328124100 Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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.50.1 From nobody Sun Dec 14 01:53:27 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=1754424335; cv=none; d=zohomail.com; s=zohoarc; b=YAr3+icZ97GFJJzTrFTfLcaaPxS9At9E+tdxDMVwOBviRmm2Ur/D9teiBJqJMJNUm8XM4j5UmFE9yLNUhGBKnewUbDixtCtpx8Lg7tWzsuNCHfueHa3ArgsNxl2ZJq1HY53htLAwPnjgZTFG5OfbN6fkd6wAOlehp4wtMR2MkVQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754424335; 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=l4Viz39R8fy1gQYMFUxzPJ3bFPVk0FYhhZPftT06ZtM=; b=jS+2oz2/9ma08fA846Hrnti6fyi30sXfMpZmVKH0Qftcss/Hj7qmdFep5OLeUDMik/N+GnfMDEop3D7Od87iXZ9TdJKztuix4/1/UOccFZ5W8d2/bYz717iJ8Liu+AWzrtmVn0CKGZY5Q8VJMkZOzwi1T+jNjfPGPYUXHxiJ/D8= 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 1754424334991508.64306476723857; Tue, 5 Aug 2025 13:05:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ujNtG-0007aJ-8E; Tue, 05 Aug 2025 16:04:06 -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 1ujNt4-0007YH-6u for qemu-devel@nongnu.org; Tue, 05 Aug 2025 16:03:56 -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 1ujNt2-0003nj-IY for qemu-devel@nongnu.org; Tue, 05 Aug 2025 16:03:53 -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-679-keEFupJZOcW8rxW6j1--yQ-1; Tue, 05 Aug 2025 16:03:50 -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 8EBB018001D9; Tue, 5 Aug 2025 20:03:49 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.80]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2007D3000199; Tue, 5 Aug 2025 20:03:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754424231; 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=l4Viz39R8fy1gQYMFUxzPJ3bFPVk0FYhhZPftT06ZtM=; b=IlMsWOqBsiM3CVTElChTYxnuT8/GxirjDLTiXYxTz1rMlE5jdqFzzNfrGc0ioKSfOYiqQ+ KcJFWki+7/i8zal5Luk/1FFuxQNoAMXb4YskkQ9nYkQ1R6TE9NjIGySXq8QEpK85T/l4uW HvGhv2s+QGcCDU6xRnApHeX8GzEUDbQ= X-MC-Unique: keEFupJZOcW8rxW6j1--yQ-1 X-Mimecast-MFC-AGG-ID: keEFupJZOcW8rxW6j1--yQ_1754424229 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Mads Ynddal , Paolo Bonzini , Thomas Huth , Stefan Hajnoczi , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 3/6] tracetool: avoid space after "*" in arg types Date: Tue, 5 Aug 2025 21:03:31 +0100 Message-ID: <20250805200334.629493-4-berrange@redhat.com> In-Reply-To: <20250805200334.629493-1-berrange@redhat.com> References: <20250805200334.629493-1-berrange@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=berrange@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: 1754424337526124100 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. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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.50.1 From nobody Sun Dec 14 01:53:27 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=1754424305; cv=none; d=zohomail.com; s=zohoarc; b=Me4c+SZsPRP7KhVfr57VJRM2vOJ79TYEe4InZTWmtU7r4Pzlb7n/STNghR/eZC5pT5/NzpCkquNWi/a3I8NjUjfUvb0D3weTwd/Oxr2gsplowG9rB3tP77o0SzU3LU7odS6aq9Ue1DjRLYk96dhSqHDqV9dsywcDBTIsbdCTGs0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754424305; 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=OWpHY7mQPRkhHLYyZnowaJ8hbg6MdctAvHhf+83bi6s=; b=H3PYS0GHs/SlayrnOEEFy55nhZMr4UYq6iRUYceLMDu0NwUXGsUDMi5RoEo8BKdkK9OWD6rHjbjy0gDXrlVCGrY2XRvpyUJyT+wzSZea+hu3tTtXH/f+F4lpZMqVRVoC3c8z35b4m9eWlrOar0mmqa1kMZ/EtMWub4TFBOycngI= 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 1754424305110615.3606898416016; Tue, 5 Aug 2025 13:05:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ujNtC-0007Zq-8y; Tue, 05 Aug 2025 16:04:02 -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 1ujNt8-0007ZJ-8d for qemu-devel@nongnu.org; Tue, 05 Aug 2025 16:03:58 -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 1ujNt6-0003oB-Gn for qemu-devel@nongnu.org; Tue, 05 Aug 2025 16:03:57 -0400 Received: from mx-prod-mc-02.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-670-d_lbubS_OF-LfrylBa6www-1; Tue, 05 Aug 2025 16:03:53 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A32171936D89; Tue, 5 Aug 2025 20:03:52 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.80]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1443C3000199; Tue, 5 Aug 2025 20:03:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754424235; 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=OWpHY7mQPRkhHLYyZnowaJ8hbg6MdctAvHhf+83bi6s=; b=BZMDWTAKnA1UckN2tZOrSV1bbiDz39zdGZjARGfh9FzH0GvpuOxAWSElvzrCJg7BR7LKRW KPofz93WSYeOlRvnzV6YQYZdb46LD6lBQna3i8nh6erttUwZeEMEX1m1SZRg+apW3sepHz 3e+xd9b2X1x9Ye+ZqmkRKiQWa8d8l/s= X-MC-Unique: d_lbubS_OF-LfrylBa6www-1 X-Mimecast-MFC-AGG-ID: d_lbubS_OF-LfrylBa6www_1754424232 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Mads Ynddal , Paolo Bonzini , Thomas Huth , Stefan Hajnoczi , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 4/6] tracetool: include SPDX-License-Identifier in generated files Date: Tue, 5 Aug 2025 21:03:32 +0100 Message-ID: <20250805200334.629493-5-berrange@redhat.com> In-Reply-To: <20250805200334.629493-1-berrange@redhat.com> References: <20250805200334.629493-1-berrange@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=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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_SBL_CSS=3.335, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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: 1754424307176124100 While these files are auto-generated, a later commit will add reference output to git, so having SPDX-License-Identifier is desirable. Signed-off-by: Daniel P. Berrang=C3=A9 Acked-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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.50.1 From nobody Sun Dec 14 01:53:27 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=1754424341; cv=none; d=zohomail.com; s=zohoarc; b=IhgVIDmNcTQSgXs6iwSLjYKymseGr5QWDIl/wMVlvbIfMJLe/As0daUCkKwY9i6E72k59CBFzJhmu2H/eqDEp2Bz/Wu7U1m7KCmi7zZ02519l4fjMHSNbYkJW5XTMuKSKc0B2vy7HuajO/rpEvWcqt3GgyRBBDkkN8lvdnyw3ns= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754424341; 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=gRnfE5O7Z3n1y90AVxCw4nMOjXLTKuDen5QyZKqLxG8=; b=lrCSYRJtQu50CMA9qvcu2SVGf3LyT5VzVVDTk8hIHrOZ1hy/D/girfDq5pvs06t/l/inlkvSeDwZNnQ98Nu8e/uIMAmWRJc+hhG5YmqxK1p8XRuUtdIop7NT6OpdV10syCjtqbxNco14tZF8y2x4xOsSlTo6v97at2UeLyBl4iY= 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 1754424341478446.4717001335953; Tue, 5 Aug 2025 13:05:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ujNtH-0007bc-Gm; Tue, 05 Aug 2025 16:04:07 -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 1ujNtG-0007ag-3b for qemu-devel@nongnu.org; Tue, 05 Aug 2025 16:04:06 -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 1ujNt9-0003oj-Ox for qemu-devel@nongnu.org; Tue, 05 Aug 2025 16:04:03 -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-651-HNdp8IRONV6hobfKk6cojA-1; Tue, 05 Aug 2025 16:03:57 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 559AB180036E; Tue, 5 Aug 2025 20:03:56 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.80]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 12C5830001BE; Tue, 5 Aug 2025 20:03:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754424239; 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=gRnfE5O7Z3n1y90AVxCw4nMOjXLTKuDen5QyZKqLxG8=; b=CHQ5WKoZVovSlpGfMrzm/TZAL/cFtKLR74vh33Td4aNh8t6DraxNS8izl1KXYg9/DoeQFr LwVQAgzZTKYhsWga9AiYyEQJW5066lTSTE9Eoj9ILEPxi5oqqkkOgFgF1VempJLQVtiQE+ /Ea0MaWFPmS0wHMYJEwSsNSOnsGP/Tc= X-MC-Unique: HNdp8IRONV6hobfKk6cojA-1 X-Mimecast-MFC-AGG-ID: HNdp8IRONV6hobfKk6cojA_1754424236 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Mads Ynddal , Paolo Bonzini , Thomas Huth , Stefan Hajnoczi , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 5/6] tracetool: add test suite for tracetool with reference output Date: Tue, 5 Aug 2025 21:03:33 +0100 Message-ID: <20250805200334.629493-6-berrange@redhat.com> In-Reply-To: <20250805200334.629493-1-berrange@redhat.com> References: <20250805200334.629493-1-berrange@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=berrange@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: 1754424343841124100 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 --- MAINTAINERS | 1 + tests/Makefile.include | 1 + tests/meson.build | 1 + tests/tracetool/dtrace.c | 32 +++++++++ tests/tracetool/dtrace.d | 10 +++ tests/tracetool/dtrace.h | 59 ++++++++++++++++ tests/tracetool/dtrace.log-stap | 15 ++++ tests/tracetool/dtrace.simpletrace-stap | 16 +++++ tests/tracetool/dtrace.stap | 14 ++++ tests/tracetool/ftrace.c | 32 +++++++++ tests/tracetool/ftrace.h | 73 ++++++++++++++++++++ tests/tracetool/log.c | 32 +++++++++ tests/tracetool/log.h | 57 +++++++++++++++ tests/tracetool/meson.build | 25 +++++++ tests/tracetool/simple.c | 61 ++++++++++++++++ tests/tracetool/simple.h | 54 +++++++++++++++ tests/tracetool/syslog.c | 32 +++++++++ tests/tracetool/syslog.h | 57 +++++++++++++++ tests/tracetool/trace-events | 5 ++ tests/tracetool/tracetool-test.py | 92 +++++++++++++++++++++++++ tests/tracetool/ust.c | 32 +++++++++ tests/tracetool/ust.h | 55 +++++++++++++++ tests/tracetool/ust.ust-events-c | 14 ++++ tests/tracetool/ust.ust-events-h | 56 +++++++++++++++ 24 files changed, 826 insertions(+) create mode 100644 tests/tracetool/dtrace.c create mode 100644 tests/tracetool/dtrace.d create mode 100644 tests/tracetool/dtrace.h 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/ftrace.c create mode 100644 tests/tracetool/ftrace.h create mode 100644 tests/tracetool/log.c create mode 100644 tests/tracetool/log.h create mode 100644 tests/tracetool/meson.build create mode 100644 tests/tracetool/simple.c create mode 100644 tests/tracetool/simple.h create mode 100644 tests/tracetool/syslog.c create mode 100644 tests/tracetool/syslog.h create mode 100644 tests/tracetool/trace-events create mode 100755 tests/tracetool/tracetool-test.py create mode 100644 tests/tracetool/ust.c create mode 100644 tests/tracetool/ust.h 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 28cea34271..c08c51f4c6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3556,6 +3556,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/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/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.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/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.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/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/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/ftrace.h b/tests/tracetool/ftrace.h new file mode 100644 index 0000000000..5ce8209bc1 --- /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 3 "trace-events" + trlen =3D snprintf(ftrace_buf, MAX_TRACE_STRLEN, + "test_blah " "Blah context=3D%p filename=3D%s= " "\n" , context, filename); +#line 33 "../../../../../../../../dev/stdout" + 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 4 "trace-events" + trlen =3D snprintf(ftrace_buf, MAX_TRACE_STRLEN, + "test_wibble " "Wibble context=3D%p value=3D%= d" "\n" , context, value); +#line 61 "../../../../../../../../dev/stdout" + 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.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/log.h b/tests/tracetool/log.h new file mode 100644 index 0000000000..c45aa0f913 --- /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 3 "trace-events" + qemu_log("test_blah " "Blah context=3D%p filename=3D%s" "\n", cont= ext, filename); +#line 28 "../../../../../../../../dev/stdout" + } +} + +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 4 "trace-events" + qemu_log("test_wibble " "Wibble context=3D%p value=3D%d" "\n", con= text, value); +#line 48 "../../../../../../../../dev/stdout" + } +} + +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/meson.build b/tests/tracetool/meson.build new file mode 100644 index 0000000000..036cfdff88 --- /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', + meson.current_source_dir() / 'trace-events', + backend], + workdir: meson.current_source_dir(), + suite: ['tracetool']) +endforeach 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/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.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/syslog.h b/tests/tracetool/syslog.h new file mode 100644 index 0000000000..8cb73dd15f --- /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 3 "trace-events" + syslog(LOG_INFO, "test_blah " "Blah context=3D%p filename=3D%s" , = context, filename); +#line 28 "../../../../../../../../dev/stdout" + } +} + +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 4 "trace-events" + syslog(LOG_INFO, "test_wibble " "Wibble context=3D%p value=3D%d" ,= context, value); +#line 48 "../../../../../../../../dev/stdout" + } +} + +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/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..0422069855 --- /dev/null +++ b/tests/tracetool/tracetool-test.py @@ -0,0 +1,92 @@ +#!/usr/bin/python3 +# SPDX-License-Identifier: GPL-2.0-or-later + +import os +from subprocess import check_output +import sys + + +def get_backends(): + return [ + ] + +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, events, backend, fmt): + filename =3D backend + "." + fmt + + 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"] + + args +=3D [events, + "/dev/stdout"] + + actual =3D check_output(args) + + if os.getenv("QEMU_TEST_REGENERATE", False): + print(f"# regenerate {filename}") + with open(filename, "wb") as fh: + fh.write(actual) + + with open(filename, "rb") as fh: + expect =3D fh.read() + + assert(expect =3D=3D actual) + +def test_tracetool(tracetool, events, backend): + fail =3D False + scenarios =3D len(get_formats(backend)) + + print(f"1..{scenarios}") + + num =3D 1 + for fmt in get_formats(backend): + status =3D "not ok" + hint =3D "" + try: + test_tracetool_one(tracetool, events, backend, fmt) + 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 changed)" + finally: + print(f"{status} {num} - {backend}.{fmt}{hint}") + + return fail + + +if __name__ =3D=3D '__main__': + if len(sys.argv) !=3D 4: + argv0 =3D sys.argv[0] + print("syntax: {argv0} TRACE-TOOL TRACE-EVENTS BACKEND", file=3Dsy= s.stderr) + sys.exit(1) + + fail =3D test_tracetool(sys.argv[1], sys.argv[2], sys.argv[3]) + if fail: + sys.exit(1) + sys.exit(0) 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/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/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.50.1 From nobody Sun Dec 14 01:53:27 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=1754424268; cv=none; d=zohomail.com; s=zohoarc; b=KrGDaX7PCrmQtMgn28OGGSs57cl/Huj3M/EHnQJJty57LOscXEYbbdafmA8UPcwsz7WSFyuTwwEjz2FKzZ5sLRIxU1BgXKvmy015OAoquQ+Yt2s/rbP07MoVf4fK4OeJ5r6THdFE5gTF8S4OZQ59PSp5urXpXo+POmppHBRDFz4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754424268; 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=TAjctf33dCLVvtgnAf3YxiafYtxQDQERb+hcj4xrCZI=; b=R8LNQbMwQt5xvUUaWfaHoWI2ClK0Em9j2ph4h4miJ7v/kiE3kAe6XTdH4muVAVm+/xE4Jo3R5HIp20SzNy8agi+9mko+1KHtAVbwEI7fsEYh/5nDwfYPnnKfd1YQlOktHzJ1rmuY2wYEayaybTi4MF+Xc8YzTF0jGTfIaM44G0A= 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 1754424268281875.1833022969992; Tue, 5 Aug 2025 13:04:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ujNtM-0007g8-Tk; Tue, 05 Aug 2025 16:04:12 -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 1ujNtJ-0007em-Ny for qemu-devel@nongnu.org; Tue, 05 Aug 2025 16:04:09 -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 1ujNtF-0003pH-Th for qemu-devel@nongnu.org; Tue, 05 Aug 2025 16:04:09 -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-609-iPJhp5L_PZilkqwCYDh5oQ-1; Tue, 05 Aug 2025 16:04: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 9BAF919560B7; Tue, 5 Aug 2025 20:03:59 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.80]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E3BA930001BE; Tue, 5 Aug 2025 20:03:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754424244; 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=TAjctf33dCLVvtgnAf3YxiafYtxQDQERb+hcj4xrCZI=; b=IJsyBygNpfGrMFJk30dR1VzklQxaWFFnP+vuTOLS6Pc8aZG652BLnuf2HAGO0/+KhEh4eE cbXG1jyV9P7PnGgPIOYcpfgsLUqXOf1xhw3/TNyLvuxAAu8ehAyfEgy1YnUclSBAwzyuDl gWMBFGKpUBd317+3shO+UPmZNR3FoaY= X-MC-Unique: iPJhp5L_PZilkqwCYDh5oQ-1 X-Mimecast-MFC-AGG-ID: iPJhp5L_PZilkqwCYDh5oQ_1754424239 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Mads Ynddal , Paolo Bonzini , Thomas Huth , Stefan Hajnoczi , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 6/6] tracetool: drop the probe "__nocheck__" wrapping Date: Tue, 5 Aug 2025 21:03:34 +0100 Message-ID: <20250805200334.629493-7-berrange@redhat.com> In-Reply-To: <20250805200334.629493-1-berrange@redhat.com> References: <20250805200334.629493-1-berrange@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=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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_SBL_CSS=3.335, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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: 1754424270973124100 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 Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- scripts/tracetool/__init__.py | 1 - scripts/tracetool/format/h.py | 16 +--------------- tests/tracetool/dtrace.h | 18 ++---------------- tests/tracetool/ftrace.h | 24 +++++------------------- tests/tracetool/log.h | 24 +++++------------------- tests/tracetool/simple.h | 18 ++---------------- tests/tracetool/syslog.h | 24 +++++------------------- tests/tracetool/ust.h | 18 ++---------------- 8 files changed, 22 insertions(+), 121 deletions(-) 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 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) -{ - QEMU_TEST_WIBBLE(context, value); -} - static inline void trace_test_wibble(void *context, int value) { - if (true) { - _nocheck__trace_test_wibble(context, value); - } + QEMU_TEST_WIBBLE(context, value); } #endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/tests/tracetool/ftrace.h b/tests/tracetool/ftrace.h index 5ce8209bc1..4c84ebafd9 100644 --- a/tests/tracetool/ftrace.h +++ b/tests/tracetool/ftrace.h @@ -19,14 +19,14 @@ 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]; int unused __attribute__ ((unused)); int trlen; if (trace_event_get_state(TRACE_TEST_BLAH)) { -#line 3 "trace-events" +#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 "../../../../../../../../dev/stdout" @@ -36,38 +36,24 @@ 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]; int unused __attribute__ ((unused)); int trlen; if (trace_event_get_state(TRACE_TEST_WIBBLE)) { -#line 4 "trace-events" +#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 "../../../../../../../../dev/stdout" +#line 54 "../../../../../../../../dev/stdout" 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 c45aa0f913..9d764a100e 100644 --- a/tests/tracetool/log.h +++ b/tests/tracetool/log.h @@ -19,39 +19,25 @@ 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 3 "trace-events" +#line 4 "trace-events" qemu_log("test_blah " "Blah context=3D%p filename=3D%s" "\n", cont= ext, filename); #line 28 "../../../../../../../../dev/stdout" } } =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 4 "trace-events" +#line 5 "trace-events" qemu_log("test_wibble " "Wibble context=3D%p value=3D%d" "\n", con= text, value); -#line 48 "../../../../../../../../dev/stdout" - } -} - -static inline void trace_test_wibble(void *context, int value) -{ - if (true) { - _nocheck__trace_test_wibble(context, value); +#line 41 "../../../../../../../../dev/stdout" } } #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 8cb73dd15f..469e4e7e1d 100644 --- a/tests/tracetool/syslog.h +++ b/tests/tracetool/syslog.h @@ -19,39 +19,25 @@ 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 3 "trace-events" +#line 4 "trace-events" syslog(LOG_INFO, "test_blah " "Blah context=3D%p filename=3D%s" , = context, filename); #line 28 "../../../../../../../../dev/stdout" } } =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 4 "trace-events" +#line 5 "trace-events" syslog(LOG_INFO, "test_wibble " "Wibble context=3D%p value=3D%d" ,= context, value); -#line 48 "../../../../../../../../dev/stdout" - } -} - -static inline void trace_test_wibble(void *context, int value) -{ - if (true) { - _nocheck__trace_test_wibble(context, value); +#line 41 "../../../../../../../../dev/stdout" } } #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) -{ - tracepoint(qemu, test_wibble, context, value); -} - static inline void trace_test_wibble(void *context, int value) { - if (true) { - _nocheck__trace_test_wibble(context, value); - } + tracepoint(qemu, test_wibble, context, value); } #endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ --=20 2.50.1