From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646110; cv=none; d=zohomail.com; s=zohoarc; b=XCeFhGQEHliQy6lUISYEK6wE1n3LuWonJrgJwEDh2t5gpzKZD2ZFKm/xdPMW5h3DmxQDwfiUoDF6vcWRkkPqBaYZ8Au1+ablqJILIHbsa/tWAZCsTpHErBemikuL7+MhaoD0wggk3knwj/ygEzX5JD8D2BKUGXSUlyTISBvzHgo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646110; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=TqkKXu2f79+4gbliMkvun6ZA/q+B5xT3gEohpgAcSnM=; b=OZIsb2XhTERqu2xyZID5KEUqtIPFt/E2evgD6hjnoaY7Ww/xq2PP4+0hD5WHlLbrOu8Yne9sjl7nbw0AzQjB5dKK2jNzEC4k5G0YY9WSYsp6oAEklnfo74Ztmz+bnUz01rf7ojviVesjW0+k3kWpomqlFi/VpLNgyVNQEQCOBvY= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793646110678790.1173493028341; Mon, 2 Nov 2026 11:01:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNxHV-0001qj-IH; Mon, 02 Nov 2026 14:01:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxHP-0001py-7A for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:01:15 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxHN-0008AV-KW for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:01:14 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-584-yjLHV0h9PfS3EB3Hwtg2Tw-1; Mon, 02 Nov 2026 14:01:09 -0500 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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D03FE1955F7F; Mon, 2 Nov 2026 19:01:05 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2365530000E3; Mon, 2 Nov 2026 19:01:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646072; 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=TqkKXu2f79+4gbliMkvun6ZA/q+B5xT3gEohpgAcSnM=; b=ZDbcdYemFiZSsGjGEl5csm1BkMzrn2rWIdo63+c+rNBzOKVOVS6OpjyStWKEgi2ygpvGxM gw2p6eNwWAQTVURGHSzbUq5az2QRqqJnmJfDKf/p5csRnsGjt+3+XjoofmL/0dkAueCgMN szrC+Jb9n/4CENsONKM4rAwaDn+14VE= X-MC-Unique: yjLHV0h9PfS3EB3Hwtg2Tw-1 X-Mimecast-MFC-AGG-ID: yjLHV0h9PfS3EB3Hwtg2Tw_1793646066 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 01/25] osdep: add 'ignore_value(x)' macro Date: Mon, 2 Nov 2026 13:58:07 -0500 Message-ID: <20261102185831.1880189-2-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-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=lists1p.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: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646113361158500 From: Daniel P. Berrang=C3=A9 Functions annotated with 'warn_unused_result' cannot be cast to (void) to silence the compiler. Add the ignore_value() macro which tricks the compiler into thinking the result is genuinely used, avoiding the need for manual workarounds where the return value is intentionally ignored. This clever macro is derived from one originating with the GNULIB project: https://gitweb.git.savannah.gnu.org/gitweb/?p=3Dgnulib.git;a=3Dblob;f=3Dl= ib/ignore-value.h;hb=3DHEAD but simplified since we don't need compat with old GCC and optimizing on clang is overkill. Reviewed-by: Eric Blake Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-2-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- include/qemu/osdep.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 50c7ce33b6a..b27d159d5bb 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -251,6 +251,14 @@ extern "C" { #endif =20 =20 +/* + * Merely casting to (void) is not sufficient for functions + * annotated with the "warn_unused_result" attribute + */ +#define ignore_value(x) \ + (__extension__ ({ __typeof__(x) __x =3D (x); (void) __x; })) + + /* * For mingw, as of v6.0.0, the function implementing the assert macro is * not marked as noreturn, so the compiler cannot delete code following an --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646119; cv=none; d=zohomail.com; s=zohoarc; b=jkTudfIvBm0X7Sd1pTd70JMhcin91hYX7mqvnBMzMcT8wXWeAVaszRq30Zz3O5jycF9xkoWrbnWbwoeZ6YYpRXG0HTASvb3PhuV2fbiCBqAsBPJ218Uq4KlvJ/U4YGXohTi6CvAghiLwNVMU5YQi54aGM2lqPNO8Wo+odaSNjIg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646119; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jKP5HFz810ebf9alfWmuhAqqhtocmxxt5vjo0KJQomg=; b=TbT3hskKwv/w5nf6wGywYVJyI2h6hmnp/BMj7o8TLY09OMurhzs0P4FPZ/mhUd/u5rF8VLOEI4jMJ9Ihz3akCjqLhrz84zBzkyt9NZKmSf42qXd3XFB2U+aYW0wKWVRoPzWx3wt634KeYKNSps6azab39C2Ok4mPyqxR+cE7TMI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1793646119084899.7591247026719; Mon, 2 Nov 2026 11:01:59 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1468584.1677684 (Exim 4.92) (envelope-from ) id 1xNxHg-0007tg-9z; Mon, 02 Nov 2026 19:01:32 +0000 Received: by outflank-mailman (output) from mailman id 1468584.1677684; Mon, 02 Nov 2026 19:01:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHg-0007su-6T; Mon, 02 Nov 2026 19:01:32 +0000 Received: by outflank-mailman (input) for mailman id 1468584; Mon, 02 Nov 2026 19:01:30 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHe-0007bM-II for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 19:01:30 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xNxHd-000KSU-VT for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 20:01:29 +0100 Received: from [10.42.69.10] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ae8ddf5-bab6-0a2a0a5309dd-0a2a450ab18a-34 for ; Mon, 02 Nov 2026 20:01:29 +0100 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ae8de08-f2d2-0a2a450a0019-aa0a817cb279-3 for ; Mon, 02 Nov 2026 20:01:29 +0100 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-313-O__lPeZ8OP6EyAo73df12Q-1; Mon, 02 Nov 2026 14:01:25 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EF7571954AC2; Mon, 2 Nov 2026 19:01:22 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A5A451800446; Mon, 2 Nov 2026 19:01:22 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646088; 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=jKP5HFz810ebf9alfWmuhAqqhtocmxxt5vjo0KJQomg=; b=dEM0IBrVz1IKjnhPAg10oKciC7Ipi9TjsfkJNAZAz+h4cZYMcs1QGk1nS9ny2ybNveu8hw SEzTvUExOr86hBBY1EXWvRBTz+fHBfVipP2mPTOiTxbjxuCASw4MYOh6nX/NWfg5Xq4yBO 9Vog3k9yWsH7DyOYAFsUmbRE3brDeKY= X-MC-Unique: O__lPeZ8OP6EyAo73df12Q-1 X-Mimecast-MFC-AGG-ID: O__lPeZ8OP6EyAo73df12Q_1793646083 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 02/25] trace: use 'ignore_value()' instead of a dummy variable Date: Mon, 2 Nov 2026 13:58:08 -0500 Message-ID: <20261102185831.1880189-3-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-MFC-PROC-ID: biIa1pgL0_rTm-2xbtXQXzP7KIPtrt-jqyxj6R4Kc_0_1793646083 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-4011c0/1793646089-504CFCFC-114BAB7A/35/111497 X-purgate-type: clean X-purgate-size: 2669 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646120197154100 From: Daniel P. Berrang=C3=A9 This pattern is more concise than using a dummy variable which in turn needs annotating as unused. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-3-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- trace/ftrace.c | 3 +-- trace/simple.c | 9 ++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/trace/ftrace.c b/trace/ftrace.c index 6875faedb9c..c1ed6ad4454 100644 --- a/trace/ftrace.c +++ b/trace/ftrace.c @@ -41,7 +41,6 @@ static int find_mount(char *mount_point, const char *fsty= pe) void ftrace_write(const char *fmt, ...) { char ftrace_buf[MAX_TRACE_STRLEN]; - int unused __attribute__ ((unused)); int trlen; va_list ap; =20 @@ -50,7 +49,7 @@ void ftrace_write(const char *fmt, ...) va_end(ap); =20 trlen =3D MIN(trlen, MAX_TRACE_STRLEN - 1); - unused =3D write(trace_marker_fd, ftrace_buf, trlen); + ignore_value(write(trace_marker_fd, ftrace_buf, trlen)); } =20 bool ftrace_init(void) diff --git a/trace/simple.c b/trace/simple.c index c0aba00cb7f..e148ca44530 100644 --- a/trace/simple.c +++ b/trace/simple.c @@ -163,7 +163,6 @@ static gpointer writeout_thread(gpointer opaque) } dropped; unsigned int idx =3D 0; int dropped_count; - size_t unused __attribute__ ((unused)); uint64_t type =3D TRACE_RECORD_TYPE_EVENT; =20 for (;;) { @@ -179,13 +178,13 @@ static gpointer writeout_thread(gpointer opaque) } while (!g_atomic_int_compare_and_exchange(&dropped_events, dropped_count, 0)); dropped.rec.arguments[0] =3D dropped_count; - unused =3D fwrite(&type, sizeof(type), 1, trace_fp); - unused =3D fwrite(&dropped.rec, dropped.rec.length, 1, trace_f= p); + ignore_value(fwrite(&type, sizeof(type), 1, trace_fp)); + ignore_value(fwrite(&dropped.rec, dropped.rec.length, 1, trace= _fp)); } =20 while (get_trace_record(idx, &recordptr)) { - unused =3D fwrite(&type, sizeof(type), 1, trace_fp); - unused =3D fwrite(recordptr, recordptr->length, 1, trace_fp); + ignore_value(fwrite(&type, sizeof(type), 1, trace_fp)); + ignore_value(fwrite(recordptr, recordptr->length, 1, trace_fp)= ); writeout_idx +=3D recordptr->length; free(recordptr); /* don't use g_free, can deadlock when traced= */ idx =3D writeout_idx % TRACE_BUF_LEN; --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646093; cv=none; d=zohomail.com; s=zohoarc; b=XpPExqueZilEFySDs8n/5x4OLXXDTI+5/jOl6LLCrqfn+CER98tuxM14d2SdnHDLg/7QFdsjx2WaC8UdUCz6s+SZf4KGOcVkKC4QvAmSDU/lui1XBbFNhgNnbrBtKAWL1+MV2BYkQVRuGgdGPiN4tFsQOnMxBiE3qyC4D6QpbT8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646093; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hPW7K8e9PhjSibqn/e/tSwEgnDdS9m32/bMUTsYxbh0=; b=bkDG1o21lyp0tGZ8mOlSsxLOymjphfEJhN933v/QSpiF2GJ1TOySyCjEWgJWj8TY80bv2/eSUJB4LG9R4DiOZubzM3wa1/y8qtF20i4Fb8MfE9W+aidj8H9xLNMvOwfZdC0MgDGr3bhYXdA4GmkueEOFzb/U1/YcSeKoFH2f0dE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1793646093968716.6156336309284; Mon, 2 Nov 2026 11:01:33 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1468576.1677645 (Exim 4.92) (envelope-from ) id 1xNxHU-0006le-0v; Mon, 02 Nov 2026 19:01:20 +0000 Received: by outflank-mailman (output) from mailman id 1468576.1677645; Mon, 02 Nov 2026 19:01:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHT-0006lV-UD; Mon, 02 Nov 2026 19:01:19 +0000 Received: by outflank-mailman (input) for mailman id 1468576; Mon, 02 Nov 2026 19:01:17 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHR-0006YP-U2 for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 19:01:17 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xNxHR-00Bp4D-B2 for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 20:01:17 +0100 Received: from [10.42.69.1] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ae8ddf1-8faa-0a2a0a5109dd-0a2a4501a6be-38 for ; Mon, 02 Nov 2026 20:01:17 +0100 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ae8ddfc-5984-0a2a45010019-aa0a857cb4b7-3 for ; Mon, 02 Nov 2026 20:01:17 +0100 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-668-SQUIwsUvNE--qaZtLf92vw-1; Mon, 02 Nov 2026 14:01:14 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BA30F1802677; Mon, 2 Nov 2026 19:01:11 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AB9321955F43; Mon, 2 Nov 2026 19:01:10 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646075; 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=hPW7K8e9PhjSibqn/e/tSwEgnDdS9m32/bMUTsYxbh0=; b=UFtrRsenlEDiaan64AciE2NgrxqKfRJ6OnoTun77Xli6EjHaZ02k2NDPDd96CfRj+9MmBd hQsDazaIsQoNWX8imIMzGI93bwOUr+0L6GW6jO/9b2wb15Jn4guX4jryyTL9KIVsi52Dtj 6NSmRAJuIDRnqku+r4lh5exNCdykAhE= X-MC-Unique: SQUIwsUvNE--qaZtLf92vw-1 X-Mimecast-MFC-AGG-ID: SQUIwsUvNE--qaZtLf92vw_1793646072 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 03/25] trace: fix handling of char** in UST backend Date: Mon, 2 Nov 2026 13:58:09 -0500 Message-ID: <20261102185831.1880189-4-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-MFC-PROC-ID: gfV1ScxhUDwx-mrM-LFK8V5J76YabFFkvGvKU3NC-Qw_1793646072 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-d62444/1793646077-C4B45757-1D870473/35/111497 X-purgate-type: clean X-purgate-size: 1519 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646098007154100 From: Daniel P. Berrang=C3=A9 The UST trace backend fails to compile on version 2.14.0, as we pass a "char **" arg as to ctf_string(), which only expects 'char *'. It should instead be treated the same way as generic pointers, and emitted as hex. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-4-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- scripts/tracetool/format/ust_events_h.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/tracetool/format/ust_events_h.py b/scripts/tracetool/f= ormat/ust_events_h.py index cee7970a403..76c883bc5c0 100644 --- a/scripts/tracetool/format/ust_events_h.py +++ b/scripts/tracetool/format/ust_events_h.py @@ -72,7 +72,9 @@ def generate(events, backend, group): names =3D e.args.names() fmts =3D e.formats() for t,n,f in zip(types, names, fmts): - if ('char *' in t) or ('char*' in t): + if ('char **' in t) or ('char**' in t): + out(' ctf_integer_hex(' + t + ', ' + n + ', ' + = n + ')') + elif ('char *' in t) or ('char*' in t): out(' ctf_string(' + n + ', ' + n + ')') elif ("%p" in f) or ("x" in f) or ("PRIx" in f): out(' ctf_integer_hex('+ t + ', ' + n + ', ' + n= + ')') --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646106; cv=none; d=zohomail.com; s=zohoarc; b=JqSgzmKdtousw04GCNO7FFdLZVIFFEe2piNc/MgVwtcAEp7R1OLWnQAcIT0FMBGr7+x+W9ky4umqRx3NxHnLoKTr67/FuePS1h3ejcUPXNApSM8ktbqudB27ID3CcEffPzzhaWNuTvoA72isVRCgQF3qPs2MsxPaW+vyVCSUkiY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646106; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VsdKm1LSZTE764H3BvnnumzwQKzcHlHW/sITvbevc3A=; b=UH3EqPZ9ff9D/vPGJucRK8SwzFaYGm7esBb4s4ycqWLVB/LqpuxfrRqgquaRcSjH8+/s/JaKrh1FLx1YcJ87s/A2Sfn8dGRfV5uymx4LnDYH8d3mNiDuF0/mLRDMvRZ4xputfA4YokxhQIYPt0nsFYfv6NlA3t0fe/5eoutxqIg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1793646106857196.43495374914494; Mon, 2 Nov 2026 11:01:46 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1468577.1677655 (Exim 4.92) (envelope-from ) id 1xNxHX-000711-7R; Mon, 02 Nov 2026 19:01:23 +0000 Received: by outflank-mailman (output) from mailman id 1468577.1677655; Mon, 02 Nov 2026 19:01:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHX-00070s-4M; Mon, 02 Nov 2026 19:01:23 +0000 Received: by outflank-mailman (input) for mailman id 1468577; Mon, 02 Nov 2026 19:01:21 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHV-0006z4-U1 for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 19:01:21 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xNxHV-000wMH-Al for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 20:01:21 +0100 Received: from [10.42.69.7] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ae8dddf-2eae-0a2a0a5409dd-0a2a450793c4-44 for ; Mon, 02 Nov 2026 20:01:21 +0100 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ae8de00-b4ea-0a2a45070019-aa0a857c9a01-3 for ; Mon, 02 Nov 2026 20:01:21 +0100 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-676-HuUp_AYBPzS_FAxpXoe8Qw-1; Mon, 02 Nov 2026 14:01:15 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D629E195606A; Mon, 2 Nov 2026 19:01:13 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B5F621800446; Mon, 2 Nov 2026 19:01:12 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646080; 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=VsdKm1LSZTE764H3BvnnumzwQKzcHlHW/sITvbevc3A=; b=hm39QIWA+rJyjbSL7zyaOUUVBrz2juEAiCcyU2LUDmYs9r5LDntZSz7uox6kO3mTGln+Ft WFbPeFmTvV1RRN0wIqBO8Hx9OgsDPimC0i+LKS5quYY66TvHQw6HQRa9vNoMvp7YqVj5M+ yQPzUkqUM5QM1n8HfAX3A6M0ce74hJ4= X-MC-Unique: HuUp_AYBPzS_FAxpXoe8Qw-1 X-Mimecast-MFC-AGG-ID: HuUp_AYBPzS_FAxpXoe8Qw_1793646074 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 04/25] hw/xen: replace "long unsigned int" with "unsigned long " for dtrace Date: Mon, 2 Nov 2026 13:58:10 -0500 Message-ID: <20261102185831.1880189-5-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-MFC-PROC-ID: B1qHtLydD2Ac02RTogxkSlMBa3TnzUz2BjYaCPPqiSQ_1793646074 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-ef75cf/1793646081-A54C3AE4-D4F8B571/35/111497 X-purgate-type: clean X-purgate-size: 1986 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646107446158500 From: Daniel P. Berrang=C3=A9 dtrace (or at least systemtap's fake "dtrace" binary) doesn't like to see "int" and "long" together in the typename, it just wants the bare "long". Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-5-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/xen/trace-events | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xen/trace-events b/hw/xen/trace-events index b67942d07b4..a31983ce1d3 100644 --- a/hw/xen/trace-events +++ b/hw/xen/trace-events @@ -57,8 +57,8 @@ cpu_ioreq_config_read(void *req, uint32_t sbdf, uint32_t = reg, uint32_t size, uin cpu_ioreq_config_write(void *req, uint32_t sbdf, uint32_t reg, uint32_t si= ze, uint32_t data) "I/O=3D%p sbdf=3D0x%x reg=3D%u size=3D%u data=3D0x%x" cpu_get_ioreq_from_shared_memory_req_not_ready(int state, int data_is_ptr,= uint64_t addr, uint64_t data, uint32_t count, uint32_t size) "I/O request = not ready: 0x%x, ptr: 0x%x, port: 0x%"PRIx64", data: 0x%"PRIx64", count: %u= , size: %u" xen_main_loop_prepare_init_cpu(int id, void *cpu) "cpu_by_vcpu_id[%d]=3D%p" -xen_map_ioreq_server_shared_page(long unsigned int ioreq_pfn) "shared page= at pfn 0x%lx" -xen_map_ioreq_server_buffered_io_page(long unsigned int ioreq_pfn) "buffer= ed io page at pfn 0x%lx" +xen_map_ioreq_server_shared_page(unsigned long ioreq_pfn) "shared page at = pfn 0x%lx" +xen_map_ioreq_server_buffered_io_page(unsigned long ioreq_pfn) "buffered i= o page at pfn 0x%lx" xen_map_ioreq_server_buffered_io_evtchn(int bufioreq_evtchn) "buffered io = evtchn is 0x%x" destroy_hvm_domain_cannot_acquire_handle(void) "Cannot acquire xenctrl han= dle" destroy_hvm_domain_failed_action(const char *action, int sts, char *errno_= s) "xc_domain_shutdown failed to issue %s, sts %d, %s" --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646417; cv=none; d=zohomail.com; s=zohoarc; b=ToruMtW+ZXL0V8O0kCfIMgDtOv7Jkg3RPeHddHXYLPo8iIiCam1kZpzlDVV2KIwmNeNTMmy/HH7lvdMBw0jcJs+/OmWUGE8f88izEgr1nXShPJUWunIHf4LO03GxNJniAAUqOAuOHpRXV6uuYfGfNmw8Xd08n0EIuR5hk7nIm2U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646417; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5CRUR1O7jhB6e7y26qawG8i1UCupwuJ1vSueU290k1s=; b=hmkBapKY3+wM5NDgeGrF4tYZjEr+o0tLkD8wJNY820H0nyhpovNhvx2BVy/adWG1P5s/SoSc069HiSJA4HVKEImG+5HJvPqz2mzKNZtwhAI8Ww/ujVbfU12a7xjTQms1uekOMxdQ4EFMijJxwg7fenLSFvA3kTGILRKGgFiHc7s= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793646417870295.0320405975183; Mon, 2 Nov 2026 11:06:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNxK7-0005xI-M5; Mon, 02 Nov 2026 14:04:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxIY-0002mO-91 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:02:33 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxIU-0008LH-C8 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:02:25 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-121-uh50v2QHMQmd1JjEN_XTYA-1; Mon, 02 Nov 2026 14:01:45 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C3E0B180AC43; Mon, 2 Nov 2026 19:01:15 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C9B0B1800347; Mon, 2 Nov 2026 19:01:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646139; 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=5CRUR1O7jhB6e7y26qawG8i1UCupwuJ1vSueU290k1s=; b=MWyknj7tJ0s5NUNsNHE04B/iKgf+36zp7MlCX/kHL172cxfhcdj53Lz4Pt4okXYQHk2Vey hDAjio5PUDIKw97TSTTE0b5I6FPJnP1a6AsTwtR9L+W6oZ3tp4Ib4/w3TXCxNqkG0Lqswy j8QrcAN/5m4G1VGCoDCClyxV2CiJIFs= X-MC-Unique: uh50v2QHMQmd1JjEN_XTYA-1 X-Mimecast-MFC-AGG-ID: uh50v2QHMQmd1JjEN_XTYA_1793646076 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 05/25] trace: block use of "long int" for dtrace Date: Mon, 2 Nov 2026 13:58:11 -0500 Message-ID: <20261102185831.1880189-6-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-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=lists1p.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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646421049154100 From: Daniel P. Berrang=C3=A9 dtrace (or at least systemtap's fake "dtrace" binary) complains about a syntax error due to use of "long int", as it wants a bare "long" type Enforce this when parsing the trace-events files. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-6-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- scripts/tracetool/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py index 61ba6f1ba8c..6ed7cdd6ce4 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -177,6 +177,11 @@ def out(*lines, **kwargs): =20 def validate_type(name): bits =3D name.split(" ") + + if "long" in bits and "int" in bits: + raise ValueError("Invalid use of 'int' typename in %s, " + "use 'long' alone" % name) + for bit in bits: bit =3D re.sub(r"\*", "", bit) if bit =3D=3D "": --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646097; cv=none; d=zohomail.com; s=zohoarc; b=KudpR9+fcWrchh4afpaPHfSojGCC9Ra9jJFr10u+IvZswX8d/WqCnvxO96AGS31pOxpiqsPsmlBY2VSX/03h5pHLm/GQebloT9BfJPr3D6i/L9DZa83xB0oDQw/9KHb0SnFwueicRfHPNZDacIzFsP+hVWVF5EbwyFx10dst7rc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646097; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8UH5nYrF7hB5atKv+0kCjyLnZFXkjL/Cltw+H/p8G/s=; b=ixtJbfNyLC1uhOXy0A7yxKjvNijFGS2GzV3O6G+3hieHW8Hehn9YZl8qVg6cURNKCcX9UwNnnkZ/k9LE2uuan9tmjpU9UWkulGualY3Iqbtz2wv3iob0Wlkf8E1FyONEpcBpVBlAYhr9zCwHyO6ZfXP4xk5ATnIKp3Bjz7WBU3E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1793646097742610.6809716690507; Mon, 2 Nov 2026 11:01:37 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1468578.1677664 (Exim 4.92) (envelope-from ) id 1xNxHY-0007FD-EP; Mon, 02 Nov 2026 19:01:24 +0000 Received: by outflank-mailman (output) from mailman id 1468578.1677664; Mon, 02 Nov 2026 19:01:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHY-0007Ex-Al; Mon, 02 Nov 2026 19:01:24 +0000 Received: by outflank-mailman (input) for mailman id 1468578; Mon, 02 Nov 2026 19:01:23 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHX-00070g-5m for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 19:01:23 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xNxHW-000wMH-Iz for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 20:01:22 +0100 Received: from [10.42.69.7] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ae8dddf-2eae-0a2a0a5409dd-0a2a450793c4-48 for ; Mon, 02 Nov 2026 20:01:22 +0100 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ae8de01-b4ea-0a2a45070019-aa0a817c546b-3 for ; Mon, 02 Nov 2026 20:01:22 +0100 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-271-pri0MwLOPtaWKx9vB82Row-1; Mon, 02 Nov 2026 14:01:19 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3D0381954B12; Mon, 2 Nov 2026 19:01:17 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D03401800446; Mon, 2 Nov 2026 19:01:16 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646080; 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=8UH5nYrF7hB5atKv+0kCjyLnZFXkjL/Cltw+H/p8G/s=; b=eBgD/wChEiM6Oefh9bmq/aaN1KR3wfo+g47xA5CydvKUUYZXdWXMlSsbEQXTzoFCu+//15 lYkI77Nyy7iVYsHAdWNMYWQE1x3lZcB0+n5e42JOGd9GfpfsQiNDTUJuOxoJVCtImOgJWV JC5zeARynLVyxBoEe/b3caRFYwsWQdg= X-MC-Unique: pri0MwLOPtaWKx9vB82Row-1 X-Mimecast-MFC-AGG-ID: pri0MwLOPtaWKx9vB82Row_1793646077 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 06/25] trace: drop unused trace_event_set_state_dynamic_init() Date: Mon, 2 Nov 2026 13:58:12 -0500 Message-ID: <20261102185831.1880189-7-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-MFC-PROC-ID: CniuZUKFEtWnhIsNWysS2RTh4eXVGZXrbTFAYtmPgbA_1793646077 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-ef75cf/1793646082-378D1AE4-550CB860/35/111497 X-purgate-type: clean X-purgate-size: 2438 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646100131154100 From: Daniel P. Berrang=C3=A9 The use of this method was mistakenly dropped in 0d4e995c73. When the 'vcpu' property was dropped, however, this became functionally identical to trace_event_set_state_dynamic(). Fixes: 0d4e995c7368 ("trace: convert code to use event iterators") Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-7-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- trace/event-internal.h | 2 -- stubs/trace-control.c | 5 ----- trace/control-target.c | 21 --------------------- 3 files changed, 28 deletions(-) diff --git a/trace/event-internal.h b/trace/event-internal.h index 0c24e01b521..1d57b0ff1b5 100644 --- a/trace/event-internal.h +++ b/trace/event-internal.h @@ -37,6 +37,4 @@ typedef struct TraceEvent { uint16_t *dstate; } TraceEvent; =20 -void trace_event_set_state_dynamic_init(TraceEvent *ev, bool state); - #endif /* TRACE__EVENT_INTERNAL_H */ diff --git a/stubs/trace-control.c b/stubs/trace-control.c index b428f34c878..3f196835db0 100644 --- a/stubs/trace-control.c +++ b/stubs/trace-control.c @@ -11,11 +11,6 @@ #include "trace/control.h" =20 =20 -void trace_event_set_state_dynamic_init(TraceEvent *ev, bool state) -{ - trace_event_set_state_dynamic(ev, state); -} - void trace_event_set_state_dynamic(TraceEvent *ev, bool state) { bool state_pre; diff --git a/trace/control-target.c b/trace/control-target.c index 57ceac21084..24d9b7abbde 100644 --- a/trace/control-target.c +++ b/trace/control-target.c @@ -10,27 +10,6 @@ #include "qemu/osdep.h" #include "trace/control.h" =20 - -void trace_event_set_state_dynamic_init(TraceEvent *ev, bool state) -{ - bool state_pre; - assert(trace_event_get_state_static(ev)); - /* - * We ignore the "vcpu" property here, since no vCPUs have been created - * yet. Then dstate can only be 1 or 0. - */ - state_pre =3D *ev->dstate; - if (state_pre !=3D state) { - if (state) { - trace_events_enabled_count++; - *ev->dstate =3D 1; - } else { - trace_events_enabled_count--; - *ev->dstate =3D 0; - } - } -} - void trace_event_set_state_dynamic(TraceEvent *ev, bool state) { assert(trace_event_get_state_static(ev)); --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646216; cv=none; d=zohomail.com; s=zohoarc; b=OMiQVlueSJDZYd7wAr5iQRme0scc/l1KgXcpfj2EQHX+Vg73lVR8QK6WDzF25WKzk4K7mWkCLjAAU+QXEQYTuiPE7buzTyWnUEHDeEyoUGS7PfOMEwSO3LpnwSpgu7tPqw6Ljs6TJib65RZczQAoxTuHQ6/rs8ujWglNx0gdU1s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646216; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=s2fQy26Nzh4pevOCqiRqluICNBTrWSgxg/L8ugtFtns=; b=QKyh+Q8q2f5YbhWHHcJC+FXCe0b9WTyMisytyfmNds4QLJEZNj7qMTYcuUhNK9Sbh0lZgnM2Sds4WfQ3nNJbv0FvGynrqTRWYQ7Yyh9hsgChhnxfP2gwol9JhuQkNFUNvbLSS26l+kY2TJPniDdtiBc953bUw73zWLHhzSZDYGs= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793646216002366.84258472023646; Mon, 2 Nov 2026 11:03:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNxIr-0003P2-SD; Mon, 02 Nov 2026 14:02:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxHY-0001sj-CY for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:01:31 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxHW-0008CI-Ej for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:01:24 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-164-FYOnKF7dNwWxwGciaH3gdA-1; Mon, 02 Nov 2026 14:01:20 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 70EEF19560B1; Mon, 2 Nov 2026 19:01:18 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 243541800765; Mon, 2 Nov 2026 19:01:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646081; 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=s2fQy26Nzh4pevOCqiRqluICNBTrWSgxg/L8ugtFtns=; b=jOFD199n83fASCknFL/UKV5zUxEulOb9Aatef50Vy6vZLSjA/biSo9aqwhdPgewzCs/B5Z NKwxYgZ8Ks8NOHUjDUFdBe5Ri4eX7eIb/xSXEQPIA2TpGHJSmMF3s2Hged4LGVYWBBSBJE kp11AQKhUflGtUmpow0vE2kYxgPwp4M= X-MC-Unique: FYOnKF7dNwWxwGciaH3gdA-1 X-Mimecast-MFC-AGG-ID: FYOnKF7dNwWxwGciaH3gdA_1793646078 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 07/25] trace: remove obsolete references to vcpu property Date: Mon, 2 Nov 2026 13:58:13 -0500 Message-ID: <20261102185831.1880189-8-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-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=lists1p.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: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646217834154100 From: Daniel P. Berrang=C3=A9 The 'vcpu' property for trace events was removed 2 years ago but some mentions of it remain in the code. Fixes: 7ffc4894a63b ("trace: Remove deprecated 'vcpu' field from QMP trace = events") Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-8-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- trace/control.h | 12 ------------ trace/event-internal.h | 11 ----------- trace/control-target.c | 6 ------ trace/control.c | 6 ------ 4 files changed, 35 deletions(-) diff --git a/trace/control.h b/trace/control.h index 6754bfe052b..20033fb6669 100644 --- a/trace/control.h +++ b/trace/control.h @@ -139,8 +139,6 @@ static bool trace_event_get_state_static(TraceEvent *ev= ); * trace_event_get_state_dynamic: * * Get the dynamic tracing state of an event. - * - * If the event has the 'vcpu' property, gets the OR'ed state of all vCPUs. */ static bool trace_event_get_state_dynamic(TraceEvent *ev); =20 @@ -149,8 +147,6 @@ static bool trace_event_get_state_dynamic(TraceEvent *e= v); * * Set the dynamic tracing state of an event. * - * If the event has the 'vcpu' property, sets the state on all vCPUs. - * * Pre-condition: trace_event_get_state_static(ev) =3D=3D true */ void trace_event_set_state_dynamic(TraceEvent *ev, bool state); @@ -203,14 +199,6 @@ extern QemuOptsList qemu_trace_opts; */ void trace_opt_parse(const char *optstr); =20 -/** - * trace_get_vcpu_event_count: - * - * Return the number of known vcpu-specific events - */ -uint32_t trace_get_vcpu_event_count(void); - - #include "control-internal.h" =20 #endif /* TRACE__CONTROL_H */ diff --git a/trace/event-internal.h b/trace/event-internal.h index 1d57b0ff1b5..cc095a6ad54 100644 --- a/trace/event-internal.h +++ b/trace/event-internal.h @@ -10,12 +10,6 @@ #ifndef TRACE__EVENT_INTERNAL_H #define TRACE__EVENT_INTERNAL_H =20 -/* - * Special value for TraceEvent.vcpu_id field to indicate - * that the event is not VCPU specific - */ -#define TRACE_VCPU_EVENT_NONE ((uint32_t)-1) - /** * TraceEvent: * @id: Unique event identifier. @@ -23,11 +17,6 @@ * @sstate: Static tracing state. * @dstate: Dynamic tracing state * - * Interpretation of @dstate depends on whether the event has the 'vcpu' - * property: - * - false: Boolean value indicating whether the event is active. - * - true : Integral counting the number of vCPUs that have this event ena= bled. - * * Opaque generic description of a tracing event. */ typedef struct TraceEvent { diff --git a/trace/control-target.c b/trace/control-target.c index 24d9b7abbde..87b0f5037df 100644 --- a/trace/control-target.c +++ b/trace/control-target.c @@ -14,12 +14,6 @@ void trace_event_set_state_dynamic(TraceEvent *ev, bool = state) { assert(trace_event_get_state_static(ev)); =20 - /* - * There is no longer a "vcpu" property, dstate can only be 1 or - * 0. With it, we haven't instantiated any vCPU yet, so we will - * set a global state instead, and trace_init_vcpu will reconcile - * it afterwards. - */ bool state_pre =3D *ev->dstate; if (state_pre !=3D state) { if (state) { diff --git a/trace/control.c b/trace/control.c index 49f0a4c5cda..6971157cbe7 100644 --- a/trace/control.c +++ b/trace/control.c @@ -37,7 +37,6 @@ typedef struct TraceEventGroup { static TraceEventGroup *event_groups; static size_t nevent_groups; static uint32_t next_id; -static uint32_t next_vcpu_id; #ifdef CONFIG_TRACE_SIMPLE static bool init_trace_on_startup; #endif @@ -304,8 +303,3 @@ void trace_opt_parse(const char *optstr) trace_opts_file =3D g_strdup(qemu_opt_get(opts, "file")); qemu_opts_del(opts); } - -uint32_t trace_get_vcpu_event_count(void) -{ - return next_vcpu_id; -} --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646210; cv=none; d=zohomail.com; s=zohoarc; b=jUxCB0/UL8wbA7nEgq0Xvf7nDMB7e8Xxd11ugn56hndeLvzqH5Ye8yWl/JDB4/3Bb1uRn5t5P9tR8iMzZe7VEqkRl1zNnaRfMzbFczfxuywyd0f4qofDNBjpHGiKFu+ok0H1FDhMaF1y7rF6rXbZgeNDd9EBLLioqyQvMWa0m4E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646210; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1+Fb/pNuDVJKjUmAlJEVqK84jM77qkTAumiP1SiO8JU=; b=bV1nGnbxg12+neRXdtx/MSSa+cGCfL38qFl9DHr5znCxRx6JRA0D/5/NGN0bf2WuUZfnZBLVAJ1dZF1gHlvAqHYcZRvx9BbKKlzPn+D3DIxCOZ+h1VXUb9U9Bfkc9Ry4UCzVkN6lObisCQIgDttSHIOIZuj+8PANK8N/bGuWLeo= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793646210392977.7521052107764; Mon, 2 Nov 2026 11:03:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNxIp-0003Ew-OV; Mon, 02 Nov 2026 14:02:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxHh-0001vQ-In for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:01:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxHc-0008Cx-Fu for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:01:31 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-408-P0nOpbXnMIuwIVoBbPrD2A-1; Mon, 02 Nov 2026 14:01:21 -0500 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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BBBF41954B09; Mon, 2 Nov 2026 19:01:19 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 65A7730001A2; Mon, 2 Nov 2026 19:01:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646087; 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=1+Fb/pNuDVJKjUmAlJEVqK84jM77qkTAumiP1SiO8JU=; b=ZJOlc1mz+Vcp59a8UnpTVpecvvMVAUtDQb0QjDGpOi7xinOF9tQfPo/bUMYq8JmXtA7Yl4 LFkOEDBYYsvEbOWObeWXqDamdBMtJ3HfSgbmdaYrYcOYeeww+mxMdftKk0r4zNR5RKyW16 jWvCOF2P0w8cCTtH1S3aYeD61FNo5sk= X-MC-Unique: P0nOpbXnMIuwIVoBbPrD2A-1 X-Mimecast-MFC-AGG-ID: P0nOpbXnMIuwIVoBbPrD2A_1793646080 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 08/25] trace: drop 'id' from TraceEvent struct when not required Date: Mon, 2 Nov 2026 13:58:14 -0500 Message-ID: <20261102185831.1880189-9-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-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=lists1p.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: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646213194158500 From: Daniel P. Berrang=C3=A9 Only "simpletrace" uses the "id" field from the TraceEvent struct. Omit it when this backend is not enabled to save memory. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-9-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- trace/control-internal.h | 2 ++ trace/control.h | 3 ++- trace/event-internal.h | 2 ++ tests/tracetool/dtrace.c | 4 ++++ tests/tracetool/ftrace.c | 4 ++++ tests/tracetool/log.c | 4 ++++ tests/tracetool/simple.c | 4 ++++ tests/tracetool/syslog.c | 4 ++++ tests/tracetool/ust.c | 4 ++++ trace/control.c | 4 +++- scripts/tracetool/format/c.py | 2 ++ 11 files changed, 35 insertions(+), 2 deletions(-) diff --git a/trace/control-internal.h b/trace/control-internal.h index 8d818d359be..f626b047264 100644 --- a/trace/control-internal.h +++ b/trace/control-internal.h @@ -19,11 +19,13 @@ static inline bool trace_event_is_pattern(const char *s= tr) return strchr(str, '*') !=3D NULL; } =20 +#ifdef CONFIG_TRACE_SIMPLE static inline uint32_t trace_event_get_id(TraceEvent *ev) { assert(ev !=3D NULL); return ev->id; } +#endif =20 static inline const char * trace_event_get_name(TraceEvent *ev) { diff --git a/trace/control.h b/trace/control.h index 20033fb6669..e77c07a8e68 100644 --- a/trace/control.h +++ b/trace/control.h @@ -81,13 +81,14 @@ TraceEvent *trace_event_name(const char *name); */ static bool trace_event_is_pattern(const char *str); =20 - +#ifdef CONFIG_TRACE_SIMPLE /** * trace_event_get_id: * * Get the identifier of an event. */ static uint32_t trace_event_get_id(TraceEvent *ev); +#endif =20 /** * trace_event_get_name: diff --git a/trace/event-internal.h b/trace/event-internal.h index cc095a6ad54..ecf2caabd03 100644 --- a/trace/event-internal.h +++ b/trace/event-internal.h @@ -20,7 +20,9 @@ * Opaque generic description of a tracing event. */ typedef struct TraceEvent { +#ifdef CONFIG_TRACE_SIMPLE uint32_t id; +#endif const char * name; const bool sstate; uint16_t *dstate; diff --git a/tests/tracetool/dtrace.c b/tests/tracetool/dtrace.c index 9f862fa14d2..05a93918240 100644 --- a/tests/tracetool/dtrace.c +++ b/tests/tracetool/dtrace.c @@ -8,13 +8,17 @@ uint16_t _TRACE_TEST_BLAH_DSTATE; uint16_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_blah", .sstate =3D TRACE_TEST_BLAH_ENABLED, .dstate =3D &_TRACE_TEST_BLAH_DSTATE }; TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_wibble", .sstate =3D TRACE_TEST_WIBBLE_ENABLED, .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE diff --git a/tests/tracetool/ftrace.c b/tests/tracetool/ftrace.c index 9f862fa14d2..05a93918240 100644 --- a/tests/tracetool/ftrace.c +++ b/tests/tracetool/ftrace.c @@ -8,13 +8,17 @@ uint16_t _TRACE_TEST_BLAH_DSTATE; uint16_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_blah", .sstate =3D TRACE_TEST_BLAH_ENABLED, .dstate =3D &_TRACE_TEST_BLAH_DSTATE }; TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_wibble", .sstate =3D TRACE_TEST_WIBBLE_ENABLED, .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE diff --git a/tests/tracetool/log.c b/tests/tracetool/log.c index 9f862fa14d2..05a93918240 100644 --- a/tests/tracetool/log.c +++ b/tests/tracetool/log.c @@ -8,13 +8,17 @@ uint16_t _TRACE_TEST_BLAH_DSTATE; uint16_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_blah", .sstate =3D TRACE_TEST_BLAH_ENABLED, .dstate =3D &_TRACE_TEST_BLAH_DSTATE }; TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_wibble", .sstate =3D TRACE_TEST_WIBBLE_ENABLED, .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE diff --git a/tests/tracetool/simple.c b/tests/tracetool/simple.c index 0484177481c..490d6f379a5 100644 --- a/tests/tracetool/simple.c +++ b/tests/tracetool/simple.c @@ -8,13 +8,17 @@ uint16_t _TRACE_TEST_BLAH_DSTATE; uint16_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_blah", .sstate =3D TRACE_TEST_BLAH_ENABLED, .dstate =3D &_TRACE_TEST_BLAH_DSTATE }; TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_wibble", .sstate =3D TRACE_TEST_WIBBLE_ENABLED, .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE diff --git a/tests/tracetool/syslog.c b/tests/tracetool/syslog.c index 9f862fa14d2..05a93918240 100644 --- a/tests/tracetool/syslog.c +++ b/tests/tracetool/syslog.c @@ -8,13 +8,17 @@ uint16_t _TRACE_TEST_BLAH_DSTATE; uint16_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_blah", .sstate =3D TRACE_TEST_BLAH_ENABLED, .dstate =3D &_TRACE_TEST_BLAH_DSTATE }; TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_wibble", .sstate =3D TRACE_TEST_WIBBLE_ENABLED, .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE diff --git a/tests/tracetool/ust.c b/tests/tracetool/ust.c index 9f862fa14d2..05a93918240 100644 --- a/tests/tracetool/ust.c +++ b/tests/tracetool/ust.c @@ -8,13 +8,17 @@ uint16_t _TRACE_TEST_BLAH_DSTATE; uint16_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_blah", .sstate =3D TRACE_TEST_BLAH_ENABLED, .dstate =3D &_TRACE_TEST_BLAH_DSTATE }; TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_wibble", .sstate =3D TRACE_TEST_WIBBLE_ENABLED, .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE diff --git a/trace/control.c b/trace/control.c index 6971157cbe7..947b220056a 100644 --- a/trace/control.c +++ b/trace/control.c @@ -36,8 +36,8 @@ typedef struct TraceEventGroup { =20 static TraceEventGroup *event_groups; static size_t nevent_groups; -static uint32_t next_id; #ifdef CONFIG_TRACE_SIMPLE +static uint32_t next_id; static bool init_trace_on_startup; #endif static char *trace_opts_file; @@ -65,10 +65,12 @@ QemuOptsList qemu_trace_opts =3D { =20 void trace_event_register_group(TraceEvent **events) { +#ifdef CONFIG_TRACE_SIMPLE size_t i; for (i =3D 0; events[i] !=3D NULL; i++) { events[i]->id =3D next_id++; } +#endif event_groups =3D g_renew(TraceEventGroup, event_groups, nevent_groups = + 1); event_groups[nevent_groups].events =3D events; nevent_groups++; diff --git a/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py index 50e03313cbf..abe738ac423 100644 --- a/scripts/tracetool/format/c.py +++ b/scripts/tracetool/format/c.py @@ -34,7 +34,9 @@ def generate(events, backend, group): =20 for e in events: out('TraceEvent %(event)s =3D {', + '#ifdef CONFIG_TRACE_SIMPLE', ' .id =3D 0,', + '#endif', ' .name =3D \"%(name)s\",', ' .sstate =3D %(sstate)s,', ' .dstate =3D &%(dstate)s', --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646115; cv=none; d=zohomail.com; s=zohoarc; b=DPqWDC8dkZ1eFoMOIqCPHG6YsMNdBWPHm0/0vBzHZXvtZsDaDp8e09D1IMTZZH/H9FK2Ko59YORI7qmwZJQeVaqeSMp3TrRFo4NZIv3bF7jH3qewXp3tLGU3D7WXLYtA/nIE9DowixmJSkD3XGXNOcssCwcvWjvLfa0mzLDAJeU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646115; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DFGAhqQ+xaxqaeHjSPXfZYHtf1rW7LNoujQ+nr96Ekg=; b=S9Qmg1kbczAKNkIBQTbTgBwRusZBIBPuGK380FXyOSdyKeoEFrSVuhuR4qZLAQQ88+0SJRrhxBxOSFnR5Y27vP/D5bLfDzm6rZAuYxdQ2A4IVOzJTsB2re2SJDNwZD7EO9sVr1yOphPgrCTKXSAjs5biRK36263eJmlURuk6LYI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1793646115060961.4522217598035; Mon, 2 Nov 2026 11:01:55 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1468583.1677681 (Exim 4.92) (envelope-from ) id 1xNxHg-0007qt-2N; Mon, 02 Nov 2026 19:01:32 +0000 Received: by outflank-mailman (output) from mailman id 1468583.1677681; Mon, 02 Nov 2026 19:01:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHf-0007qH-UU; Mon, 02 Nov 2026 19:01:31 +0000 Received: by outflank-mailman (input) for mailman id 1468583; Mon, 02 Nov 2026 19:01:30 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHe-0007ad-7N for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 19:01:30 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xNxHd-00AdKp-KM for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 20:01:29 +0100 Received: from [10.42.69.5] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ae8ddfc-e002-0a2a0a5209dd-0a2a4505df2e-30 for ; Mon, 02 Nov 2026 20:01:29 +0100 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ae8de08-4cb1-0a2a45050019-aa0a857c4edd-3 for ; Mon, 02 Nov 2026 20:01:29 +0100 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-362-2WojmTPZN1iZuuWmvDA01Q-1; Mon, 02 Nov 2026 14:01:23 -0500 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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C197D1955F7F; Mon, 2 Nov 2026 19:01:21 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B45441956087; Mon, 2 Nov 2026 19:01:20 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646088; 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=DFGAhqQ+xaxqaeHjSPXfZYHtf1rW7LNoujQ+nr96Ekg=; b=LDe6tDZscJ29pX3B8iaxZuI3qdO5RBuVoGMpQZ4rF9ZM3nYy7Vh+TLbhI94VZ9GDepaS27 hj9+bEueZSNr2kY4sSIt/8jqks8d75pVoQ8jLtdrVue1PLm5p1zivJyADfUM9ePKFnAYWk Ns/PuUM4S6W77xpxsbdzhle2DGvUMOM= X-MC-Unique: 2WojmTPZN1iZuuWmvDA01Q-1 X-Mimecast-MFC-AGG-ID: 2WojmTPZN1iZuuWmvDA01Q_1793646081 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 09/25] trace: change "DSTATE" variables from uint16_t to uint8_t Date: Mon, 2 Nov 2026 13:58:15 -0500 Message-ID: <20261102185831.1880189-10-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-MFC-PROC-ID: 9_VaHQctZwIhohao8HnbkORD4sbFNO4zmyldxc8sgbk_1793646081 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-c201ff/1793646089-734BC2A1-6D26EE70/35/111497 X-purgate-type: clean X-purgate-size: 13802 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646116235154101 From: Daniel P. Berrang=C3=A9 Previously these variables had two distinct semantics. For most probes DSTATE was treated as a simple boolean, while for vcpu probes it was treated as a bitmask of vCPU indexes. With vcpu probes removed, it is now exclusively a boolean and thus using uint16_t is a waste of memory. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-10-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- tests/tracetool/dtrace.h | 4 ++-- tests/tracetool/ftrace.h | 4 ++-- tests/tracetool/log.h | 4 ++-- tests/tracetool/simple.h | 4 ++-- tests/tracetool/syslog.h | 4 ++-- tests/tracetool/ust.h | 4 ++-- trace/event-internal.h | 2 +- tests/tracetool/dtrace.c | 4 ++-- tests/tracetool/ftrace.c | 4 ++-- tests/tracetool/log.c | 4 ++-- tests/tracetool/simple.c | 4 ++-- tests/tracetool/syslog.c | 4 ++-- tests/tracetool/ust.c | 4 ++-- scripts/tracetool/format/c.py | 2 +- scripts/tracetool/format/h.py | 2 +- scripts/tracetool/format/rs.py | 4 ++-- tests/tracetool/dtrace.rs | 6 +++--- tests/tracetool/ftrace.rs | 6 +++--- tests/tracetool/log.rs | 6 +++--- tests/tracetool/simple.rs | 6 +++--- tests/tracetool/syslog.rs | 6 +++--- 21 files changed, 44 insertions(+), 44 deletions(-) diff --git a/tests/tracetool/dtrace.h b/tests/tracetool/dtrace.h index c8931a8d7b3..0b5b47089e8 100644 --- a/tests/tracetool/dtrace.h +++ b/tests/tracetool/dtrace.h @@ -8,8 +8,8 @@ =20 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; +extern uint8_t _TRACE_TEST_BLAH_DSTATE; +extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; #define TRACE_TEST_BLAH_ENABLED 1 #define TRACE_TEST_WIBBLE_ENABLED 1 #ifndef SDT_USE_VARIADIC diff --git a/tests/tracetool/ftrace.h b/tests/tracetool/ftrace.h index 1dfe4239413..b34eef17d10 100644 --- a/tests/tracetool/ftrace.h +++ b/tests/tracetool/ftrace.h @@ -8,8 +8,8 @@ =20 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; +extern uint8_t _TRACE_TEST_BLAH_DSTATE; +extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; #define TRACE_TEST_BLAH_ENABLED 1 #define TRACE_TEST_WIBBLE_ENABLED 1 #include "trace/ftrace.h" diff --git a/tests/tracetool/log.h b/tests/tracetool/log.h index c7795871f85..ff510d54908 100644 --- a/tests/tracetool/log.h +++ b/tests/tracetool/log.h @@ -8,8 +8,8 @@ =20 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; +extern uint8_t _TRACE_TEST_BLAH_DSTATE; +extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; #define TRACE_TEST_BLAH_ENABLED 1 #define TRACE_TEST_WIBBLE_ENABLED 1 #include "qemu/log-for-trace.h" diff --git a/tests/tracetool/simple.h b/tests/tracetool/simple.h index ec6fcb22c3c..735cb21d911 100644 --- a/tests/tracetool/simple.h +++ b/tests/tracetool/simple.h @@ -8,8 +8,8 @@ =20 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; +extern uint8_t _TRACE_TEST_BLAH_DSTATE; +extern uint8_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); diff --git a/tests/tracetool/syslog.h b/tests/tracetool/syslog.h index ed4305554c1..4203b8b37dc 100644 --- a/tests/tracetool/syslog.h +++ b/tests/tracetool/syslog.h @@ -8,8 +8,8 @@ =20 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; +extern uint8_t _TRACE_TEST_BLAH_DSTATE; +extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; #define TRACE_TEST_BLAH_ENABLED 1 #define TRACE_TEST_WIBBLE_ENABLED 1 #include diff --git a/tests/tracetool/ust.h b/tests/tracetool/ust.h index b7acd0c39b1..079b2c74491 100644 --- a/tests/tracetool/ust.h +++ b/tests/tracetool/ust.h @@ -8,8 +8,8 @@ =20 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; +extern uint8_t _TRACE_TEST_BLAH_DSTATE; +extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; #define TRACE_TEST_BLAH_ENABLED 1 #define TRACE_TEST_WIBBLE_ENABLED 1 #include diff --git a/trace/event-internal.h b/trace/event-internal.h index ecf2caabd03..ad1578aa2c5 100644 --- a/trace/event-internal.h +++ b/trace/event-internal.h @@ -25,7 +25,7 @@ typedef struct TraceEvent { #endif const char * name; const bool sstate; - uint16_t *dstate; + uint8_t *dstate; } TraceEvent; =20 #endif /* TRACE__EVENT_INTERNAL_H */ diff --git a/tests/tracetool/dtrace.c b/tests/tracetool/dtrace.c index 05a93918240..f83d06252ea 100644 --- a/tests/tracetool/dtrace.c +++ b/tests/tracetool/dtrace.c @@ -5,8 +5,8 @@ #include "qemu/module.h" #include "trace-testsuite.h" =20 -uint16_t _TRACE_TEST_BLAH_DSTATE; -uint16_t _TRACE_TEST_WIBBLE_DSTATE; +uint8_t _TRACE_TEST_BLAH_DSTATE; +uint8_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { #ifdef CONFIG_TRACE_SIMPLE .id =3D 0, diff --git a/tests/tracetool/ftrace.c b/tests/tracetool/ftrace.c index 05a93918240..f83d06252ea 100644 --- a/tests/tracetool/ftrace.c +++ b/tests/tracetool/ftrace.c @@ -5,8 +5,8 @@ #include "qemu/module.h" #include "trace-testsuite.h" =20 -uint16_t _TRACE_TEST_BLAH_DSTATE; -uint16_t _TRACE_TEST_WIBBLE_DSTATE; +uint8_t _TRACE_TEST_BLAH_DSTATE; +uint8_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { #ifdef CONFIG_TRACE_SIMPLE .id =3D 0, diff --git a/tests/tracetool/log.c b/tests/tracetool/log.c index 05a93918240..f83d06252ea 100644 --- a/tests/tracetool/log.c +++ b/tests/tracetool/log.c @@ -5,8 +5,8 @@ #include "qemu/module.h" #include "trace-testsuite.h" =20 -uint16_t _TRACE_TEST_BLAH_DSTATE; -uint16_t _TRACE_TEST_WIBBLE_DSTATE; +uint8_t _TRACE_TEST_BLAH_DSTATE; +uint8_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { #ifdef CONFIG_TRACE_SIMPLE .id =3D 0, diff --git a/tests/tracetool/simple.c b/tests/tracetool/simple.c index 490d6f379a5..820ddb575b0 100644 --- a/tests/tracetool/simple.c +++ b/tests/tracetool/simple.c @@ -5,8 +5,8 @@ #include "qemu/module.h" #include "trace-testsuite.h" =20 -uint16_t _TRACE_TEST_BLAH_DSTATE; -uint16_t _TRACE_TEST_WIBBLE_DSTATE; +uint8_t _TRACE_TEST_BLAH_DSTATE; +uint8_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { #ifdef CONFIG_TRACE_SIMPLE .id =3D 0, diff --git a/tests/tracetool/syslog.c b/tests/tracetool/syslog.c index 05a93918240..f83d06252ea 100644 --- a/tests/tracetool/syslog.c +++ b/tests/tracetool/syslog.c @@ -5,8 +5,8 @@ #include "qemu/module.h" #include "trace-testsuite.h" =20 -uint16_t _TRACE_TEST_BLAH_DSTATE; -uint16_t _TRACE_TEST_WIBBLE_DSTATE; +uint8_t _TRACE_TEST_BLAH_DSTATE; +uint8_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { #ifdef CONFIG_TRACE_SIMPLE .id =3D 0, diff --git a/tests/tracetool/ust.c b/tests/tracetool/ust.c index 05a93918240..f83d06252ea 100644 --- a/tests/tracetool/ust.c +++ b/tests/tracetool/ust.c @@ -5,8 +5,8 @@ #include "qemu/module.h" #include "trace-testsuite.h" =20 -uint16_t _TRACE_TEST_BLAH_DSTATE; -uint16_t _TRACE_TEST_WIBBLE_DSTATE; +uint8_t _TRACE_TEST_BLAH_DSTATE; +uint8_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { #ifdef CONFIG_TRACE_SIMPLE .id =3D 0, diff --git a/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py index abe738ac423..de1c154a881 100644 --- a/scripts/tracetool/format/c.py +++ b/scripts/tracetool/format/c.py @@ -30,7 +30,7 @@ def generate(events, backend, group): '') =20 for e in events: - out('uint16_t %s;' % e.api(e.QEMU_DSTATE)) + out('uint8_t %s;' % e.api(e.QEMU_DSTATE)) =20 for e in events: out('TraceEvent %(event)s =3D {', diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index dd58713a158..4dc1ad7eb15 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -32,7 +32,7 @@ def generate(events, backend, group): event =3D e.api(e.QEMU_EVENT)) =20 for e in events: - out('extern uint16_t %s;' % e.api(e.QEMU_DSTATE)) + out('extern uint8_t %s;' % e.api(e.QEMU_DSTATE)) =20 # static state for e in events: diff --git a/scripts/tracetool/format/rs.py b/scripts/tracetool/format/rs.py index 7d9af7edfee..1fddcee1ad2 100644 --- a/scripts/tracetool/format/rs.py +++ b/scripts/tracetool/format/rs.py @@ -26,7 +26,7 @@ def generate(events, backend, group): '', '#[allow(dead_code)]', '#[inline(always)]', - 'fn trace_event_state_is_enabled(dstate: u16) -> bool {', + 'fn trace_event_state_is_enabled(dstate: u8) -> bool {', ' (unsafe { trace_events_enabled_count }) !=3D 0 && dstate !=3D= 0', '}', '', @@ -39,7 +39,7 @@ def generate(events, backend, group): =20 for e in events: out(' #[allow(dead_code)]', - ' static mut %s: u16;' % e.api(e.QEMU_DSTATE)) + ' static mut %s: u8;' % e.api(e.QEMU_DSTATE)) out('}', '') =20 diff --git a/tests/tracetool/dtrace.rs b/tests/tracetool/dtrace.rs index 3490fcb271a..07398f4731b 100644 --- a/tests/tracetool/dtrace.rs +++ b/tests/tracetool/dtrace.rs @@ -8,7 +8,7 @@ =20 #[allow(dead_code)] #[inline(always)] -fn trace_event_state_is_enabled(dstate: u16) -> bool { +fn trace_event_state_is_enabled(dstate: u8) -> bool { (unsafe { trace_events_enabled_count }) !=3D 0 && dstate !=3D 0 } =20 @@ -18,9 +18,9 @@ fn trace_event_state_is_enabled(dstate: u16) -> bool { } extern "C" { #[allow(dead_code)] - static mut _TRACE_TEST_BLAH_DSTATE: u16; + static mut _TRACE_TEST_BLAH_DSTATE: u8; #[allow(dead_code)] - static mut _TRACE_TEST_WIBBLE_DSTATE: u16; + static mut _TRACE_TEST_WIBBLE_DSTATE: u8; } =20 use std::cell::UnsafeCell; diff --git a/tests/tracetool/ftrace.rs b/tests/tracetool/ftrace.rs index 34f66004902..ff0bcde4b8b 100644 --- a/tests/tracetool/ftrace.rs +++ b/tests/tracetool/ftrace.rs @@ -8,7 +8,7 @@ =20 #[allow(dead_code)] #[inline(always)] -fn trace_event_state_is_enabled(dstate: u16) -> bool { +fn trace_event_state_is_enabled(dstate: u8) -> bool { (unsafe { trace_events_enabled_count }) !=3D 0 && dstate !=3D 0 } =20 @@ -18,9 +18,9 @@ fn trace_event_state_is_enabled(dstate: u16) -> bool { } extern "C" { #[allow(dead_code)] - static mut _TRACE_TEST_BLAH_DSTATE: u16; + static mut _TRACE_TEST_BLAH_DSTATE: u8; #[allow(dead_code)] - static mut _TRACE_TEST_WIBBLE_DSTATE: u16; + static mut _TRACE_TEST_WIBBLE_DSTATE: u8; } =20 #[inline(always)] diff --git a/tests/tracetool/log.rs b/tests/tracetool/log.rs index 770758611d1..0f052bb2c9c 100644 --- a/tests/tracetool/log.rs +++ b/tests/tracetool/log.rs @@ -8,7 +8,7 @@ =20 #[allow(dead_code)] #[inline(always)] -fn trace_event_state_is_enabled(dstate: u16) -> bool { +fn trace_event_state_is_enabled(dstate: u8) -> bool { (unsafe { trace_events_enabled_count }) !=3D 0 && dstate !=3D 0 } =20 @@ -18,9 +18,9 @@ fn trace_event_state_is_enabled(dstate: u16) -> bool { } extern "C" { #[allow(dead_code)] - static mut _TRACE_TEST_BLAH_DSTATE: u16; + static mut _TRACE_TEST_BLAH_DSTATE: u8; #[allow(dead_code)] - static mut _TRACE_TEST_WIBBLE_DSTATE: u16; + static mut _TRACE_TEST_WIBBLE_DSTATE: u8; } =20 #[inline(always)] diff --git a/tests/tracetool/simple.rs b/tests/tracetool/simple.rs index 92f896ef178..976feddde5b 100644 --- a/tests/tracetool/simple.rs +++ b/tests/tracetool/simple.rs @@ -8,7 +8,7 @@ =20 #[allow(dead_code)] #[inline(always)] -fn trace_event_state_is_enabled(dstate: u16) -> bool { +fn trace_event_state_is_enabled(dstate: u8) -> bool { (unsafe { trace_events_enabled_count }) !=3D 0 && dstate !=3D 0 } =20 @@ -18,9 +18,9 @@ fn trace_event_state_is_enabled(dstate: u16) -> bool { } extern "C" { #[allow(dead_code)] - static mut _TRACE_TEST_BLAH_DSTATE: u16; + static mut _TRACE_TEST_BLAH_DSTATE: u8; #[allow(dead_code)] - static mut _TRACE_TEST_WIBBLE_DSTATE: u16; + static mut _TRACE_TEST_WIBBLE_DSTATE: u8; } =20 #[inline(always)] diff --git a/tests/tracetool/syslog.rs b/tests/tracetool/syslog.rs index 378d03d34b2..9688dac84a5 100644 --- a/tests/tracetool/syslog.rs +++ b/tests/tracetool/syslog.rs @@ -8,7 +8,7 @@ =20 #[allow(dead_code)] #[inline(always)] -fn trace_event_state_is_enabled(dstate: u16) -> bool { +fn trace_event_state_is_enabled(dstate: u8) -> bool { (unsafe { trace_events_enabled_count }) !=3D 0 && dstate !=3D 0 } =20 @@ -18,9 +18,9 @@ fn trace_event_state_is_enabled(dstate: u16) -> bool { } extern "C" { #[allow(dead_code)] - static mut _TRACE_TEST_BLAH_DSTATE: u16; + static mut _TRACE_TEST_BLAH_DSTATE: u8; #[allow(dead_code)] - static mut _TRACE_TEST_WIBBLE_DSTATE: u16; + static mut _TRACE_TEST_WIBBLE_DSTATE: u8; } =20 #[inline(always)] --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646130; cv=none; d=zohomail.com; s=zohoarc; b=YHwgagbldZ1uk7j4QoBG14v6yva7HDVpsN6XbxlAa9sA80WQSPKodQvMw4tSdQnYGLyLDU0/bSlz3igqzIiFK58jnlrBsYmn/FL/HxP0V/OdMTXz+gV0RaxiX2KtUzRD5eGyuMVxYY9g1/Hrlxoj4Bv6Csqk+hz5vQWd+/8N4rU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646130; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HVLiXlgRnVDt9HN6YEs055+fC583nu5lD1opbfo202g=; b=BDJ2v9VSyO5w8DQ3lJ3KCXJiSVIa3Ub0tcv+rqqSOhqkXGUCm6EKStpgTSksBsbZ0VbCm8tTCvJ2/cANNp0sIekSQwo90eP42yIp2GSB8TumIr1PRpc+Kv9Wb4DzmQKEdpGTdO5gkyZM9SKm6qPjNjWp1V6kOcoc69PUEo5GYIs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1793646130707895.1253355667454; Mon, 2 Nov 2026 11:02:10 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1468598.1677744 (Exim 4.92) (envelope-from ) id 1xNxHq-0001RD-UJ; Mon, 02 Nov 2026 19:01:42 +0000 Received: by outflank-mailman (output) from mailman id 1468598.1677744; Mon, 02 Nov 2026 19:01:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHq-0001QA-H3; Mon, 02 Nov 2026 19:01:42 +0000 Received: by outflank-mailman (input) for mailman id 1468598; Mon, 02 Nov 2026 19:01:40 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHo-00012l-Ez for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 19:01:40 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xNxHn-000wRK-Qf for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 20:01:39 +0100 Received: from [10.42.69.6] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ae8ddf9-2eae-0a2a0a5409dd-0a2a4506be22-48 for ; Mon, 02 Nov 2026 20:01:39 +0100 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ae8de12-195a-0a2a45060019-aa0a817c7e9f-3 for ; Mon, 02 Nov 2026 20:01:39 +0100 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-589-gu_EAvXwPOuA7EdNu_4fvg-1; Mon, 02 Nov 2026 14:01:34 -0500 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 E07231802178; Mon, 2 Nov 2026 19:01:32 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8CD3230000E3; Mon, 2 Nov 2026 19:01:32 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646098; 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=HVLiXlgRnVDt9HN6YEs055+fC583nu5lD1opbfo202g=; b=HjWg2agXno5IwpDIqKUjEuG3FMV/ZiMVgKzB/1EwWXhc72T3s8mO6IuSXHn7eOHJ6DHQzW JEmFL1dNmj71Ej2XuhvX0AdQXoH1AIRWmYe6yu3Qlsx2aIjiE9XebLoBSWHQgeSziUluy2 7j4nTB9o1h0QY94danBHKomjfQwHBRM= X-MC-Unique: gu_EAvXwPOuA7EdNu_4fvg-1 X-Mimecast-MFC-AGG-ID: gu_EAvXwPOuA7EdNu_4fvg_1793646093 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 10/25] trace: add testing of 'nop' trace backend Date: Mon, 2 Nov 2026 13:58:16 -0500 Message-ID: <20261102185831.1880189-11-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-MFC-PROC-ID: pIfGok1FwWAq2pd3dUTSDLfgGZs4ftwRHz4gEar7GMA_1793646093 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-16d1c6/1793646099-F687577B-810D6D2D/35/111497 X-purgate-type: clean X-purgate-size: 5329 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646131767158500 From: Daniel P. Berrang=C3=A9 This will be used to demonstrate that tracetool outputs the bare minimum of code when tracing is disabled. Currently, as of this initial commit of reference output, too much code is generated. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-11-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- tests/tracetool/nop.h | 29 ++++++++++++++++++ tests/tracetool/nop.c | 36 ++++++++++++++++++++++ tests/tracetool/meson.build | 1 + tests/tracetool/nop.rs | 51 +++++++++++++++++++++++++++++++ tests/tracetool/tracetool-test.py | 2 +- 5 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 tests/tracetool/nop.h create mode 100644 tests/tracetool/nop.c create mode 100644 tests/tracetool/nop.rs diff --git a/tests/tracetool/nop.h b/tests/tracetool/nop.h new file mode 100644 index 00000000000..443f5e0cf6e --- /dev/null +++ b/tests/tracetool/nop.h @@ -0,0 +1,29 @@ +/* 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 uint8_t _TRACE_TEST_BLAH_DSTATE; +extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; +#define TRACE_TEST_BLAH_ENABLED 1 +#define TRACE_TEST_WIBBLE_ENABLED 1 + +#define TRACE_TEST_BLAH_BACKEND_DSTATE() ( \ + false) + +static inline void trace_test_blah(void *context, const char *filename) +{ +} + +#define TRACE_TEST_WIBBLE_BACKEND_DSTATE() ( \ + false) + +static inline void trace_test_wibble(void *context, int value) +{ +} +#endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/tests/tracetool/nop.c b/tests/tracetool/nop.c new file mode 100644 index 00000000000..f83d06252ea --- /dev/null +++ b/tests/tracetool/nop.c @@ -0,0 +1,36 @@ +/* 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" + +uint8_t _TRACE_TEST_BLAH_DSTATE; +uint8_t _TRACE_TEST_WIBBLE_DSTATE; +TraceEvent _TRACE_TEST_BLAH_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE + .id =3D 0, +#endif + .name =3D "test_blah", + .sstate =3D TRACE_TEST_BLAH_ENABLED, + .dstate =3D &_TRACE_TEST_BLAH_DSTATE +}; +TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE + .id =3D 0, +#endif + .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/meson.build b/tests/tracetool/meson.build index 09bbaaa86bf..f4f583e6224 100644 --- a/tests/tracetool/meson.build +++ b/tests/tracetool/meson.build @@ -5,6 +5,7 @@ test_env.set('PYTHONPATH', meson.project_source_root() / 's= cripts') test_env.set('PYTHONIOENCODING', 'utf-8') =20 backends =3D [ + 'nop', 'dtrace', 'ftrace', 'log', diff --git a/tests/tracetool/nop.rs b/tests/tracetool/nop.rs new file mode 100644 index 00000000000..5f007cecd04 --- /dev/null +++ b/tests/tracetool/nop.rs @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +// This file is @generated by tracetool, do not edit. + +#[allow(unused_imports)] +use std::ffi::c_char; +#[allow(unused_imports)] +use util::bindings; + +#[allow(dead_code)] +#[inline(always)] +fn trace_event_state_is_enabled(dstate: u8) -> bool { + (unsafe { trace_events_enabled_count }) !=3D 0 && dstate !=3D 0 +} + +extern "C" { + #[allow(dead_code)] + static mut trace_events_enabled_count: u32; +} +extern "C" { + #[allow(dead_code)] + static mut _TRACE_TEST_BLAH_DSTATE: u8; + #[allow(dead_code)] + static mut _TRACE_TEST_WIBBLE_DSTATE: u8; +} + +#[inline(always)] +#[allow(dead_code)] +pub fn trace_test_blah_enabled() -> bool +{ + false +} + +#[inline(always)] +#[allow(dead_code)] +pub fn trace_test_blah(_context: *mut (), _filename: &std::ffi::CStr) +{ +} + +#[inline(always)] +#[allow(dead_code)] +pub fn trace_test_wibble_enabled() -> bool +{ + false +} + +#[inline(always)] +#[allow(dead_code)] +pub fn trace_test_wibble(_context: *mut (), _value: std::ffi::c_int) +{ +} + diff --git a/tests/tracetool/tracetool-test.py b/tests/tracetool/tracetool-= test.py index 59e9ab3d6ef..74f315a4629 100755 --- a/tests/tracetool/tracetool-test.py +++ b/tests/tracetool/tracetool-test.py @@ -14,7 +14,7 @@ def get_formats(backend): "c", "h", ] - if backend in {"dtrace", "ftrace", "log", "simple", "syslog"}: + if backend in {"nop", "dtrace", "ftrace", "log", "simple", "syslog"}: formats +=3D ["rs"] if backend =3D=3D "dtrace": formats +=3D [ --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646225; cv=none; d=zohomail.com; s=zohoarc; b=h1Oo8yPfV+u0fFLthLbQ2RVf3yIf7dXRFlA0+8C6aPdFOchf4o6ozuGCICPLCBVcxNHy5xMpoIYSlIhibITP+QFMx2dbz5/AX3QvKiSsbWjndwuJLGnYNns9+45/xxCrzb1MrbzTZTBk8En5la4mWOr6anfRTO1Exl35HTg3SZo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646225; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sNaYu08RePiA3/TOJj7oi5LlAFNAX4bokf8QMENnVcY=; b=J9tqp4lJgUG7KUgibZmD8+8z/XW1GxtV7VS+RzAeHyeXH4++kqCYhh2U21EWUajBigzgW2zR6xYT20TBHpy+v6MNVNEpd9l9sAKsosSfOwNknEjdTPsPIv/rZiYIpWDWHIKwRHYQOf4hPtep8snpNGJtptXFt2RMy1xLlimmD9M= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793646225534495.828664965253; Mon, 2 Nov 2026 11:03:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNxJM-0003nd-Jm; Mon, 02 Nov 2026 14:03:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxHl-0001w9-8n for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:01:41 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxHf-0008DC-Ij for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:01:35 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-517-bDpS0_1SNbuIVeQYkiMFXQ-1; Mon, 02 Nov 2026 14:01:25 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4FBC3180134F; Mon, 2 Nov 2026 19:01:24 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EC01B1800444; Mon, 2 Nov 2026 19:01:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646089; 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=sNaYu08RePiA3/TOJj7oi5LlAFNAX4bokf8QMENnVcY=; b=dP2bgzQmj8iF9VsTpqt6XFPtKrLCmtv3UafsXMrNaQ416UGl4fEMMvN5Op/8NWmWNE7Sf/ IPeeKcGGiyaWvDCgAhaBZAFwk9Zw/OoYtkMfE/M/AMCJTLe8o0/OlnOpT8KRdC4Zwk+vTk JSByF3JVVRzBBLcGS17qgrDjbqx070s= X-MC-Unique: bDpS0_1SNbuIVeQYkiMFXQ-1 X-Mimecast-MFC-AGG-ID: bDpS0_1SNbuIVeQYkiMFXQ_1793646084 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 11/25] trace: don't emit TraceEvent structs when 'nop' backend is used Date: Mon, 2 Nov 2026 13:58:17 -0500 Message-ID: <20261102185831.1880189-12-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-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=lists1p.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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646227312158500 From: Daniel P. Berrang=C3=A9 The 'nop' backend is a short-hand for no trace probe usage at all. The emitted functions become a no-op, and as such there is no need to emit the TraceEvent structs, nor the DSTATE variables they reference. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-12-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- tests/tracetool/nop.h | 6 +-- tests/tracetool/nop.c | 29 --------------- scripts/tracetool/format/c.py | 69 ++++++++++++++++++----------------- scripts/tracetool/format/h.py | 14 ++++--- 4 files changed, 46 insertions(+), 72 deletions(-) diff --git a/tests/tracetool/nop.h b/tests/tracetool/nop.h index 443f5e0cf6e..64b6b005684 100644 --- a/tests/tracetool/nop.h +++ b/tests/tracetool/nop.h @@ -6,10 +6,8 @@ =20 #include "trace/control.h" =20 -extern TraceEvent _TRACE_TEST_BLAH_EVENT; -extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; -extern uint8_t _TRACE_TEST_BLAH_DSTATE; -extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; +#define _TRACE_TEST_BLAH_DSTATE 0 +#define _TRACE_TEST_WIBBLE_DSTATE 0 #define TRACE_TEST_BLAH_ENABLED 1 #define TRACE_TEST_WIBBLE_ENABLED 1 =20 diff --git a/tests/tracetool/nop.c b/tests/tracetool/nop.c index f83d06252ea..d34cc0ca742 100644 --- a/tests/tracetool/nop.c +++ b/tests/tracetool/nop.c @@ -5,32 +5,3 @@ #include "qemu/module.h" #include "trace-testsuite.h" =20 -uint8_t _TRACE_TEST_BLAH_DSTATE; -uint8_t _TRACE_TEST_WIBBLE_DSTATE; -TraceEvent _TRACE_TEST_BLAH_EVENT =3D { -#ifdef CONFIG_TRACE_SIMPLE - .id =3D 0, -#endif - .name =3D "test_blah", - .sstate =3D TRACE_TEST_BLAH_ENABLED, - .dstate =3D &_TRACE_TEST_BLAH_DSTATE -}; -TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { -#ifdef CONFIG_TRACE_SIMPLE - .id =3D 0, -#endif - .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/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py index de1c154a881..5f6669c917c 100644 --- a/scripts/tracetool/format/c.py +++ b/scripts/tracetool/format/c.py @@ -29,41 +29,42 @@ def generate(events, backend, group): '#include "%s"' % header, '') =20 - for e in events: - out('uint8_t %s;' % e.api(e.QEMU_DSTATE)) + if len(list(backend.backend_modules())): + for e in events: + out('uint8_t %s;' % e.api(e.QEMU_DSTATE)) =20 - for e in events: - out('TraceEvent %(event)s =3D {', - '#ifdef CONFIG_TRACE_SIMPLE', - ' .id =3D 0,', - '#endif', - ' .name =3D \"%(name)s\",', - ' .sstate =3D %(sstate)s,', - ' .dstate =3D &%(dstate)s', + for e in events: + out('TraceEvent %(event)s =3D {', + '#ifdef CONFIG_TRACE_SIMPLE', + ' .id =3D 0,', + '#endif', + ' .name =3D \"%(name)s\",', + ' .sstate =3D %(sstate)s,', + ' .dstate =3D &%(dstate)s', + '};', + event =3D e.api(e.QEMU_EVENT), + name =3D e.name, + sstate =3D "TRACE_%s_ENABLED" % e.name.upper(), + dstate =3D e.api(e.QEMU_DSTATE)) + + out('TraceEvent *%(group)s_trace_events[] =3D {', + group =3D group.lower()) + + for e in events: + out(' &%(event)s,', event =3D e.api(e.QEMU_EVENT)) + + out(' NULL,', '};', - event =3D e.api(e.QEMU_EVENT), - name =3D e.name, - sstate =3D "TRACE_%s_ENABLED" % e.name.upper(), - dstate =3D e.api(e.QEMU_DSTATE)) + '') =20 - out('TraceEvent *%(group)s_trace_events[] =3D {', - group =3D group.lower()) + out('static void trace_%(group)s_register_events(void)', + '{', + ' trace_event_register_group(%(group)s_trace_events);', + '}', + 'trace_init(trace_%(group)s_register_events)', + group =3D group.lower()) =20 - for e in events: - out(' &%(event)s,', event =3D e.api(e.QEMU_EVENT)) - - out(' NULL,', - '};', - '') - - out('static void trace_%(group)s_register_events(void)', - '{', - ' trace_event_register_group(%(group)s_trace_events);', - '}', - 'trace_init(trace_%(group)s_register_events)', - group =3D group.lower()) - - backend.generate_begin(active_events, group) - for event in active_events: - backend.generate(event, group) - backend.generate_end(active_events, group) + backend.generate_begin(active_events, group) + for event in active_events: + backend.generate(event, group) + backend.generate_end(active_events, group) diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index 4dc1ad7eb15..6ffb7256e31 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -27,12 +27,16 @@ def generate(events, backend, group): '#include "%s"' % header, '') =20 - for e in events: - out('extern TraceEvent %(event)s;', - event =3D e.api(e.QEMU_EVENT)) + if len(list(backend.backend_modules())): + for e in events: + out('extern TraceEvent %(event)s;', + event =3D e.api(e.QEMU_EVENT)) =20 - for e in events: - out('extern uint8_t %s;' % e.api(e.QEMU_DSTATE)) + for e in events: + out('extern uint8_t %s;' % e.api(e.QEMU_DSTATE)) + else: + for e in events: + out('#define %s 0' % e.api(e.QEMU_DSTATE)) =20 # static state for e in events: --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646128; cv=none; d=zohomail.com; s=zohoarc; b=LKRphTij+NmEAj4619qp9SAbsIwZbesjkx17B5ppjHMKkAeaBqK47ULItMbIXTzkRT/ICKVWgiVO/F+haQVFOpUnmKxBVdTEOWDt0j95htI0j5rA6fOWTDvPmFmeQD8M5/npFzq8Cvw7M1aNsz5lFWzrl0Gxu9pOog5w9QI+IWo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646128; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2Ozn+n7oejeYEU5bC9zbT0ZwSD6t+CLu8qMU+CoA5yo=; b=BJfPBf96qj0BWjyVap4EFrtn6EgcBgJLwmjgMWjUgTadyUjRFp1Xm5lhxKpREsoSKmWhjNC08yx9WX5D6+DhRSA03h8PiECHhlySpG5iUC8croY9BhkPpy+jwIG7ZhAZs3F8AH8S+4ukHpe0xBwcIlOy79E13Ae32HmcP0y8FrM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1793646128868443.38864602355136; Mon, 2 Nov 2026 11:02:08 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1468591.1677721 (Exim 4.92) (envelope-from ) id 1xNxHm-0000an-3E; Mon, 02 Nov 2026 19:01:38 +0000 Received: by outflank-mailman (output) from mailman id 1468591.1677721; Mon, 02 Nov 2026 19:01:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHl-0000aQ-V0; Mon, 02 Nov 2026 19:01:37 +0000 Received: by outflank-mailman (input) for mailman id 1468591; Mon, 02 Nov 2026 19:01:36 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHj-0000D6-RS for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 19:01:36 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xNxHj-00Bp7W-8H for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 20:01:35 +0100 Received: from [10.42.69.3] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ae8de0c-8faa-0a2a0a5109dd-0a2a4503a4a8-4 for ; Mon, 02 Nov 2026 20:01:35 +0100 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ae8de0e-fae8-0a2a45030019-aa0a857cee37-3 for ; Mon, 02 Nov 2026 20:01:35 +0100 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-230-ZbEk_HoDOFGdSetIT6hdXg-1; Mon, 02 Nov 2026 14:01:29 -0500 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 8B4891802677; Mon, 2 Nov 2026 19:01:27 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3580D30001A2; Mon, 2 Nov 2026 19:01:25 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646093; 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=2Ozn+n7oejeYEU5bC9zbT0ZwSD6t+CLu8qMU+CoA5yo=; b=GoIU6v+Lp1pQmVHPMthg0EodsHnPN3Z86bV+dHJsnIN/PxQOda1qXH34Q8l5vFOe0SXzIT f47Ml3cuNcPImwMl3q3F0QW1li9/o05JBYbWiX29vaZdsfYiyhIpXXnrNj1A/30Cc6y010 SrBjdnRcBAIQaSmnJcrS7AbtfZ6hjfc= X-MC-Unique: ZbEk_HoDOFGdSetIT6hdXg-1 X-Mimecast-MFC-AGG-ID: ZbEk_HoDOFGdSetIT6hdXg_1793646087 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 12/25] trace: add test of generation with all backends enabled Date: Mon, 2 Nov 2026 13:58:18 -0500 Message-ID: <20261102185831.1880189-13-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-MFC-PROC-ID: oxsvxE9H8GBvhDnXfS0Y9BLWocJrIOqLPP9EhGe8cZU_1793646087 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-33051d/1793646095-77AC44E9-49D661EF/35/111497 X-purgate-type: clean X-purgate-size: 18093 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646129713158500 From: Daniel P. Berrang=C3=A9 This reveals potentially interesting patterns in the generated code when multiple backends are present. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-13-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- tests/tracetool/all.h | 102 +++++++++++++++++++++++++++ tests/tracetool/all.c | 65 +++++++++++++++++ tests/tracetool/all.d | 10 +++ tests/tracetool/all.log-stap | 15 ++++ tests/tracetool/all.rs | 90 +++++++++++++++++++++++ tests/tracetool/all.simpletrace-stap | 16 +++++ tests/tracetool/all.stap | 14 ++++ tests/tracetool/all.ust-events-c | 14 ++++ tests/tracetool/all.ust-events-h | 56 +++++++++++++++ tests/tracetool/meson.build | 3 +- tests/tracetool/tracetool-test.py | 12 ++-- 11 files changed, 392 insertions(+), 5 deletions(-) create mode 100644 tests/tracetool/all.h create mode 100644 tests/tracetool/all.c create mode 100644 tests/tracetool/all.d create mode 100644 tests/tracetool/all.log-stap create mode 100644 tests/tracetool/all.rs create mode 100644 tests/tracetool/all.simpletrace-stap create mode 100644 tests/tracetool/all.stap create mode 100644 tests/tracetool/all.ust-events-c create mode 100644 tests/tracetool/all.ust-events-h diff --git a/tests/tracetool/all.h b/tests/tracetool/all.h new file mode 100644 index 00000000000..41fa4d0e8a2 --- /dev/null +++ b/tests/tracetool/all.h @@ -0,0 +1,102 @@ +/* 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 uint8_t _TRACE_TEST_BLAH_DSTATE; +extern uint8_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 +#include "trace/ftrace.h" + +#include "qemu/log-for-trace.h" + +void _simple_trace_test_blah(void *context, const char *filename); +void _simple_trace_test_wibble(void *context, int value); + +#include + +#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() ( \ + QEMU_TEST_BLAH_ENABLED() || \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ + tracepoint_enabled(qemu, test_blah) || \ + false) + +static inline void trace_test_blah(void *context, const char *filename) +{ + QEMU_TEST_BLAH(context, filename); + tracepoint(qemu, test_blah, context, filename); + if (trace_event_get_state(TRACE_TEST_BLAH)) { +#line 4 "trace-events" + ftrace_write("test_blah " "Blah context=3D%p filename=3D%s" "\n" ,= context, filename); +#line 62 "all.h" + if (qemu_loglevel_mask(LOG_TRACE)) { +#line 4 "trace-events" + qemu_log("test_blah " "Blah context=3D%p filename=3D%s" "\n", = context, filename); +#line 66 "all.h" + } + _simple_trace_test_blah(context, filename); +#line 4 "trace-events" + syslog(LOG_INFO, "test_blah " "Blah context=3D%p filename=3D%s" , = context, filename); +#line 71 "all.h" + } +} + +#define TRACE_TEST_WIBBLE_BACKEND_DSTATE() ( \ + QEMU_TEST_WIBBLE_ENABLED() || \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ + tracepoint_enabled(qemu, test_wibble) || \ + false) + +static inline void trace_test_wibble(void *context, int value) +{ + QEMU_TEST_WIBBLE(context, value); + tracepoint(qemu, test_wibble, context, value); + if (trace_event_get_state(TRACE_TEST_WIBBLE)) { +#line 5 "trace-events" + ftrace_write("test_wibble " "Wibble context=3D%p value=3D%d" "\n" = , context, value); +#line 91 "all.h" + if (qemu_loglevel_mask(LOG_TRACE)) { +#line 5 "trace-events" + qemu_log("test_wibble " "Wibble context=3D%p value=3D%d" "\n",= context, value); +#line 95 "all.h" + } + _simple_trace_test_wibble(context, value); +#line 5 "trace-events" + syslog(LOG_INFO, "test_wibble " "Wibble context=3D%p value=3D%d" ,= context, value); +#line 100 "all.h" + } +} +#endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/tests/tracetool/all.c b/tests/tracetool/all.c new file mode 100644 index 00000000000..820ddb575b0 --- /dev/null +++ b/tests/tracetool/all.c @@ -0,0 +1,65 @@ +/* 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" + +uint8_t _TRACE_TEST_BLAH_DSTATE; +uint8_t _TRACE_TEST_WIBBLE_DSTATE; +TraceEvent _TRACE_TEST_BLAH_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE + .id =3D 0, +#endif + .name =3D "test_blah", + .sstate =3D TRACE_TEST_BLAH_ENABLED, + .dstate =3D &_TRACE_TEST_BLAH_DSTATE +}; +TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE + .id =3D 0, +#endif + .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/all.d b/tests/tracetool/all.d new file mode 100644 index 00000000000..5cc06f9f4f5 --- /dev/null +++ b/tests/tracetool/all.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/all.log-stap b/tests/tracetool/all.log-stap new file mode 100644 index 00000000000..092986e0b61 --- /dev/null +++ b/tests/tracetool/all.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/all.rs b/tests/tracetool/all.rs new file mode 100644 index 00000000000..c8c9d288366 --- /dev/null +++ b/tests/tracetool/all.rs @@ -0,0 +1,90 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +// This file is @generated by tracetool, do not edit. + +#[allow(unused_imports)] +use std::ffi::c_char; +#[allow(unused_imports)] +use util::bindings; + +#[allow(dead_code)] +#[inline(always)] +fn trace_event_state_is_enabled(dstate: u8) -> bool { + (unsafe { trace_events_enabled_count }) !=3D 0 && dstate !=3D 0 +} + +extern "C" { + #[allow(dead_code)] + static mut trace_events_enabled_count: u32; +} +extern "C" { + #[allow(dead_code)] + static mut _TRACE_TEST_BLAH_DSTATE: u8; + #[allow(dead_code)] + static mut _TRACE_TEST_WIBBLE_DSTATE: u8; +} + +use std::cell::UnsafeCell; + +extern "C" { + #[allow(dead_code)] + static qemu_test_blah_semaphore: UnsafeCell; + #[allow(dead_code)] + static qemu_test_wibble_semaphore: UnsafeCell; +} + +#[inline(always)] +#[allow(dead_code)] +pub fn trace_test_blah_enabled() -> bool +{ + (unsafe {qemu_test_blah_semaphore.get().read_volatile()}) !=3D 0 || + trace_event_state_is_enabled(unsafe { _TRACE_TEST_BLAH_DSTATE}) || + false +} + +#[inline(always)] +#[allow(dead_code)] +pub fn trace_test_blah(_context: *mut (), _filename: &std::ffi::CStr) +{ + ::trace::probe!(qemu, test_blah, _context, _filename.as_ptr()); + if trace_event_state_is_enabled(unsafe { _TRACE_TEST_BLAH_DSTATE}) { + let format_string =3D c"Blah context=3D%p filename=3D%s"; + unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_= char, _context /* as *mut () */, _filename.as_ptr());} + let format_string =3D c"test_blah Blah context=3D%p filename=3D%s\= n"; + if (unsafe { bindings::qemu_loglevel } & bindings::LOG_TRACE) !=3D= 0 { + unsafe { bindings::qemu_log(format_string.as_ptr() as *const c= _char, _context /* as *mut () */, _filename.as_ptr());} + } + extern "C" { fn _simple_trace_test_blah(_context: *mut (), _filena= me: *const std::ffi::c_char); } + unsafe { _simple_trace_test_blah(_context, _filename.as_ptr()); } + let format_string =3D c"Blah context=3D%p filename=3D%s"; + unsafe {::trace::syslog(::trace::LOG_INFO, format_string.as_ptr() = as *const c_char, _context /* as *mut () */, _filename.as_ptr());} + } +} + +#[inline(always)] +#[allow(dead_code)] +pub fn trace_test_wibble_enabled() -> bool +{ + (unsafe {qemu_test_wibble_semaphore.get().read_volatile()}) !=3D 0 || + trace_event_state_is_enabled(unsafe { _TRACE_TEST_WIBBLE_DSTATE}) || + false +} + +#[inline(always)] +#[allow(dead_code)] +pub fn trace_test_wibble(_context: *mut (), _value: std::ffi::c_int) +{ + ::trace::probe!(qemu, test_wibble, _context, _value); + if trace_event_state_is_enabled(unsafe { _TRACE_TEST_WIBBLE_DSTATE}) { + let format_string =3D c"Wibble context=3D%p value=3D%d"; + unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_= char, _context /* as *mut () */, _value /* as std::ffi::c_int */);} + let format_string =3D c"test_wibble Wibble context=3D%p value=3D%d= \n"; + if (unsafe { bindings::qemu_loglevel } & bindings::LOG_TRACE) !=3D= 0 { + unsafe { bindings::qemu_log(format_string.as_ptr() as *const c= _char, _context /* as *mut () */, _value /* as std::ffi::c_int */);} + } + extern "C" { fn _simple_trace_test_wibble(_context: *mut (), _valu= e: std::ffi::c_int); } + unsafe { _simple_trace_test_wibble(_context, _value); } + let format_string =3D c"Wibble context=3D%p value=3D%d"; + unsafe {::trace::syslog(::trace::LOG_INFO, format_string.as_ptr() = as *const c_char, _context /* as *mut () */, _value /* as std::ffi::c_int *= /);} + } +} + diff --git a/tests/tracetool/all.simpletrace-stap b/tests/tracetool/all.sim= pletrace-stap new file mode 100644 index 00000000000..d064e3e286a --- /dev/null +++ b/tests/tracetool/all.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/all.stap b/tests/tracetool/all.stap new file mode 100644 index 00000000000..9c5d8a527ce --- /dev/null +++ b/tests/tracetool/all.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/all.ust-events-c b/tests/tracetool/all.ust-eve= nts-c new file mode 100644 index 00000000000..db232240568 --- /dev/null +++ b/tests/tracetool/all.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/all.ust-events-h b/tests/tracetool/all.ust-eve= nts-h new file mode 100644 index 00000000000..4621a995fc1 --- /dev/null +++ b/tests/tracetool/all.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 diff --git a/tests/tracetool/meson.build b/tests/tracetool/meson.build index f4f583e6224..b024dc6e405 100644 --- a/tests/tracetool/meson.build +++ b/tests/tracetool/meson.build @@ -11,7 +11,8 @@ backends =3D [ 'log', 'simple', 'syslog', - 'ust' + 'ust', + 'all' ] =20 # The tracetool-test.py program has portability problems on Windows. diff --git a/tests/tracetool/tracetool-test.py b/tests/tracetool/tracetool-= test.py index 74f315a4629..2f6328e68c3 100755 --- a/tests/tracetool/tracetool-test.py +++ b/tests/tracetool/tracetool-test.py @@ -14,16 +14,16 @@ def get_formats(backend): "c", "h", ] - if backend in {"nop", "dtrace", "ftrace", "log", "simple", "syslog"}: + if backend in {"nop", "dtrace", "ftrace", "log", "simple", "syslog", "= all"}: formats +=3D ["rs"] - if backend =3D=3D "dtrace": + if backend in {"dtrace", "all"}: formats +=3D [ "d", "log-stap", "simpletrace-stap", "stap", ] - if backend =3D=3D "ust": + if backend in {"ust", "all"}: formats +=3D [ "ust-events-c", "ust-events-h", @@ -36,8 +36,12 @@ def test_tracetool_one(tracetool, backend, fmt, src_dir,= build_dir): actual_file =3D Path(build_dir, rel_filename) expect_file =3D Path(src_dir, rel_filename) =20 + backends =3D backend + if backends =3D=3D "all": + backends =3D "dtrace,ftrace,log,simple,syslog,ust" + args =3D [sys.executable, tracetool, - f"--format=3D{fmt}", f"--backends=3D{backend}", "--group=3Dtes= tsuite"] + f"--format=3D{fmt}", f"--backends=3D{backends}", "--group=3Dte= stsuite"] =20 if fmt.find("stap") !=3D -1: args +=3D ["--binary=3Dqemu", "--probe-prefix=3Dqemu"] --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646117; cv=none; d=zohomail.com; s=zohoarc; b=c9ML+WvLKQwcE7evQtwMG6DXXwa6NywVSAt2saJWn6FWxj+a2YhcZ1z5LAWnaFBY9bXh1fU/XruBw08eLEY0Umr31e5kAUWa+4DV0U4sHdC2E2lyBj1NAlF80F0REUKMVJlMnuBjYSnR83IKMprhG/hz+BceevY9G7ASEr1gL5Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646117; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gkkz7NQLFS94E1ZeoUXFtFHJe+s6Qg+c1y84IQKKE4k=; b=nZQxDW5dlcKJKUG9BPxLnJQiM6490gw35y5m0qW1++7jEP1gUBd2XnInECn2GOhHZCz7CLru9nANX+FWd+5Z4muEQQFosVYA+7otBjxn1ltiDUnld/MAQPsRJrXI5jn271MoxKxAR1SQDtwevR5RyCCPmLr+e2Euf5FQK5lOJiM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1793646117173310.07827730215035; Mon, 2 Nov 2026 11:01:57 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1468590.1677718 (Exim 4.92) (envelope-from ) id 1xNxHl-0000XF-O6; Mon, 02 Nov 2026 19:01:37 +0000 Received: by outflank-mailman (output) from mailman id 1468590.1677718; Mon, 02 Nov 2026 19:01:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHl-0000Wu-J8; Mon, 02 Nov 2026 19:01:37 +0000 Received: by outflank-mailman (input) for mailman id 1468590; Mon, 02 Nov 2026 19:01:35 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHj-00008g-K5 for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 19:01:35 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xNxHj-000wMH-0p for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 20:01:35 +0100 Received: from [10.42.69.8] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ae8ddf3-2eae-0a2a0a5409dd-0a2a4508abd2-44 for ; Mon, 02 Nov 2026 20:01:34 +0100 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ae8de0d-f659-0a2a45080019-aa0a817c9f39-3 for ; Mon, 02 Nov 2026 20:01:34 +0100 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-677-N5Kyo9okNKqxr5a8po6ZSA-1; Mon, 02 Nov 2026 14:01:31 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A793D1955DEA; Mon, 2 Nov 2026 19:01:29 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 716621803A44; Mon, 2 Nov 2026 19:01:28 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646093; 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=gkkz7NQLFS94E1ZeoUXFtFHJe+s6Qg+c1y84IQKKE4k=; b=AMrfGUXFYnuhMdIId3WUQlqx8O1dtbKb3+hy9Pa28VnUXw9hxjzgLdHz5sfZlpf+Zyd7JO Qg670db/Ai1HU0y0uE9X8X9/8te4wq+195YeGRJrYMGkYGk5t7rzay80EXIPB3gD5nEDHe qxm1ahJ1OEhuO750N+a0HYptJypK7eU= X-MC-Unique: N5Kyo9okNKqxr5a8po6ZSA-1 X-Mimecast-MFC-AGG-ID: N5Kyo9okNKqxr5a8po6ZSA_1793646089 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 13/25] trace: remove redundant headers from simple trace backend code Date: Mon, 2 Nov 2026 13:58:19 -0500 Message-ID: <20261102185831.1880189-14-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-MFC-PROC-ID: 3EBaG5I69wyzjmBnVVCM79BbGDLs6cxfJZCTaYGgrDo_1793646089 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-c1860d/1793646094-CDB4987B-AA5315D1/35/111497 X-purgate-type: clean X-purgate-size: 2149 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646118187154100 From: Daniel P. Berrang=C3=A9 The main formatter for .h/.c files for generated trace code already includes osdep.h and control.h, so it is redundant for the simple trace backend to add them too. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-14-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- tests/tracetool/all.c | 2 -- tests/tracetool/simple.c | 2 -- scripts/tracetool/backend/simple.py | 4 +--- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/tracetool/all.c b/tests/tracetool/all.c index 820ddb575b0..3b8d4d32d17 100644 --- a/tests/tracetool/all.c +++ b/tests/tracetool/all.c @@ -34,8 +34,6 @@ 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" =20 void _simple_trace_test_blah(void *context, const char *filename) diff --git a/tests/tracetool/simple.c b/tests/tracetool/simple.c index 820ddb575b0..3b8d4d32d17 100644 --- a/tests/tracetool/simple.c +++ b/tests/tracetool/simple.c @@ -34,8 +34,6 @@ 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" =20 void _simple_trace_test_blah(void *context, const char *filename) diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/backen= d/simple.py index b131e4fc194..e22683c7d2a 100644 --- a/scripts/tracetool/backend/simple.py +++ b/scripts/tracetool/backend/simple.py @@ -48,9 +48,7 @@ def generate_h_backend_dstate(event, group): =20 =20 def generate_c_begin(events, group): - out('#include "qemu/osdep.h"', - '#include "trace/control.h"', - '#include "trace/simple.h"', + out('#include "trace/simple.h"', '') =20 =20 --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646452; cv=none; d=zohomail.com; s=zohoarc; b=LH7M8XZdI0HmhJ4yOuhbP2WXrOm25oftVR3voEp9G1LbhauiV+AxaJ7U31WzyYgeo+PjqQiz+7adHZILa/w9t/iuNoPTWNAvQuSCQMjZIVr62mPEBd3iPBthGE1+VymZ4ojFgjs56nBk963V0KUgPbmRTVASfeBXdeJzndw0oKM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646452; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DlKbUaAjj04ta+A1/nUMfLg/CAVRg3igZyolJR7CeYY=; b=AeWaxYISEOoKmAlYFGw2zESias0jJibvlx+U8sHcmWB0+mPYrP2/xRbMpXgPykePtdcQHaVDWgRWHxZ2287stIPGn2mKmMq3UmAhsXbUHq1Soz2HKz8OXAwjxo8y5CCf1Dl5RsybvodFrKNfY+SS1eB52QjhZ903ywrveu4OLpc= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793646452639178.40516345927665; Mon, 2 Nov 2026 11:07:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNxIs-0003RG-6Y; Mon, 02 Nov 2026 14:02:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxHq-0001yD-Oj for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:01:43 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxHm-0008Et-Sh for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:01:42 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-692-qHh40kBpP820t_m4fj_mMA-1; Mon, 02 Nov 2026 14:01:33 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7FBBE180ACFD; Mon, 2 Nov 2026 19:01:31 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8E0CD1955F43; Mon, 2 Nov 2026 19:01:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646097; 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=DlKbUaAjj04ta+A1/nUMfLg/CAVRg3igZyolJR7CeYY=; b=GhAIcJxS+QusmjgjbND2DOjVnFMmKHKC6MX2IOKJ1bB/21JXFC9kbLQ8KBKTWDtvE6ozZN g3bxfejIzJUhGyUw4Zn+q9xdpWQZXjh9IivPbYTbqVBtjS/W3FMRXcXTAD7usiFY8dQA1s iFrdB4Dxv6p3LFEeznUgNbnX2R++SoU= X-MC-Unique: qHh40kBpP820t_m4fj_mMA-1 X-Mimecast-MFC-AGG-ID: qHh40kBpP820t_m4fj_mMA_1793646091 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 14/25] trace: include probe name in Rust format strings Date: Mon, 2 Nov 2026 13:58:20 -0500 Message-ID: <20261102185831.1880189-15-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-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=lists1p.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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646453567158501 From: Daniel P. Berrang=C3=A9 The C format strings all include the probe name as a prefix, however, this was missed in the Rust generators for ftrace and syslog. Reviewed-by: Eric Blake Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-15-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- scripts/tracetool/backend/ftrace.py | 2 +- scripts/tracetool/backend/syslog.py | 2 +- tests/tracetool/all.rs | 8 ++++---- tests/tracetool/ftrace.rs | 4 ++-- tests/tracetool/syslog.rs | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/tracetool/backend/ftrace.py b/scripts/tracetool/backen= d/ftrace.py index e03698a2edf..ba2a0c83770 100644 --- a/scripts/tracetool/backend/ftrace.py +++ b/scripts/tracetool/backend/ftrace.py @@ -47,5 +47,5 @@ def generate_h_backend_dstate(event, group): def generate_rs(event, group): out(' let format_string =3D c"%(fmt)s";', ' unsafe {bindings::ftrace_write(format_string.as_ptr() as = *const c_char, %(args)s);}', - fmt=3Dexpand_format_string(event.fmt), + fmt=3Dexpand_format_string(event.fmt, event.name + " "), args=3Devent.args.rust_call_varargs()) diff --git a/scripts/tracetool/backend/syslog.py b/scripts/tracetool/backen= d/syslog.py index 12b826593db..746efd35fb9 100644 --- a/scripts/tracetool/backend/syslog.py +++ b/scripts/tracetool/backend/syslog.py @@ -41,7 +41,7 @@ def generate_h(event, group): def generate_rs(event, group): out(' let format_string =3D c"%(fmt)s";', ' unsafe {::trace::syslog(::trace::LOG_INFO, format_string.= as_ptr() as *const c_char, %(args)s);}', - fmt=3Dexpand_format_string(event.fmt), + fmt=3Dexpand_format_string(event.fmt, event.name + " "), args=3Devent.args.rust_call_varargs()) =20 def generate_h_backend_dstate(event, group): diff --git a/tests/tracetool/all.rs b/tests/tracetool/all.rs index c8c9d288366..14afd86281e 100644 --- a/tests/tracetool/all.rs +++ b/tests/tracetool/all.rs @@ -47,7 +47,7 @@ pub fn trace_test_blah(_context: *mut (), _filename: &std= ::ffi::CStr) { ::trace::probe!(qemu, test_blah, _context, _filename.as_ptr()); if trace_event_state_is_enabled(unsafe { _TRACE_TEST_BLAH_DSTATE}) { - let format_string =3D c"Blah context=3D%p filename=3D%s"; + let format_string =3D c"test_blah Blah context=3D%p filename=3D%s"; unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_= char, _context /* as *mut () */, _filename.as_ptr());} let format_string =3D c"test_blah Blah context=3D%p filename=3D%s\= n"; if (unsafe { bindings::qemu_loglevel } & bindings::LOG_TRACE) !=3D= 0 { @@ -55,7 +55,7 @@ pub fn trace_test_blah(_context: *mut (), _filename: &std= ::ffi::CStr) } extern "C" { fn _simple_trace_test_blah(_context: *mut (), _filena= me: *const std::ffi::c_char); } unsafe { _simple_trace_test_blah(_context, _filename.as_ptr()); } - let format_string =3D c"Blah context=3D%p filename=3D%s"; + let format_string =3D c"test_blah Blah context=3D%p filename=3D%s"; unsafe {::trace::syslog(::trace::LOG_INFO, format_string.as_ptr() = as *const c_char, _context /* as *mut () */, _filename.as_ptr());} } } @@ -75,7 +75,7 @@ pub fn trace_test_wibble(_context: *mut (), _value: std::= ffi::c_int) { ::trace::probe!(qemu, test_wibble, _context, _value); if trace_event_state_is_enabled(unsafe { _TRACE_TEST_WIBBLE_DSTATE}) { - let format_string =3D c"Wibble context=3D%p value=3D%d"; + let format_string =3D c"test_wibble Wibble context=3D%p value=3D%d= "; unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_= char, _context /* as *mut () */, _value /* as std::ffi::c_int */);} let format_string =3D c"test_wibble Wibble context=3D%p value=3D%d= \n"; if (unsafe { bindings::qemu_loglevel } & bindings::LOG_TRACE) !=3D= 0 { @@ -83,7 +83,7 @@ pub fn trace_test_wibble(_context: *mut (), _value: std::= ffi::c_int) } extern "C" { fn _simple_trace_test_wibble(_context: *mut (), _valu= e: std::ffi::c_int); } unsafe { _simple_trace_test_wibble(_context, _value); } - let format_string =3D c"Wibble context=3D%p value=3D%d"; + let format_string =3D c"test_wibble Wibble context=3D%p value=3D%d= "; unsafe {::trace::syslog(::trace::LOG_INFO, format_string.as_ptr() = as *const c_char, _context /* as *mut () */, _value /* as std::ffi::c_int *= /);} } } diff --git a/tests/tracetool/ftrace.rs b/tests/tracetool/ftrace.rs index ff0bcde4b8b..39959d3fdd1 100644 --- a/tests/tracetool/ftrace.rs +++ b/tests/tracetool/ftrace.rs @@ -36,7 +36,7 @@ pub fn trace_test_blah_enabled() -> bool pub fn trace_test_blah(_context: *mut (), _filename: &std::ffi::CStr) { if trace_event_state_is_enabled(unsafe { _TRACE_TEST_BLAH_DSTATE}) { - let format_string =3D c"Blah context=3D%p filename=3D%s"; + let format_string =3D c"test_blah Blah context=3D%p filename=3D%s"; unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_= char, _context /* as *mut () */, _filename.as_ptr());} } } @@ -54,7 +54,7 @@ pub fn trace_test_wibble_enabled() -> bool pub fn trace_test_wibble(_context: *mut (), _value: std::ffi::c_int) { if trace_event_state_is_enabled(unsafe { _TRACE_TEST_WIBBLE_DSTATE}) { - let format_string =3D c"Wibble context=3D%p value=3D%d"; + let format_string =3D c"test_wibble Wibble context=3D%p value=3D%d= "; unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_= char, _context /* as *mut () */, _value /* as std::ffi::c_int */);} } } diff --git a/tests/tracetool/syslog.rs b/tests/tracetool/syslog.rs index 9688dac84a5..b90ad4be7f4 100644 --- a/tests/tracetool/syslog.rs +++ b/tests/tracetool/syslog.rs @@ -36,7 +36,7 @@ pub fn trace_test_blah_enabled() -> bool pub fn trace_test_blah(_context: *mut (), _filename: &std::ffi::CStr) { if trace_event_state_is_enabled(unsafe { _TRACE_TEST_BLAH_DSTATE}) { - let format_string =3D c"Blah context=3D%p filename=3D%s"; + let format_string =3D c"test_blah Blah context=3D%p filename=3D%s"; unsafe {::trace::syslog(::trace::LOG_INFO, format_string.as_ptr() = as *const c_char, _context /* as *mut () */, _filename.as_ptr());} } } @@ -54,7 +54,7 @@ pub fn trace_test_wibble_enabled() -> bool pub fn trace_test_wibble(_context: *mut (), _value: std::ffi::c_int) { if trace_event_state_is_enabled(unsafe { _TRACE_TEST_WIBBLE_DSTATE}) { - let format_string =3D c"Wibble context=3D%p value=3D%d"; + let format_string =3D c"test_wibble Wibble context=3D%p value=3D%d= "; unsafe {::trace::syslog(::trace::LOG_INFO, format_string.as_ptr() = as *const c_char, _context /* as *mut () */, _value /* as std::ffi::c_int *= /);} } } --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646129; cv=none; d=zohomail.com; s=zohoarc; b=ag786mgcIZ7PfSUu2YxXkHCxOgEW5vGuIxkyO3M0ptFXL0rbQ/9G86+HGcdo+HLxRUAtPufDBiaWO4mC2zw+9lMA+2AThfYJ1rMIVpYJekvhgMVu6dCOrSzfFW5plhu4zylIUfdvxqJhwQrLMahq8rISNjTc+sfpmMNwkAXXEok= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646129; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LGa+HMdMyZp+fDqANZnP8jW3DD1gu9BvhH368Mvy95o=; b=GAcDCAXr97phqWPYGGFWx3crAev14kNtPDHRjDhuF6PSWnMgHHyuDoBaolLeMQ2MduISX2ggdGUSmMypKeDNM3OgsdKxKWgH/eKyMeSjefHv7NR1OLgriiITIbmTGVTjmgsGYXjZFSl5ecO6bC5u/eKvLuZrWxjYaVP+vK4mrdQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1793646129065719.518274211685; Mon, 2 Nov 2026 11:02:09 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1468618.1677785 (Exim 4.92) (envelope-from ) id 1xNxI0-00037V-0a; Mon, 02 Nov 2026 19:01:52 +0000 Received: by outflank-mailman (output) from mailman id 1468618.1677785; Mon, 02 Nov 2026 19:01:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHz-00035i-JO; Mon, 02 Nov 2026 19:01:51 +0000 Received: by outflank-mailman (input) for mailman id 1468618; Mon, 02 Nov 2026 19:01:49 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHx-0002hT-7e for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 19:01:49 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xNxHw-00AdPD-Jw for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 20:01:48 +0100 Received: from [10.42.69.3] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ae8de0c-8faa-0a2a0a5109dd-0a2a4503a4a8-44 for ; Mon, 02 Nov 2026 20:01:48 +0100 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ae8de1b-fae8-0a2a45030019-aa0a857c6055-3 for ; Mon, 02 Nov 2026 20:01:48 +0100 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-646-61Hjws2NNHCoyIqTnsAHig-1; Mon, 02 Nov 2026 14:01:42 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 65FD3195422F; Mon, 2 Nov 2026 19:01:40 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 174F81955F73; Mon, 2 Nov 2026 19:01:39 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646107; 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=LGa+HMdMyZp+fDqANZnP8jW3DD1gu9BvhH368Mvy95o=; b=SmetYzaBVH+Es45FhL8vZaYW+xP9Gvl6aqobJXm6oNkZdmgULwKY7cdvf0cBcghPlOZNpx NfaGUhCSW7dZiqtXM5YEgUCfIdzSC6bB8QTNO/c/n/KRlg/IfZoyHWdoe7w9tsjDr1lUut 5CjxlZX7rkuzajNIBmakJPE6vlV70Zc= X-MC-Unique: 61Hjws2NNHCoyIqTnsAHig-1 X-Mimecast-MFC-AGG-ID: 61Hjws2NNHCoyIqTnsAHig_1793646101 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 15/25] trace: add missing newline in ftrace Rust format string Date: Mon, 2 Nov 2026 13:58:21 -0500 Message-ID: <20261102185831.1880189-16-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-MFC-PROC-ID: kRRiJvWyy3jm7ydQmUrayzYbmEn6OZI8JXzF2WjbSlM_1793646101 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-33051d/1793646108-74A894E9-34CEEF0E/35/111497 X-purgate-type: clean X-purgate-size: 3936 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646129631158500 From: Daniel P. Berrang=C3=A9 The ftrace_write() method expects the caller to provide the newline. Reviewed-by: Eric Blake Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-16-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- scripts/tracetool/backend/ftrace.py | 2 +- tests/tracetool/all.rs | 4 ++-- tests/tracetool/ftrace.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/tracetool/backend/ftrace.py b/scripts/tracetool/backen= d/ftrace.py index ba2a0c83770..e304ef21999 100644 --- a/scripts/tracetool/backend/ftrace.py +++ b/scripts/tracetool/backend/ftrace.py @@ -45,7 +45,7 @@ def generate_h_backend_dstate(event, group): event_id=3D"TRACE_" + event.name.upper()) =20 def generate_rs(event, group): - out(' let format_string =3D c"%(fmt)s";', + out(' let format_string =3D c"%(fmt)s\\n";', ' unsafe {bindings::ftrace_write(format_string.as_ptr() as = *const c_char, %(args)s);}', fmt=3Dexpand_format_string(event.fmt, event.name + " "), args=3Devent.args.rust_call_varargs()) diff --git a/tests/tracetool/all.rs b/tests/tracetool/all.rs index 14afd86281e..f48bdf4aab5 100644 --- a/tests/tracetool/all.rs +++ b/tests/tracetool/all.rs @@ -47,7 +47,7 @@ pub fn trace_test_blah(_context: *mut (), _filename: &std= ::ffi::CStr) { ::trace::probe!(qemu, test_blah, _context, _filename.as_ptr()); if trace_event_state_is_enabled(unsafe { _TRACE_TEST_BLAH_DSTATE}) { - let format_string =3D c"test_blah Blah context=3D%p filename=3D%s"; + let format_string =3D c"test_blah Blah context=3D%p filename=3D%s\= n"; unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_= char, _context /* as *mut () */, _filename.as_ptr());} let format_string =3D c"test_blah Blah context=3D%p filename=3D%s\= n"; if (unsafe { bindings::qemu_loglevel } & bindings::LOG_TRACE) !=3D= 0 { @@ -75,7 +75,7 @@ pub fn trace_test_wibble(_context: *mut (), _value: std::= ffi::c_int) { ::trace::probe!(qemu, test_wibble, _context, _value); if trace_event_state_is_enabled(unsafe { _TRACE_TEST_WIBBLE_DSTATE}) { - let format_string =3D c"test_wibble Wibble context=3D%p value=3D%d= "; + let format_string =3D c"test_wibble Wibble context=3D%p value=3D%d= \n"; unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_= char, _context /* as *mut () */, _value /* as std::ffi::c_int */);} let format_string =3D c"test_wibble Wibble context=3D%p value=3D%d= \n"; if (unsafe { bindings::qemu_loglevel } & bindings::LOG_TRACE) !=3D= 0 { diff --git a/tests/tracetool/ftrace.rs b/tests/tracetool/ftrace.rs index 39959d3fdd1..1ad13172b17 100644 --- a/tests/tracetool/ftrace.rs +++ b/tests/tracetool/ftrace.rs @@ -36,7 +36,7 @@ pub fn trace_test_blah_enabled() -> bool pub fn trace_test_blah(_context: *mut (), _filename: &std::ffi::CStr) { if trace_event_state_is_enabled(unsafe { _TRACE_TEST_BLAH_DSTATE}) { - let format_string =3D c"test_blah Blah context=3D%p filename=3D%s"; + let format_string =3D c"test_blah Blah context=3D%p filename=3D%s\= n"; unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_= char, _context /* as *mut () */, _filename.as_ptr());} } } @@ -54,7 +54,7 @@ pub fn trace_test_wibble_enabled() -> bool pub fn trace_test_wibble(_context: *mut (), _value: std::ffi::c_int) { if trace_event_state_is_enabled(unsafe { _TRACE_TEST_WIBBLE_DSTATE}) { - let format_string =3D c"test_wibble Wibble context=3D%p value=3D%d= "; + let format_string =3D c"test_wibble Wibble context=3D%p value=3D%d= \n"; unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_= char, _context /* as *mut () */, _value /* as std::ffi::c_int */);} } } --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646122; cv=none; d=zohomail.com; s=zohoarc; b=XpDqKHbflXpR95imeaffsAgINIQVjsr7eSqOY7YgXQDilL88xaR61hCGbqw5qEeQhH+TzmcUffi+kVeF1UzWc7n+BB7d1gEuh/JaNUD7/6cpN76eCU0bNWfcZmWkLSF1mz6NCRpkmM6dNuZb8EJiscgSk1l7WJeWcKCCXBJviNw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646122; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=j3nROunoF4CikVbyQLt/Mk8W5QtQdfAuIa85rpQ5scA=; b=Fez8CXZTjmBFIkklxi8XM3PRSHc9eKtHXfjimP2U1pAdiHNZkhmOS1jH+xsZQGUDmZbLz1h2ZEQlFSNbI+GGJgdrzpVKW/zW2tGhiBtGrJe7a1KeayctfxxNU66hyFSj/SPCVwMtDCamWSZha7WteNN031KrbxxiC9R73zV6hig= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1793646122989195.45171729792753; Mon, 2 Nov 2026 11:02:02 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1468603.1677752 (Exim 4.92) (envelope-from ) id 1xNxHs-0001l7-Ed; Mon, 02 Nov 2026 19:01:44 +0000 Received: by outflank-mailman (output) from mailman id 1468603.1677752; Mon, 02 Nov 2026 19:01:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHs-0001kB-7q; Mon, 02 Nov 2026 19:01:44 +0000 Received: by outflank-mailman (input) for mailman id 1468603; Mon, 02 Nov 2026 19:01:42 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHq-0001LR-9Y for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 19:01:42 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xNxHp-00AdPD-Md for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 20:01:41 +0100 Received: from [10.42.69.3] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ae8de0c-8faa-0a2a0a5109dd-0a2a4503a4a8-20 for ; Mon, 02 Nov 2026 20:01:41 +0100 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ae8de14-fae8-0a2a45030019-aa0a817c8133-3 for ; Mon, 02 Nov 2026 20:01:41 +0100 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-161-DUNpg03DMMWJpI_aTrXcYA-1; Mon, 02 Nov 2026 14:01:36 -0500 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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 ED08B18015CC; Mon, 2 Nov 2026 19:01:34 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DD4FE433; Mon, 2 Nov 2026 19:01:33 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646100; 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=j3nROunoF4CikVbyQLt/Mk8W5QtQdfAuIa85rpQ5scA=; b=htLIblZnf83p80YeM70ieHYKXG0lTkk7pbRjDY7ZWjZymreeJgs6EmivxODMiXoLIo6p3X 8Gdx04EwpIiay5xioYT1csL+peqs8iPF4PXPpSkNhUegl4pNNx2be+UggZLPTVfT4CWoJX DPGgbUSot6uNpZiBIn+Zkl4IXiJf5w0= X-MC-Unique: DUNpg03DMMWJpI_aTrXcYA-1 X-Mimecast-MFC-AGG-ID: DUNpg03DMMWJpI_aTrXcYA_1793646095 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 16/25] trace: eliminate dupe trace_event_get_state_dynamic_by_id() calls Date: Mon, 2 Nov 2026 13:58:22 -0500 Message-ID: <20261102185831.1880189-17-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 X-Mimecast-MFC-PROC-ID: JQi96BWUWNdkh2ZgXFkvBEoVuvlIrvTikBw1QOcu8Ic_1793646095 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-33051d/1793646101-6C6DE4E9-316E902D/35/111497 X-purgate-type: clean X-purgate-size: 8670 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646123550158501 From: Daniel P. Berrang=C3=A9 Each backend generates the same trace_event_get_state_dynamic_by_id() call for the TRACE....DSTATE() macro body, so when multiple backends are enabled, the same check is repeated: #define TRACE_TEST_WIBBLE_BACKEND_DSTATE() ( \ QEMU_TEST_WIBBLE_ENABLED() || \ trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ tracepoint_enabled(qemu, test_wibble) || \ false) Expanding the use of the 'backend.check_trace_event_get_state' attr in the C header generator removes the duplication, in the same way that the Rust generator already does. Reviewed-by: Eric Blake Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-17-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- tests/tracetool/all.h | 22 ++++++++-------------- scripts/tracetool/backend/__init__.py | 4 ++-- scripts/tracetool/backend/ftrace.py | 4 ---- scripts/tracetool/backend/log.py | 4 ---- scripts/tracetool/backend/simple.py | 5 ----- scripts/tracetool/backend/syslog.py | 4 ---- scripts/tracetool/format/h.py | 8 +++++++- 7 files changed, 17 insertions(+), 34 deletions(-) diff --git a/tests/tracetool/all.h b/tests/tracetool/all.h index 41fa4d0e8a2..5627c1d8930 100644 --- a/tests/tracetool/all.h +++ b/tests/tracetool/all.h @@ -44,11 +44,8 @@ void _simple_trace_test_wibble(void *context, int value); =20 #define TRACE_TEST_BLAH_BACKEND_DSTATE() ( \ QEMU_TEST_BLAH_ENABLED() || \ - trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ - trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ - trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ - trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ tracepoint_enabled(qemu, test_blah) || \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ false) =20 static inline void trace_test_blah(void *context, const char *filename) @@ -58,26 +55,23 @@ static inline void trace_test_blah(void *context, const= char *filename) if (trace_event_get_state(TRACE_TEST_BLAH)) { #line 4 "trace-events" ftrace_write("test_blah " "Blah context=3D%p filename=3D%s" "\n" ,= context, filename); -#line 62 "all.h" +#line 59 "all.h" if (qemu_loglevel_mask(LOG_TRACE)) { #line 4 "trace-events" qemu_log("test_blah " "Blah context=3D%p filename=3D%s" "\n", = context, filename); -#line 66 "all.h" +#line 63 "all.h" } _simple_trace_test_blah(context, filename); #line 4 "trace-events" syslog(LOG_INFO, "test_blah " "Blah context=3D%p filename=3D%s" , = context, filename); -#line 71 "all.h" +#line 68 "all.h" } } =20 #define TRACE_TEST_WIBBLE_BACKEND_DSTATE() ( \ QEMU_TEST_WIBBLE_ENABLED() || \ - trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ - trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ - trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ - trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ tracepoint_enabled(qemu, test_wibble) || \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ false) =20 static inline void trace_test_wibble(void *context, int value) @@ -87,16 +81,16 @@ static inline void trace_test_wibble(void *context, int= value) if (trace_event_get_state(TRACE_TEST_WIBBLE)) { #line 5 "trace-events" ftrace_write("test_wibble " "Wibble context=3D%p value=3D%d" "\n" = , context, value); -#line 91 "all.h" +#line 85 "all.h" if (qemu_loglevel_mask(LOG_TRACE)) { #line 5 "trace-events" qemu_log("test_wibble " "Wibble context=3D%p value=3D%d" "\n",= context, value); -#line 95 "all.h" +#line 89 "all.h" } _simple_trace_test_wibble(context, value); #line 5 "trace-events" syslog(LOG_INFO, "test_wibble " "Wibble context=3D%p value=3D%d" ,= context, value); -#line 100 "all.h" +#line 94 "all.h" } } #endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/scripts/tracetool/backend/__init__.py b/scripts/tracetool/back= end/__init__.py index 9109a783c72..72f549c77c4 100644 --- a/scripts/tracetool/backend/__init__.py +++ b/scripts/tracetool/backend/__init__.py @@ -133,8 +133,8 @@ def generate_begin(self, events, group): def generate(self, event, group, check_trace_event_get_state=3DNone): self._run_function("generate_%s", event, group, check_trace_event_= get_state=3Dcheck_trace_event_get_state) =20 - def generate_backend_dstate(self, event, group): - self._run_function("generate_%s_backend_dstate", event, group) + def generate_backend_dstate(self, event, group, check_trace_event_get_= state=3DNone): + self._run_function("generate_%s_backend_dstate", event, group, che= ck_trace_event_get_state=3Dcheck_trace_event_get_state) =20 def generate_end(self, events, group): self._run_function("generate_%s_end", events, group) diff --git a/scripts/tracetool/backend/ftrace.py b/scripts/tracetool/backen= d/ftrace.py index e304ef21999..94cffc45a9d 100644 --- a/scripts/tracetool/backend/ftrace.py +++ b/scripts/tracetool/backend/ftrace.py @@ -40,10 +40,6 @@ def generate_h(event, group): argnames=3Dargnames) =20 =20 -def generate_h_backend_dstate(event, group): - out(' trace_event_get_state_dynamic_by_id(%(event_id)s) || \\', - event_id=3D"TRACE_" + event.name.upper()) - def generate_rs(event, group): out(' let format_string =3D c"%(fmt)s\\n";', ' unsafe {bindings::ftrace_write(format_string.as_ptr() as = *const c_char, %(args)s);}', diff --git a/scripts/tracetool/backend/log.py b/scripts/tracetool/backend/l= og.py index 9e3e5046f5f..577ee158584 100644 --- a/scripts/tracetool/backend/log.py +++ b/scripts/tracetool/backend/log.py @@ -41,10 +41,6 @@ def generate_h(event, group): argnames=3Dargnames) =20 =20 -def generate_h_backend_dstate(event, group): - out(' trace_event_get_state_dynamic_by_id(%(event_id)s) || \\', - event_id=3D"TRACE_" + event.name.upper()) - def generate_rs(event, group): out(' let format_string =3D c"%(fmt)s\\n";', ' if (unsafe { bindings::qemu_loglevel } & bindings::LOG_TR= ACE) !=3D 0 {', diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/backen= d/simple.py index e22683c7d2a..15f27e26bd5 100644 --- a/scripts/tracetool/backend/simple.py +++ b/scripts/tracetool/backend/simple.py @@ -42,11 +42,6 @@ def generate_h(event, group): args=3D", ".join(event.args.names())) =20 =20 -def generate_h_backend_dstate(event, group): - out(' trace_event_get_state_dynamic_by_id(%(event_id)s) || \\', - event_id=3D"TRACE_" + event.name.upper()) - - def generate_c_begin(events, group): out('#include "trace/simple.h"', '') diff --git a/scripts/tracetool/backend/syslog.py b/scripts/tracetool/backen= d/syslog.py index 746efd35fb9..ba269cb6a33 100644 --- a/scripts/tracetool/backend/syslog.py +++ b/scripts/tracetool/backend/syslog.py @@ -43,7 +43,3 @@ def generate_rs(event, group): ' unsafe {::trace::syslog(::trace::LOG_INFO, format_string.= as_ptr() as *const c_char, %(args)s);}', fmt=3Dexpand_format_string(event.fmt, event.name + " "), args=3Devent.args.rust_call_varargs()) - -def generate_h_backend_dstate(event, group): - out(' trace_event_get_state_dynamic_by_id(%(event_id)s) || \\', - event_id=3D"TRACE_" + event.name.upper()) diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index 6ffb7256e31..5ad3a419f82 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -55,7 +55,13 @@ def generate(events, backend, group): api=3De.api(e.QEMU_BACKEND_DSTATE)) =20 if "disable" not in e.properties: - backend.generate_backend_dstate(e, group) + backend.generate_backend_dstate(e, group, check_trace_event_ge= t_state=3DFalse) + + if backend.check_trace_event_get_state: + event_id =3D 'TRACE_' + e.name.upper() + out(' trace_event_get_state_dynamic_by_id(%(event_id)s)= || \\', + event_id=3Devent_id) + backend.generate_backend_dstate(e, group, check_trace_even= t_get_state=3DTrue) =20 out(' false)') =20 --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646333; cv=none; d=zohomail.com; s=zohoarc; b=l7hzUbw/+eQsiQpuP5c7Df1D7/FwP7VKeRPPtaPqp39Pydr8LPtAc2pMGn6eERJ84bQ+6ssjQZCwpKLMJmwUnTHdCbDh9q5xKUMEV0KHgqwGB5GqZ9dTOL9P5yb0gg+m1vFtlRSVGHod8fkbJzxWUQWw799xBdSaTrnji6UqDEc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646333; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MMzIqwZzfLbxitsjp49xs/Ty7Ev+lHRLVyhej1u9jzk=; b=dZ56gEeEjpai0jUjkGOkvN8ugPYJUV76r+INXb6LbI1JEkm60QdEDWDgV3NG5a5PblySJgPfeoLbhRqmuHYGFNgigCTcaxoQ8rDv5A2p/8fZtpGTdSHg1mvBesknVi8+xL5vgUmyFydW6tejWKsF/n0qcMCfB/Ls1jbO4Xl30qc= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179364633333019.910979703186285; Mon, 2 Nov 2026 11:05:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNxJc-0004dL-OG; Mon, 02 Nov 2026 14:03:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxHs-0001zX-Lx for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:01:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxHq-0008FY-D4 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:01:43 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-342-s3xJ6PC9PZKK1SFQ37zHSg-1; Mon, 02 Nov 2026 14:01:38 -0500 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 46DEA1955D7D; Mon, 2 Nov 2026 19:01:36 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F012A433; Mon, 2 Nov 2026 19:01:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646101; 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=MMzIqwZzfLbxitsjp49xs/Ty7Ev+lHRLVyhej1u9jzk=; b=brprPtGPJEGvkW2E5a1jEle743a7lmWwDF44RqmoPjdweXroP0wNTPXlseveGaZ9WClOTM rTOBJfmdM5LL23hk12dvrs1asBvymd7Y1pBsj9uEk9D84E0nFzFgabhJPdWXTSi7VZlktg 1+h/MHBH1Jx2LozUSxsdkebZCzdNYkY= X-MC-Unique: s3xJ6PC9PZKK1SFQ37zHSg-1 X-Mimecast-MFC-AGG-ID: s3xJ6PC9PZKK1SFQ37zHSg_1793646096 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 17/25] audio: remove mistaken use of trace_event_get_state() Date: Mon, 2 Nov 2026 13:58:23 -0500 Message-ID: <20261102185831.1880189-18-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-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.6 on 10.30.177.95 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=lists1p.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: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646335635154100 From: Daniel P. Berrang=C3=A9 Conditional checks must call trace_event_get_state_backends() which checks the state of all backends (dtrace, ftrace, log, syslog, simple & ust), while trace_event_get_state() only validates state for backends using QEMU's internal state tracking (ftrace, log, syslog, simple). Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-18-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- audio/audio-mixeng-be.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/audio-mixeng-be.c b/audio/audio-mixeng-be.c index f6fd5014e0e..815d4fad2f5 100644 --- a/audio/audio-mixeng-be.c +++ b/audio/audio-mixeng-be.c @@ -1179,7 +1179,7 @@ void audio_run(AudioMixengBackend *s, const char *msg) audio_run_in(s); audio_run_capture(s); =20 - if (trace_event_get_state(TRACE_AUDIO_RUN_POLL)) { + if (trace_event_get_state_backends(TRACE_AUDIO_RUN_POLL)) { /* Convert seconds to microseconds for trace event */ int64_t elapsed_us =3D g_timer_elapsed(s->run_timer, NULL) * MICRO= SECONDS_PER_SECOND; trace_audio_run_poll(msg, elapsed_us); --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646124; cv=none; d=zohomail.com; s=zohoarc; b=d4ZlrjYcdMz82EaHUgrnkDpYyu7TLeijILxAx3h8wFhTzMOE7nFYGOna+MmN1ptpEm9EG8MV7FiuyoSxS5IY4nl9OYmESoTvstetBF9dkU9HWY0MoTysojPZFPh9QjDXLO7mZb6QEPMMCGhA+PyReRuifI70EQbiy9M2ufdZYFM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646124; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4/XTSFHkdQ+Pw5IV0/sk+ny/n4mSrenG0IJ4ieTlAdY=; b=YMIm7wNhdcQFtM8hcVB00yEao7YBqObR6X8VO+pnPoUHqnes/8+xOUBSHL/sMkYsvIOR4L5e14cLm3aeF16YyBtYnM4aFK2+PMDv8yrRfpcUrMC3xwU2i8Gi4FDGbFgn4NEZAcdHHiq7QWxx8L2nACpjSdjqaQD/U6YFN+Fj7LM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 179364612470810.714324691847196; Mon, 2 Nov 2026 11:02:04 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1468613.1677772 (Exim 4.92) (envelope-from ) id 1xNxHw-0002ZF-Bf; Mon, 02 Nov 2026 19:01:48 +0000 Received: by outflank-mailman (output) from mailman id 1468613.1677772; Mon, 02 Nov 2026 19:01:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHw-0002Yu-4F; Mon, 02 Nov 2026 19:01:48 +0000 Received: by outflank-mailman (input) for mailman id 1468613; Mon, 02 Nov 2026 19:01:46 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHu-0002C9-IO for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 19:01:46 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xNxHt-00BpBR-Ti for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 20:01:45 +0100 Received: from [10.42.69.6] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ae8de14-bab6-0a2a0a5309dd-0a2a4506b806-14 for ; Mon, 02 Nov 2026 20:01:45 +0100 Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ae8de18-195a-0a2a45060019-aa0a857c5df1-3 for ; Mon, 02 Nov 2026 20:01:45 +0100 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-404-qqnTlvRmMw6I5OQLW16cZQ-1; Mon, 02 Nov 2026 14:01:39 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8E12B180257A; Mon, 2 Nov 2026 19:01:37 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 283BC1955F73; Mon, 2 Nov 2026 19:01:37 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646104; 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=4/XTSFHkdQ+Pw5IV0/sk+ny/n4mSrenG0IJ4ieTlAdY=; b=h9yRMac/5HPAMyEyt/X5BesMY5dW2tMk1x4VoExkFZ0yP7e010fkrKrPgHifkI1cnSFbF4 5nHwU0Ph6Iu+mrlRfOXumoVxGWfZiGJqXB6uOA2b9t+z3aWN1cT46SLj35plaUK7kDqFWU XSRiN97XfTdbIFkCqhEXgdjLqun1nVQ= X-MC-Unique: qqnTlvRmMw6I5OQLW16cZQ-1 X-Mimecast-MFC-AGG-ID: qqnTlvRmMw6I5OQLW16cZQ_1793646097 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 18/25] hw/ppc: remove mistaken use of trace_event_get_state() Date: Mon, 2 Nov 2026 13:58:24 -0500 Message-ID: <20261102185831.1880189-19-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-MFC-PROC-ID: ju9DYM_7wWY3lIMvJLQ4scz3ENTNjTKLvmO4TxbrYdk_1793646097 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-16d1c6/1793646105-F647377B-CA8F1CA4/35/111497 X-purgate-type: clean X-purgate-size: 2737 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646125517158500 From: Daniel P. Berrang=C3=A9 Conditional checks must call trace_event_get_state_backends() which checks the state of all backends (dtrace, ftrace, log, syslog, simple & ust), while trace_event_get_state() only validates state for backends using QEMU's internal state tracking (ftrace, log, syslog, simple). Furthermore, checking qemu_loglevel_mask() is inappropriate since there are many trace backends, of which 'log' is only one. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-19-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/ppc/vof.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/hw/ppc/vof.c b/hw/ppc/vof.c index 873e967f1e4..e2ff9bf96a3 100644 --- a/hw/ppc/vof.c +++ b/hw/ppc/vof.c @@ -252,8 +252,7 @@ static uint32_t vof_getprop(const void *fdt, uint32_t n= odeph, uint32_t pname, */ ret =3D proplen; /* Do not format a value if tracepoint is silent, for performa= nce */ - if (trace_event_get_state(TRACE_VOF_GETPROP) && - qemu_loglevel_mask(LOG_TRACE)) { + if (trace_event_get_state_backends(TRACE_VOF_GETPROP)) { prop_format(trval, sizeof(trval), prop, ret); } } @@ -337,8 +336,7 @@ static uint32_t vof_setprop(MachineState *ms, void *fdt= , Vof *vof, goto trace_exit; } =20 - if (trace_event_get_state(TRACE_VOF_SETPROP) && - qemu_loglevel_mask(LOG_TRACE)) { + if (trace_event_get_state_backends(TRACE_VOF_SETPROP)) { prop_format(trval, sizeof(trval), val, vallen); } ret =3D vallen; @@ -584,8 +582,7 @@ static uint32_t vof_write(Vof *vof, uint32_t ihandle, u= int32_t buf, } =20 /* FIXME: there is no backend(s) yet so just call a trace */ - if (trace_event_get_state(TRACE_VOF_WRITE) && - qemu_loglevel_mask(LOG_TRACE)) { + if (trace_event_get_state_backends(TRACE_VOF_WRITE)) { tmp[cb] =3D '\0'; trace_vof_write(ihandle, cb, tmp); } @@ -599,9 +596,7 @@ static void vof_claimed_dump(GArray *claimed) int i; OfClaimed c; =20 - if (trace_event_get_state(TRACE_VOF_CLAIMED) && - qemu_loglevel_mask(LOG_TRACE)) { - + if (trace_event_get_state_backends(TRACE_VOF_CLAIMED)) { for (i =3D 0; i < claimed->len; ++i) { c =3D g_array_index(claimed, OfClaimed, i); trace_vof_claimed(c.start, c.start + c.size, c.size); --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646237; cv=none; d=zohomail.com; s=zohoarc; b=Iao/xSrJ05M2xDIG3GtGGqdc/DEq9apNwhBx2/s9Ss4zZSlzVMFTarLfmme0wJL7PeGnauSCVOjFoQx2015tFSNa4/arjgKqR2hIvxprAe5VvvllcA+FNq+ALKtHrXG6ngAEvmRzIFN5A6U70+Wl8sOCjVv8PQO8++2C12DgWgk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646237; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=e7tj2P/oslojgIW5ujruyi9WhhnGXEZAXlDkuQg0Gso=; b=CfpPB8Q5Jqy7J1XNEjv3J5cW9nrsiBTkussLIE57IPP8gcs11HCGtpoqj2prwiu7n2vV9BB8q2komF/z9YGooQtkfShsGH4Rn3ZVNkr0olg1hSR5FH9rX4P4uqyvHHvzUsfgaRraoDhigHSu2PAp6NzkWr4WGT9rwv6VneqeTUY= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793646237090609.0068795432308; Mon, 2 Nov 2026 11:03:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNxIu-0003Z8-3g; Mon, 02 Nov 2026 14:02:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxI0-00025S-9a for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:01:56 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxHw-0008Gy-C4 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:01:51 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-612-yX8_BfRaNQe1Cyd_Mm-UjA-1; Mon, 02 Nov 2026 14:01:42 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 370CB1954102; Mon, 2 Nov 2026 19:01:39 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5D0771800347; Mon, 2 Nov 2026 19:01:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646107; 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=e7tj2P/oslojgIW5ujruyi9WhhnGXEZAXlDkuQg0Gso=; b=eBGIsbKnO+Qcw/GdvGNaj25WktSnCLVymLdAES7HwO+m1MiEfzmaC5rsDmeTr5BssM2vl3 Kf8K4vaNNCXBYVhYTOkwbwD1fRxzH+bg4vcR8FDbLVt6x0FP6mbkaK+GB3xDqU67o2Mbay DHksLBe9n9DJOxwIuG0hbRkr0lIUFfM= X-MC-Unique: yX8_BfRaNQe1Cyd_Mm-UjA-1 X-Mimecast-MFC-AGG-ID: yX8_BfRaNQe1Cyd_Mm-UjA_1793646100 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 19/25] monitor: remove mistaken use of trace_event_get_state() Date: Mon, 2 Nov 2026 13:58:25 -0500 Message-ID: <20261102185831.1880189-20-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-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=lists1p.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: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646240265154100 From: Daniel P. Berrang=C3=A9 Conditional checks must call trace_event_get_state_backends() which checks the state of all backends (dtrace, ftrace, log, syslog, simple & ust), while trace_event_get_state() only validates state for backends using QEMU's internal state tracking (ftrace, log, syslog, simple). Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-20-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- monitor/qmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monitor/qmp.c b/monitor/qmp.c index eb44012643f..8fad090fbe3 100644 --- a/monitor/qmp.c +++ b/monitor/qmp.c @@ -439,7 +439,7 @@ void coroutine_fn monitor_qmp_dispatcher_co(void *data) =20 /* Process request */ if (req_obj->req) { - if (trace_event_get_state(TRACE_MONITOR_QMP_CMD_IN_BAND)) { + if (trace_event_get_state_backends(TRACE_MONITOR_QMP_CMD_IN_BA= ND)) { QDict *qdict =3D qobject_to(QDict, req_obj->req); QObject *id =3D qdict ? qdict_get(qdict, "id") : NULL; GString *id_json; @@ -495,7 +495,7 @@ static void handle_qmp_command(void *opaque, QObject *r= eq, Error *err) =20 if (qdict && qmp_is_oob(qdict)) { /* OOB commands are executed immediately */ - if (trace_event_get_state(TRACE_MONITOR_QMP_CMD_OUT_OF_BAND)) { + if (trace_event_get_state_backends(TRACE_MONITOR_QMP_CMD_OUT_OF_BA= ND)) { QObject *id =3D qdict_get(qdict, "id"); GString *id_json; =20 --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646372; cv=none; d=zohomail.com; s=zohoarc; b=layxSXpC8om2SvMYndJkn9lYW0ChAXdmxx25801JfhnqwX8xVCE0cUllk6RdzlvfVNox53F83248riRx9kRwHsnMUUrddCi0ydlwii+YujE6NiYxI8upszfeFOrve2Btscx12qVxwfMf5HLKi1TAhH8R4mdlxuQUOpuPAtfLBMI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646372; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZUqnAIT+kn2gVCbGPwdufAlH8wXrH5c0eOb7IIBEgIE=; b=Ki48Zn5zcoNFC2ZOoGAmVvdLoRZq2WbVBkO0TIrP2Dl5lHseQ4nUhZmezUnP3/DMHOqNE4BtAnt56lHnbPRspUQn3Il8p0p42GJ+GP+9DSeDmEEPIFBVPcGT43TWN5+ePcgYoNspxo4OpYig3Vh1KnNfm5dERrpJ1KZnpLh336U= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793646372138666.5075111423656; Mon, 2 Nov 2026 11:06:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNxK8-000652-Qa; Mon, 02 Nov 2026 14:04:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxI6-0002D8-Ej for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:02:00 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxI1-0008IZ-HY for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:01:57 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-504-WK9WvSuyNsG6s_k-mVxW5Q-1; Mon, 02 Nov 2026 14:01:49 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 67E5418011D5; Mon, 2 Nov 2026 19:01:47 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 13ABC1800444; Mon, 2 Nov 2026 19:01:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646112; 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=ZUqnAIT+kn2gVCbGPwdufAlH8wXrH5c0eOb7IIBEgIE=; b=aCd550GX4ofDI7gMSPRCEw97dRFVPAE+npQzcUpjRqkd0BwTf2WQg7VKhgOvHyN+zlLeB0 RKj4QEP70NVwh/g/mxvi5I6KHwZ2WWn+u36soPF8eW8lgdVpRxJAbU3hF1eP7MUMzv4G2B XG22YuDOntG+qsaSlw8E8i/kH8XhCsg= X-MC-Unique: WK9WvSuyNsG6s_k-mVxW5Q-1 X-Mimecast-MFC-AGG-ID: WK9WvSuyNsG6s_k-mVxW5Q_1793646107 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 20/25] trace: include qemu_loglevel_mask(LOG_TRACE) in guard Date: Mon, 2 Nov 2026 13:58:26 -0500 Message-ID: <20261102185831.1880189-21-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-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=lists1p.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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646374285154100 From: Daniel P. Berrang=C3=A9 If emitting a trace event requires computation for the parameters passed to the probe, the callers should guard that computation with trace_event_by_state_backends(), which is a macro expanding to a check of the "TRACE_...._DSTATE()" expression. For the log backend this should include a check for LOG_TRACE being present in the configured log level. Reviewed-by: Eric Blake Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-21-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- tests/tracetool/all.h | 34 +++++++++++++++++++------------- tests/tracetool/log.h | 20 +++++++++---------- scripts/tracetool/backend/log.py | 24 +++++++++++++++++----- tests/tracetool/all.rs | 16 +++++++++++---- tests/tracetool/log.rs | 6 ++++-- 5 files changed, 65 insertions(+), 35 deletions(-) diff --git a/tests/tracetool/all.h b/tests/tracetool/all.h index 5627c1d8930..0ae2598eb1d 100644 --- a/tests/tracetool/all.h +++ b/tests/tracetool/all.h @@ -44,6 +44,8 @@ void _simple_trace_test_wibble(void *context, int value); =20 #define TRACE_TEST_BLAH_BACKEND_DSTATE() ( \ QEMU_TEST_BLAH_ENABLED() || \ + (trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) && \ + qemu_loglevel_mask(LOG_TRACE)) || \ tracepoint_enabled(qemu, test_blah) || \ trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ false) @@ -51,25 +53,28 @@ void _simple_trace_test_wibble(void *context, int value= ); static inline void trace_test_blah(void *context, const char *filename) { QEMU_TEST_BLAH(context, filename); + if (trace_event_get_state(TRACE_TEST_BLAH) && + qemu_loglevel_mask(LOG_TRACE)) { +#line 4 "trace-events" + qemu_log("test_blah " "Blah context=3D%p filename=3D%s" "\n", = context, filename); +#line 61 "all.h" + } tracepoint(qemu, test_blah, context, filename); if (trace_event_get_state(TRACE_TEST_BLAH)) { #line 4 "trace-events" ftrace_write("test_blah " "Blah context=3D%p filename=3D%s" "\n" ,= context, filename); -#line 59 "all.h" - if (qemu_loglevel_mask(LOG_TRACE)) { -#line 4 "trace-events" - qemu_log("test_blah " "Blah context=3D%p filename=3D%s" "\n", = context, filename); -#line 63 "all.h" - } +#line 67 "all.h" _simple_trace_test_blah(context, filename); #line 4 "trace-events" syslog(LOG_INFO, "test_blah " "Blah context=3D%p filename=3D%s" , = context, filename); -#line 68 "all.h" +#line 71 "all.h" } } =20 #define TRACE_TEST_WIBBLE_BACKEND_DSTATE() ( \ QEMU_TEST_WIBBLE_ENABLED() || \ + (trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) && \ + qemu_loglevel_mask(LOG_TRACE)) || \ tracepoint_enabled(qemu, test_wibble) || \ trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ false) @@ -77,20 +82,21 @@ static inline void trace_test_blah(void *context, const= char *filename) static inline void trace_test_wibble(void *context, int value) { QEMU_TEST_WIBBLE(context, 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",= context, value); +#line 90 "all.h" + } tracepoint(qemu, test_wibble, context, value); if (trace_event_get_state(TRACE_TEST_WIBBLE)) { #line 5 "trace-events" ftrace_write("test_wibble " "Wibble context=3D%p value=3D%d" "\n" = , context, value); -#line 85 "all.h" - if (qemu_loglevel_mask(LOG_TRACE)) { -#line 5 "trace-events" - qemu_log("test_wibble " "Wibble context=3D%p value=3D%d" "\n",= context, value); -#line 89 "all.h" - } +#line 96 "all.h" _simple_trace_test_wibble(context, value); #line 5 "trace-events" syslog(LOG_INFO, "test_wibble " "Wibble context=3D%p value=3D%d" ,= context, value); -#line 94 "all.h" +#line 100 "all.h" } } #endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/tests/tracetool/log.h b/tests/tracetool/log.h index ff510d54908..9957a854c00 100644 --- a/tests/tracetool/log.h +++ b/tests/tracetool/log.h @@ -16,32 +16,32 @@ extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; =20 =20 #define TRACE_TEST_BLAH_BACKEND_DSTATE() ( \ - trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ + (trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) && \ + qemu_loglevel_mask(LOG_TRACE)) || \ false) =20 static inline void trace_test_blah(void *context, const char *filename) { - if (trace_event_get_state(TRACE_TEST_BLAH)) { - if (qemu_loglevel_mask(LOG_TRACE)) { + if (trace_event_get_state(TRACE_TEST_BLAH) && + qemu_loglevel_mask(LOG_TRACE)) { #line 4 "trace-events" qemu_log("test_blah " "Blah context=3D%p filename=3D%s" "\n", = context, filename); -#line 29 "log.h" - } +#line 30 "log.h" } } =20 #define TRACE_TEST_WIBBLE_BACKEND_DSTATE() ( \ - trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ + (trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) && \ + qemu_loglevel_mask(LOG_TRACE)) || \ false) =20 static inline void trace_test_wibble(void *context, int value) { - if (trace_event_get_state(TRACE_TEST_WIBBLE)) { - if (qemu_loglevel_mask(LOG_TRACE)) { + 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",= context, value); -#line 44 "log.h" - } +#line 45 "log.h" } } #endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/scripts/tracetool/backend/log.py b/scripts/tracetool/backend/l= og.py index 577ee158584..4a622dd4dcb 100644 --- a/scripts/tracetool/backend/log.py +++ b/scripts/tracetool/backend/log.py @@ -16,7 +16,6 @@ =20 =20 PUBLIC =3D True -CHECK_TRACE_EVENT_GET_STATE =3D True =20 =20 def generate_h_begin(events, group): @@ -29,11 +28,13 @@ def generate_h(event, group): if len(event.args) > 0: argnames =3D ", " + argnames =20 - out(' if (qemu_loglevel_mask(LOG_TRACE)) {', + out(' if (trace_event_get_state(%(event_id)s) &&', + ' qemu_loglevel_mask(LOG_TRACE)) {', '#line %(event_lineno)d "%(event_filename)s"', ' qemu_log("%(name)s " %(fmt)s "\\n"%(argnames)s);', '#line %(out_next_lineno)d "%(out_filename)s"', - ' }', + ' }', + event_id=3D"TRACE_" + event.name.upper(), event_lineno=3Devent.lineno, event_filename=3Devent.filename, name=3Devent.name, @@ -41,10 +42,23 @@ def generate_h(event, group): argnames=3Dargnames) =20 =20 +def generate_h_backend_dstate(event, group): + out(' (trace_event_get_state_dynamic_by_id(%(event_id)s) && \\', + ' qemu_loglevel_mask(LOG_TRACE)) || \\', + event_id=3D"TRACE_" + event.name.upper()) + def generate_rs(event, group): - out(' let format_string =3D c"%(fmt)s\\n";', + out(' if trace_event_state_is_enabled(unsafe { _%(event_id)s_DSTATE= }) {', + ' let format_string =3D c"%(fmt)s\\n";', ' if (unsafe { bindings::qemu_loglevel } & bindings::LOG_TR= ACE) !=3D 0 {', ' unsafe { bindings::qemu_log(format_string.as_ptr() as= *const c_char, %(args)s);}', ' }', + ' }', fmt=3Dexpand_format_string(event.fmt, event.name + " "), - args=3Devent.args.rust_call_varargs()) + args=3Devent.args.rust_call_varargs(), + event_id=3D"TRACE_" + event.name.upper()) + +def generate_rs_backend_dstate(event, group): + out(' unsafe { (bindings::qemu_loglevel & bindings::LOG_TRACE) !=3D= 0 &&', + ' trace_event_state_is_enabled(_%(event_id)s_DSTATE) }= ||', + event_id=3D"TRACE_" + event.name.upper()) diff --git a/tests/tracetool/all.rs b/tests/tracetool/all.rs index f48bdf4aab5..448ebce8281 100644 --- a/tests/tracetool/all.rs +++ b/tests/tracetool/all.rs @@ -37,6 +37,8 @@ fn trace_event_state_is_enabled(dstate: u8) -> bool { pub fn trace_test_blah_enabled() -> bool { (unsafe {qemu_test_blah_semaphore.get().read_volatile()}) !=3D 0 || + unsafe { (bindings::qemu_loglevel & bindings::LOG_TRACE) !=3D 0 && + trace_event_state_is_enabled(_TRACE_TEST_BLAH_DSTATE) } || trace_event_state_is_enabled(unsafe { _TRACE_TEST_BLAH_DSTATE}) || false } @@ -47,12 +49,14 @@ pub fn trace_test_blah(_context: *mut (), _filename: &s= td::ffi::CStr) { ::trace::probe!(qemu, test_blah, _context, _filename.as_ptr()); if trace_event_state_is_enabled(unsafe { _TRACE_TEST_BLAH_DSTATE}) { - let format_string =3D c"test_blah Blah context=3D%p filename=3D%s\= n"; - unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_= char, _context /* as *mut () */, _filename.as_ptr());} let format_string =3D c"test_blah Blah context=3D%p filename=3D%s\= n"; if (unsafe { bindings::qemu_loglevel } & bindings::LOG_TRACE) !=3D= 0 { unsafe { bindings::qemu_log(format_string.as_ptr() as *const c= _char, _context /* as *mut () */, _filename.as_ptr());} } + } + if trace_event_state_is_enabled(unsafe { _TRACE_TEST_BLAH_DSTATE}) { + let format_string =3D c"test_blah Blah context=3D%p filename=3D%s\= n"; + unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_= char, _context /* as *mut () */, _filename.as_ptr());} extern "C" { fn _simple_trace_test_blah(_context: *mut (), _filena= me: *const std::ffi::c_char); } unsafe { _simple_trace_test_blah(_context, _filename.as_ptr()); } let format_string =3D c"test_blah Blah context=3D%p filename=3D%s"; @@ -65,6 +69,8 @@ pub fn trace_test_blah(_context: *mut (), _filename: &std= ::ffi::CStr) pub fn trace_test_wibble_enabled() -> bool { (unsafe {qemu_test_wibble_semaphore.get().read_volatile()}) !=3D 0 || + unsafe { (bindings::qemu_loglevel & bindings::LOG_TRACE) !=3D 0 && + trace_event_state_is_enabled(_TRACE_TEST_WIBBLE_DSTATE) } || trace_event_state_is_enabled(unsafe { _TRACE_TEST_WIBBLE_DSTATE}) || false } @@ -75,12 +81,14 @@ pub fn trace_test_wibble(_context: *mut (), _value: std= ::ffi::c_int) { ::trace::probe!(qemu, test_wibble, _context, _value); if trace_event_state_is_enabled(unsafe { _TRACE_TEST_WIBBLE_DSTATE}) { - let format_string =3D c"test_wibble Wibble context=3D%p value=3D%d= \n"; - unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_= char, _context /* as *mut () */, _value /* as std::ffi::c_int */);} let format_string =3D c"test_wibble Wibble context=3D%p value=3D%d= \n"; if (unsafe { bindings::qemu_loglevel } & bindings::LOG_TRACE) !=3D= 0 { unsafe { bindings::qemu_log(format_string.as_ptr() as *const c= _char, _context /* as *mut () */, _value /* as std::ffi::c_int */);} } + } + if trace_event_state_is_enabled(unsafe { _TRACE_TEST_WIBBLE_DSTATE}) { + let format_string =3D c"test_wibble Wibble context=3D%p value=3D%d= \n"; + unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_= char, _context /* as *mut () */, _value /* as std::ffi::c_int */);} extern "C" { fn _simple_trace_test_wibble(_context: *mut (), _valu= e: std::ffi::c_int); } unsafe { _simple_trace_test_wibble(_context, _value); } let format_string =3D c"test_wibble Wibble context=3D%p value=3D%d= "; diff --git a/tests/tracetool/log.rs b/tests/tracetool/log.rs index 0f052bb2c9c..1adb38597e3 100644 --- a/tests/tracetool/log.rs +++ b/tests/tracetool/log.rs @@ -27,7 +27,8 @@ fn trace_event_state_is_enabled(dstate: u8) -> bool { #[allow(dead_code)] pub fn trace_test_blah_enabled() -> bool { - trace_event_state_is_enabled(unsafe { _TRACE_TEST_BLAH_DSTATE}) || + unsafe { (bindings::qemu_loglevel & bindings::LOG_TRACE) !=3D 0 && + trace_event_state_is_enabled(_TRACE_TEST_BLAH_DSTATE) } || false } =20 @@ -47,7 +48,8 @@ pub fn trace_test_blah(_context: *mut (), _filename: &std= ::ffi::CStr) #[allow(dead_code)] pub fn trace_test_wibble_enabled() -> bool { - trace_event_state_is_enabled(unsafe { _TRACE_TEST_WIBBLE_DSTATE}) || + unsafe { (bindings::qemu_loglevel & bindings::LOG_TRACE) !=3D 0 && + trace_event_state_is_enabled(_TRACE_TEST_WIBBLE_DSTATE) } || false } =20 --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646417; cv=none; d=zohomail.com; s=zohoarc; b=LEU1PcL30dyycACCZSl315OBBiIyb+I4e8ia2aOgTMmnnhQfsg46FUOKD492bI2ySzSAfu3vabr3Lg9fYZUJFtsAJddyDKOEfoeswDR80hMk4fo5nsnPqFi+CIDBXesoy+9x1NR8qPITVy7PASA89KCaVB25jtGrY0U1voQsx6o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646417; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=vbjdzJandTBXbN/NbJQon1SW3S6mArhMeBbnMOT68dI=; b=fFyEH5l/SExqplABo59n5Q33YAKK/a91jPzyHCn7UX9z3b3cwyylA3/xfll/H+8DX7dkTo2kb5SoVm9XqEu0UxpfoBHCl7SfqSJtacleamk047Z//N5XPk9RRT6/XTLJBazWSaR9qAWCaleOA03tcheOv0ZtoLXUTXsII/vZBoM= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793646417817599.5511421811651; Mon, 2 Nov 2026 11:06:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNxIm-0002wM-3E; Mon, 02 Nov 2026 14:02:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxI2-00026K-1h for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:01:58 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxHy-0008HJ-Ab for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:01:53 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-307-f8FrEhflMc6y5NwCc4s7bw-1; Mon, 02 Nov 2026 14:01:45 -0500 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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 412771954B04; Mon, 2 Nov 2026 19:01:42 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 610C01956087; Mon, 2 Nov 2026 19:01:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646108; 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=vbjdzJandTBXbN/NbJQon1SW3S6mArhMeBbnMOT68dI=; b=PcFOZTOqp7m08bJua81Boz/j0iZ4dMff7/JcFXn8L5BRcL4BVYs/DsjLVsKWz9rA2NXSDV 30zB2glMqAYrlkprlWTUJFhox2AmNBVUoIWu+DUOJdvASs/owR0Dd7PeWk81f3EGiHot1k nU/Z/sCsGToBI1EUW/jMM+Ob2+s8vqA= X-MC-Unique: f8FrEhflMc6y5NwCc4s7bw-1 X-Mimecast-MFC-AGG-ID: f8FrEhflMc6y5NwCc4s7bw_1793646102 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 21/25] target/hppa: use PRIx64 in trace-events Date: Mon, 2 Nov 2026 13:58:27 -0500 Message-ID: <20261102185831.1880189-22-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-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=lists1p.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: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646421094154100 From: Daniel P. Berrang=C3=A9 %lx is not portable to Windows platforms. This bug was not noticed since the trace events are annotated with 'disable', but this will be removed in the next commit. Addresses should also be prefixed with "0x". Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-22-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- target/hppa/trace-events | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/target/hppa/trace-events b/target/hppa/trace-events index 01761a4559b..9514f039f2d 100644 --- a/target/hppa/trace-events +++ b/target/hppa/trace-events @@ -1,19 +1,19 @@ # See docs/devel/tracing.rst for syntax documentation. =20 # mem_helper.c -disable hppa_tlb_flush_ent(void *env, void *ent, uint64_t va_b, uint64_t v= a_e, uint64_t pa) "env=3D%p ent=3D%p va_b=3D0x%lx va_e=3D0x%lx pa=3D0x%" PR= Ix64 -disable hppa_tlb_find_entry(void *env, void *ent, int valid, uint64_t va_b= , uint64_t va_e, uint64_t pa) "env=3D%p ent=3D%p valid=3D%d va_b=3D0x%lx va= _e=3D0x%lx pa=3D0x%" PRIx64 -disable hppa_tlb_find_entry_not_found(void *env, uint64_t addr) "env=3D%p = addr=3D%08lx" -disable hppa_tlb_get_physical_address(void *env, int ret, int prot, uint64= _t addr, uint64_t phys) "env=3D%p ret=3D%d prot=3D%d addr=3D0x%lx phys=3D0x= %lx" -disable hppa_tlb_fill_excp(void *env, uint64_t addr, int size, int type, i= nt mmu_idx) "env=3D%p addr=3D0x%lx size=3D%d type=3D%d mmu_idx=3D%d" -disable hppa_tlb_fill_success(void *env, uint64_t addr, uint64_t phys, int= size, int type, int mmu_idx) "env=3D%p addr=3D0x%lx phys=3D0x%lx size=3D%d= type=3D%d mmu_idx=3D%d" -disable hppa_tlb_itlba(void *env, void *ent, uint64_t va_b, uint64_t va_e,= uint64_t pa) "env=3D%p ent=3D%p va_b=3D0x%lx va_e=3D0x%lx pa=3D0x%" PRIx64 -disable hppa_tlb_itlbp(void *env, void *ent, int access_id, int u, int pl2= , int pl1, int type, int b, int d, int t) "env=3D%p ent=3D%p access_id=3D%x= u=3D%d pl2=3D%d pl1=3D%d type=3D%d b=3D%d d=3D%d t=3D%d" +disable hppa_tlb_flush_ent(void *env, void *ent, uint64_t va_b, uint64_t v= a_e, uint64_t pa) "env=3D%p ent=3D%p va_b=3D0x%" PRIx64 " va_e=3D0x%" PRIx6= 4 " pa=3D0x%" PRIx64 +disable hppa_tlb_find_entry(void *env, void *ent, int valid, uint64_t va_b= , uint64_t va_e, uint64_t pa) "env=3D%p ent=3D%p valid=3D%d va_b=3D0x%" PRI= x64 " va_e=3D0x%" PRIx64 " pa=3D0x%" PRIx64 +disable hppa_tlb_find_entry_not_found(void *env, uint64_t addr) "env=3D%p = addr=3D0x%" PRIx64 +disable hppa_tlb_get_physical_address(void *env, int ret, int prot, uint64= _t addr, uint64_t phys) "env=3D%p ret=3D%d prot=3D%d addr=3D0x%" PRIx64 " p= hys=3D0x%" PRIx64 "" +disable hppa_tlb_fill_excp(void *env, uint64_t addr, int size, int type, i= nt mmu_idx) "env=3D%p addr=3D0x%" PRIx64 " size=3D%d type=3D%d mmu_idx=3D%d" +disable hppa_tlb_fill_success(void *env, uint64_t addr, uint64_t phys, int= size, int type, int mmu_idx) "env=3D%p addr=3D0x%" PRIx64 " phys=3D0x%" PR= Ix64 " size=3D%d type=3D%d mmu_idx=3D%d" +disable hppa_tlb_itlba(void *env, void *ent, uint64_t va_b, uint64_t va_e,= uint64_t pa) "env=3D%p ent=3D%p va_b=3D0x%" PRIx64 " va_e=3D0x%" PRIx64 " = pa=3D0x%" PRIx64 +disable hppa_tlb_itlbp(void *env, void *ent, int access_id, int u, int pl2= , int pl1, int type, int b, int d, int t) "env=3D%p ent=3D%p access_id=3D0x= %x u=3D%d pl2=3D%d pl1=3D%d type=3D%d b=3D%d d=3D%d t=3D%d" disable hppa_tlb_ptlb(void *env) "env=3D%p" disable hppa_tlb_ptlb_local(void *env) "env=3D%p" disable hppa_tlb_ptlbe(void *env) "env=3D%p" -disable hppa_tlb_lpa_success(void *env, uint64_t addr, uint64_t phys) "env= =3D%p addr=3D0x%lx phys=3D0x%lx" -disable hppa_tlb_lpa_failed(void *env, uint64_t addr) "env=3D%p addr=3D0x%= lx" +disable hppa_tlb_lpa_success(void *env, uint64_t addr, uint64_t phys) "env= =3D%p addr=3D0x%" PRIx64 " phys=3D0x%" PRIx64 "" +disable hppa_tlb_lpa_failed(void *env, uint64_t addr) "env=3D%p addr=3D0x%= " PRIx64 "" =20 # op_helper.c -disable hppa_tlb_probe(uint64_t addr, int level, int want) "addr=3D0x%lx l= evel=3D%d want=3D%d" +disable hppa_tlb_probe(uint64_t addr, int level, int want) "addr=3D0x%" PR= Ix64 " level=3D%d want=3D%d" --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646145; cv=none; d=zohomail.com; s=zohoarc; b=FiwUNAfC/+tnugMzK2s8I9nybC/y0pxrOzzbfXOmbUfvJntUD3lymWzmJNRBrhVmv7Bnkvhf/52l1SIQBJZbk/uled//xTy7ufucHL86NahIA2TCUSQkhVbT6kZEQhwuteydeN71WlNmL4VBp+LwO5RGqNrs5kZFJuKDwVXIUjw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646145; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=bzIJc3V05DowmcLi7i1y5B9HyXtVMAI3zmPBHgeliGU=; b=ivK8Dl34iMZ6UYfW/qvSsP3HlloJ/yw50xupQqiUcsW+XSb7yi8/4KnaH61GlagqbOz1l6neqH9zJfK9KvPJkXvK2Fz2OWmsYQ3p+HbRyvs9+XI6cStzBUJC/iJ1U+9R2LOxeHssZqjmzbrZtmADoAzLXvJNpiwza4pPTcwv3e8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1793646145689828.9055323732031; Mon, 2 Nov 2026 11:02:25 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1468623.1677802 (Exim 4.92) (envelope-from ) id 1xNxI2-0003U5-HH; Mon, 02 Nov 2026 19:01:54 +0000 Received: by outflank-mailman (output) from mailman id 1468623.1677802; Mon, 02 Nov 2026 19:01:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxI1-0003R4-IJ; Mon, 02 Nov 2026 19:01:53 +0000 Received: by outflank-mailman (input) for mailman id 1468623; Mon, 02 Nov 2026 19:01:50 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHy-0002xk-LQ for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 19:01:50 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xNxHy-00BpBR-2D for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 20:01:50 +0100 Received: from [10.42.69.7] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ae8de04-bab6-0a2a0a5309dd-0a2a4507a9a8-46 for ; Mon, 02 Nov 2026 20:01:50 +0100 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ae8de1c-b4ea-0a2a45070019-aa0a817c60c5-3 for ; Mon, 02 Nov 2026 20:01:49 +0100 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-407-3BTEOu_1OvuJtXdIogW4JA-1; Mon, 02 Nov 2026 14:01:45 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 86ADB1955EAE; Mon, 2 Nov 2026 19:01:43 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 380E81955F73; Mon, 2 Nov 2026 19:01:43 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646108; 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=bzIJc3V05DowmcLi7i1y5B9HyXtVMAI3zmPBHgeliGU=; b=MXaQ68344H6uaqwPbfDibYI6uN02o13ySmejZEhKdO9jq52+kYf5FBEoxPBzSPMdCVKmSi oxCUOLN67TPAzVeQD0upYEraYCfR8YnDqZ0BIZyc6tA0/7HzKGqN/YNSt/ELMeGVLbf+wb Q9+rwBayr16PhNcItksquA6GyhY8KEg= X-MC-Unique: 3BTEOu_1OvuJtXdIogW4JA-1 X-Mimecast-MFC-AGG-ID: 3BTEOu_1OvuJtXdIogW4JA_1793646103 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 22/25] trace: remove "disable" property from trace files Date: Mon, 2 Nov 2026 13:58:28 -0500 Message-ID: <20261102185831.1880189-23-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-MFC-PROC-ID: fjCMY9ltxs5OlxDNd9CD4S6f0FgqfH4ABkLbgJ9gD6Q_1793646103 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-ef75cf/1793646110-A4AC8AE4-44547FC5/35/111497 X-purgate-type: clean X-purgate-size: 4924 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646145895158500 From: Daniel P. Berrang=C3=A9 The scenarios are not significant enough to justify its use Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-23-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/display/trace-events | 2 +- target/hppa/trace-events | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/hw/display/trace-events b/hw/display/trace-events index c5e7e42af23..223a085922b 100644 --- a/hw/display/trace-events +++ b/hw/display/trace-events @@ -60,7 +60,7 @@ virtio_gpu_dec_inflight_fences(uint32_t inflight) "in-fli= ght- %u" virtio_gpu_cmd_suspended(uint32_t cmd) "cmd 0x%x" =20 # qxl.c -disable qxl_io_write_vga(int qid, const char *mode, uint32_t addr, uint32_= t val) "%d %s addr=3D%u val=3D%u" +qxl_io_write_vga(int qid, const char *mode, uint32_t addr, uint32_t val) "= %d %s addr=3D%u val=3D%u" qxl_create_guest_primary(int qid, uint32_t width, uint32_t height, uint64_= t mem, uint32_t format, uint32_t position) "%d %ux%u mem=3D0x%" PRIx64 " %u= ,%u" qxl_create_guest_primary_rest(int qid, int32_t stride, uint32_t type, uint= 32_t flags) "%d %d,%d,%d" qxl_destroy_primary(int qid) "%d" diff --git a/target/hppa/trace-events b/target/hppa/trace-events index 9514f039f2d..9fd37b1e2cb 100644 --- a/target/hppa/trace-events +++ b/target/hppa/trace-events @@ -1,19 +1,19 @@ # See docs/devel/tracing.rst for syntax documentation. =20 # mem_helper.c -disable hppa_tlb_flush_ent(void *env, void *ent, uint64_t va_b, uint64_t v= a_e, uint64_t pa) "env=3D%p ent=3D%p va_b=3D0x%" PRIx64 " va_e=3D0x%" PRIx6= 4 " pa=3D0x%" PRIx64 -disable hppa_tlb_find_entry(void *env, void *ent, int valid, uint64_t va_b= , uint64_t va_e, uint64_t pa) "env=3D%p ent=3D%p valid=3D%d va_b=3D0x%" PRI= x64 " va_e=3D0x%" PRIx64 " pa=3D0x%" PRIx64 -disable hppa_tlb_find_entry_not_found(void *env, uint64_t addr) "env=3D%p = addr=3D0x%" PRIx64 -disable hppa_tlb_get_physical_address(void *env, int ret, int prot, uint64= _t addr, uint64_t phys) "env=3D%p ret=3D%d prot=3D%d addr=3D0x%" PRIx64 " p= hys=3D0x%" PRIx64 "" -disable hppa_tlb_fill_excp(void *env, uint64_t addr, int size, int type, i= nt mmu_idx) "env=3D%p addr=3D0x%" PRIx64 " size=3D%d type=3D%d mmu_idx=3D%d" -disable hppa_tlb_fill_success(void *env, uint64_t addr, uint64_t phys, int= size, int type, int mmu_idx) "env=3D%p addr=3D0x%" PRIx64 " phys=3D0x%" PR= Ix64 " size=3D%d type=3D%d mmu_idx=3D%d" -disable hppa_tlb_itlba(void *env, void *ent, uint64_t va_b, uint64_t va_e,= uint64_t pa) "env=3D%p ent=3D%p va_b=3D0x%" PRIx64 " va_e=3D0x%" PRIx64 " = pa=3D0x%" PRIx64 -disable hppa_tlb_itlbp(void *env, void *ent, int access_id, int u, int pl2= , int pl1, int type, int b, int d, int t) "env=3D%p ent=3D%p access_id=3D0x= %x u=3D%d pl2=3D%d pl1=3D%d type=3D%d b=3D%d d=3D%d t=3D%d" -disable hppa_tlb_ptlb(void *env) "env=3D%p" -disable hppa_tlb_ptlb_local(void *env) "env=3D%p" -disable hppa_tlb_ptlbe(void *env) "env=3D%p" -disable hppa_tlb_lpa_success(void *env, uint64_t addr, uint64_t phys) "env= =3D%p addr=3D0x%" PRIx64 " phys=3D0x%" PRIx64 "" -disable hppa_tlb_lpa_failed(void *env, uint64_t addr) "env=3D%p addr=3D0x%= " PRIx64 "" +hppa_tlb_flush_ent(void *env, void *ent, uint64_t va_b, uint64_t va_e, uin= t64_t pa) "env=3D%p ent=3D%p va_b=3D0x%" PRIx64 " va_e=3D0x%" PRIx64 " pa= =3D0x%" PRIx64 +hppa_tlb_find_entry(void *env, void *ent, int valid, uint64_t va_b, uint64= _t va_e, uint64_t pa) "env=3D%p ent=3D%p valid=3D%d va_b=3D0x%" PRIx64 " va= _e=3D0x%" PRIx64 " pa=3D0x%" PRIx64 +hppa_tlb_find_entry_not_found(void *env, uint64_t addr) "env=3D%p addr=3D0= x%" PRIx64 +hppa_tlb_get_physical_address(void *env, int ret, int prot, uint64_t addr,= uint64_t phys) "env=3D%p ret=3D%d prot=3D%d addr=3D0x%" PRIx64 " phys=3D0x= %" PRIx64 "" +hppa_tlb_fill_excp(void *env, uint64_t addr, int size, int type, int mmu_i= dx) "env=3D%p addr=3D0x%" PRIx64 " size=3D%d type=3D%d mmu_idx=3D%d" +hppa_tlb_fill_success(void *env, uint64_t addr, uint64_t phys, int size, i= nt type, int mmu_idx) "env=3D%p addr=3D0x%" PRIx64 " phys=3D0x%" PRIx64 " s= ize=3D%d type=3D%d mmu_idx=3D%d" +hppa_tlb_itlba(void *env, void *ent, uint64_t va_b, uint64_t va_e, uint64_= t pa) "env=3D%p ent=3D%p va_b=3D0x%" PRIx64 " va_e=3D0x%" PRIx64 " pa=3D0x%= " PRIx64 +hppa_tlb_itlbp(void *env, void *ent, int access_id, int u, int pl2, int pl= 1, int type, int b, int d, int t) "env=3D%p ent=3D%p access_id=3D0x%x u=3D%= d pl2=3D%d pl1=3D%d type=3D%d b=3D%d d=3D%d t=3D%d" +hppa_tlb_ptlb(void *env) "env=3D%p" +hppa_tlb_ptlb_local(void *env) "env=3D%p" +hppa_tlb_ptlbe(void *env) "env=3D%p" +hppa_tlb_lpa_success(void *env, uint64_t addr, uint64_t phys) "env=3D%p ad= dr=3D0x%" PRIx64 " phys=3D0x%" PRIx64 "" +hppa_tlb_lpa_failed(void *env, uint64_t addr) "env=3D%p addr=3D0x%" PRIx64= "" =20 # op_helper.c -disable hppa_tlb_probe(uint64_t addr, int level, int want) "addr=3D0x%" PR= Ix64 " level=3D%d want=3D%d" +hppa_tlb_probe(uint64_t addr, int level, int want) "addr=3D0x%" PRIx64 " l= evel=3D%d want=3D%d" --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646129; cv=none; d=zohomail.com; s=zohoarc; b=aXV8isg6dTVZC7141RcA6O0uH7O8E1jYMtvVIN7G0ask3O8Q2LImQslvUS3/au4Q2dCa2WHP14Ryr2OkHrqaDZZdjHp4gx1I4GukZedzqSCJSnJ0Xixw1pXC2Qqo3Fp4F6/PR8Yq6pMWA6iOXpNjwHhn2JaDD0Cm7rFr/OlQi+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646129; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=z+pc48rjFwC1YPMnBCEt4xr6ekBLWcGs39MtawFeyiM=; b=clDqyLEifv39guxNosg94SNJOMqbyLm0o3aSZUQmZU94S0+eHn8YUM0xVdcgDaUwNTGBDMARyEoAUJpiuDNerrF/vOvrRTzi9ymOzzmqTVDd8WeJtS9khSp/+U7X3++EPHxx9roRQsDaVBakeH1xHa4OCtO/HvwT9gpuMc/s5Rk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1793646129668548.8996752704156; Mon, 2 Nov 2026 11:02:09 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1468622.1677796 (Exim 4.92) (envelope-from ) id 1xNxI1-0003Mi-HV; Mon, 02 Nov 2026 19:01:53 +0000 Received: by outflank-mailman (output) from mailman id 1468622.1677796; Mon, 02 Nov 2026 19:01:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxI1-0003JU-0L; Mon, 02 Nov 2026 19:01:53 +0000 Received: by outflank-mailman (input) for mailman id 1468622; Mon, 02 Nov 2026 19:01:50 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xNxHy-0002wP-Du for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 19:01:50 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xNxHx-004HQa-Qp for xen-devel@lists.xenproject.org; Mon, 02 Nov 2026 20:01:49 +0100 Received: from [10.42.69.9] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ae8de18-e002-0a2a0a5209dd-0a2a4509be76-22 for ; Mon, 02 Nov 2026 20:01:49 +0100 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ae8de1c-be1a-0a2a45090019-aa0a817cb28b-3 for ; Mon, 02 Nov 2026 20:01:49 +0100 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-349-Vl0xNe75NwKKz-oKxYQPYg-1; Mon, 02 Nov 2026 14:01:46 -0500 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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 C72931955BF2; Mon, 2 Nov 2026 19:01:44 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7B61426C; Mon, 2 Nov 2026 19:01:44 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646108; 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=z+pc48rjFwC1YPMnBCEt4xr6ekBLWcGs39MtawFeyiM=; b=fGTR06/IjAjjK1hfK7PuSlbyjMIpkvIKbhqngGfP8wmw0O56wEcOTJQpJBpmC0nQA+Lg4p N0Rd1nbAb9ts2Mj3VxS6gNojZVsHVK0lmtN5PDwSVvBckMgE73eZtTzHeRiY7mkG8y8jl1 Dy/IGwoZT95H2vYDfrh8CucadAh1E5A= X-MC-Unique: Vl0xNe75NwKKz-oKxYQPYg-1 X-Mimecast-MFC-AGG-ID: Vl0xNe75NwKKz-oKxYQPYg_1793646104 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 23/25] trace: stop tracking static disabled state Date: Mon, 2 Nov 2026 13:58:29 -0500 Message-ID: <20261102185831.1880189-24-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 X-Mimecast-MFC-PROC-ID: 4EfAVnCjlOepFnfnISTgCkddeJUTrirj1e8d7roqM4c_1793646104 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-bad1c0/1793646109-FD668034-05EE616F/35/111497 X-purgate-type: clean X-purgate-size: 24322 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646130510154100 From: Daniel P. Berrang=C3=A9 The TraceEvent struct contains a "bool sstate" field which track whether a trace event was disabled statically. i.e. at build time via the "disable" property annotation in trace-events. The only runtime use of this field is to let "trace-event-get-state" report that an event is "unavailable" instead of reporting an error for an unknown trace event. Trace events are not ABI so their names can change and the event can come and go at any time. Thus there is little utility in reporting the existence of a disabled event that cannot ever be used at runtime. Removing the "bool sstate" field from TraceEvent saves 8 bytes of space in the struct, adding up to approx 64 KB across all current events. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-24-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- qapi/trace.json | 5 ++-- tests/tracetool/all.h | 14 +++++------ tests/tracetool/dtrace.h | 2 -- tests/tracetool/ftrace.h | 6 ++--- tests/tracetool/log.h | 6 ++--- tests/tracetool/nop.h | 2 -- tests/tracetool/simple.h | 2 -- tests/tracetool/syslog.h | 6 ++--- tests/tracetool/ust.h | 2 -- trace/control-internal.h | 6 ----- trace/control.h | 27 +++----------------- trace/event-internal.h | 2 -- stubs/trace-control.c | 1 - tests/tracetool/all.c | 2 -- tests/tracetool/dtrace.c | 2 -- tests/tracetool/ftrace.c | 2 -- tests/tracetool/log.c | 2 -- tests/tracetool/simple.c | 2 -- tests/tracetool/syslog.c | 2 -- tests/tracetool/ust.c | 2 -- trace/control-target.c | 2 -- trace/control.c | 9 ------- trace/qmp.c | 47 ++++++++++------------------------- scripts/tracetool/format/c.py | 2 -- scripts/tracetool/format/h.py | 8 ------ 25 files changed, 31 insertions(+), 132 deletions(-) diff --git a/qapi/trace.json b/qapi/trace.json index 29c76256055..8533e378977 100644 --- a/qapi/trace.json +++ b/qapi/trace.json @@ -16,8 +16,6 @@ # @TraceEventState: # State of a tracing event. # -# @unavailable: The event is statically disabled. -# # @disabled: The event is dynamically disabled. # # @enabled: The event is dynamically enabled. @@ -25,7 +23,7 @@ # Since: 2.2 ## { 'enum': 'TraceEventState', - 'data': ['unavailable', 'disabled', 'enabled'] } + 'data': ['disabled', 'enabled'] } =20 ## # @TraceEventInfo: @@ -69,6 +67,7 @@ # @enable: Whether to enable tracing. # # @ignore-unavailable: Do not match unavailable events with @name. +# Deprecated: since 11.2 # # Since: 2.2 # diff --git a/tests/tracetool/all.h b/tests/tracetool/all.h index 0ae2598eb1d..01971827e4b 100644 --- a/tests/tracetool/all.h +++ b/tests/tracetool/all.h @@ -10,8 +10,6 @@ extern TraceEvent _TRACE_TEST_BLAH_EVENT; extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; extern uint8_t _TRACE_TEST_BLAH_DSTATE; extern uint8_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 @@ -57,17 +55,17 @@ static inline void trace_test_blah(void *context, const= char *filename) qemu_loglevel_mask(LOG_TRACE)) { #line 4 "trace-events" qemu_log("test_blah " "Blah context=3D%p filename=3D%s" "\n", = context, filename); -#line 61 "all.h" +#line 59 "all.h" } tracepoint(qemu, test_blah, context, filename); if (trace_event_get_state(TRACE_TEST_BLAH)) { #line 4 "trace-events" ftrace_write("test_blah " "Blah context=3D%p filename=3D%s" "\n" ,= context, filename); -#line 67 "all.h" +#line 65 "all.h" _simple_trace_test_blah(context, filename); #line 4 "trace-events" syslog(LOG_INFO, "test_blah " "Blah context=3D%p filename=3D%s" , = context, filename); -#line 71 "all.h" +#line 69 "all.h" } } =20 @@ -86,17 +84,17 @@ static inline void trace_test_wibble(void *context, int= value) qemu_loglevel_mask(LOG_TRACE)) { #line 5 "trace-events" qemu_log("test_wibble " "Wibble context=3D%p value=3D%d" "\n",= context, value); -#line 90 "all.h" +#line 88 "all.h" } tracepoint(qemu, test_wibble, context, value); if (trace_event_get_state(TRACE_TEST_WIBBLE)) { #line 5 "trace-events" ftrace_write("test_wibble " "Wibble context=3D%p value=3D%d" "\n" = , context, value); -#line 96 "all.h" +#line 94 "all.h" _simple_trace_test_wibble(context, value); #line 5 "trace-events" syslog(LOG_INFO, "test_wibble " "Wibble context=3D%p value=3D%d" ,= context, value); -#line 100 "all.h" +#line 98 "all.h" } } #endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/tests/tracetool/dtrace.h b/tests/tracetool/dtrace.h index 0b5b47089e8..b9283851eb0 100644 --- a/tests/tracetool/dtrace.h +++ b/tests/tracetool/dtrace.h @@ -10,8 +10,6 @@ extern TraceEvent _TRACE_TEST_BLAH_EVENT; extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; extern uint8_t _TRACE_TEST_BLAH_DSTATE; extern uint8_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 diff --git a/tests/tracetool/ftrace.h b/tests/tracetool/ftrace.h index b34eef17d10..4eba6b4d599 100644 --- a/tests/tracetool/ftrace.h +++ b/tests/tracetool/ftrace.h @@ -10,8 +10,6 @@ extern TraceEvent _TRACE_TEST_BLAH_EVENT; extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; extern uint8_t _TRACE_TEST_BLAH_DSTATE; extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; -#define TRACE_TEST_BLAH_ENABLED 1 -#define TRACE_TEST_WIBBLE_ENABLED 1 #include "trace/ftrace.h" =20 =20 @@ -24,7 +22,7 @@ static inline void trace_test_blah(void *context, const c= har *filename) if (trace_event_get_state(TRACE_TEST_BLAH)) { #line 4 "trace-events" ftrace_write("test_blah " "Blah context=3D%p filename=3D%s" "\n" ,= context, filename); -#line 28 "ftrace.h" +#line 26 "ftrace.h" } } =20 @@ -37,7 +35,7 @@ static inline void trace_test_wibble(void *context, int v= alue) if (trace_event_get_state(TRACE_TEST_WIBBLE)) { #line 5 "trace-events" ftrace_write("test_wibble " "Wibble context=3D%p value=3D%d" "\n" = , context, value); -#line 41 "ftrace.h" +#line 39 "ftrace.h" } } #endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/tests/tracetool/log.h b/tests/tracetool/log.h index 9957a854c00..9afbe721a47 100644 --- a/tests/tracetool/log.h +++ b/tests/tracetool/log.h @@ -10,8 +10,6 @@ extern TraceEvent _TRACE_TEST_BLAH_EVENT; extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; extern uint8_t _TRACE_TEST_BLAH_DSTATE; extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; -#define TRACE_TEST_BLAH_ENABLED 1 -#define TRACE_TEST_WIBBLE_ENABLED 1 #include "qemu/log-for-trace.h" =20 =20 @@ -26,7 +24,7 @@ static inline void trace_test_blah(void *context, const c= har *filename) qemu_loglevel_mask(LOG_TRACE)) { #line 4 "trace-events" qemu_log("test_blah " "Blah context=3D%p filename=3D%s" "\n", = context, filename); -#line 30 "log.h" +#line 28 "log.h" } } =20 @@ -41,7 +39,7 @@ static inline void trace_test_wibble(void *context, int v= alue) qemu_loglevel_mask(LOG_TRACE)) { #line 5 "trace-events" qemu_log("test_wibble " "Wibble context=3D%p value=3D%d" "\n",= context, value); -#line 45 "log.h" +#line 43 "log.h" } } #endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/tests/tracetool/nop.h b/tests/tracetool/nop.h index 64b6b005684..00771577943 100644 --- a/tests/tracetool/nop.h +++ b/tests/tracetool/nop.h @@ -8,8 +8,6 @@ =20 #define _TRACE_TEST_BLAH_DSTATE 0 #define _TRACE_TEST_WIBBLE_DSTATE 0 -#define TRACE_TEST_BLAH_ENABLED 1 -#define TRACE_TEST_WIBBLE_ENABLED 1 =20 #define TRACE_TEST_BLAH_BACKEND_DSTATE() ( \ false) diff --git a/tests/tracetool/simple.h b/tests/tracetool/simple.h index 735cb21d911..9b066364b0a 100644 --- a/tests/tracetool/simple.h +++ b/tests/tracetool/simple.h @@ -10,8 +10,6 @@ extern TraceEvent _TRACE_TEST_BLAH_EVENT; extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; extern uint8_t _TRACE_TEST_BLAH_DSTATE; extern uint8_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); =20 diff --git a/tests/tracetool/syslog.h b/tests/tracetool/syslog.h index 4203b8b37dc..6a9304489f6 100644 --- a/tests/tracetool/syslog.h +++ b/tests/tracetool/syslog.h @@ -10,8 +10,6 @@ extern TraceEvent _TRACE_TEST_BLAH_EVENT; extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; extern uint8_t _TRACE_TEST_BLAH_DSTATE; extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; -#define TRACE_TEST_BLAH_ENABLED 1 -#define TRACE_TEST_WIBBLE_ENABLED 1 #include =20 =20 @@ -24,7 +22,7 @@ static inline void trace_test_blah(void *context, const c= har *filename) 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" +#line 26 "syslog.h" } } =20 @@ -37,7 +35,7 @@ static inline void trace_test_wibble(void *context, int v= alue) 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 41 "syslog.h" +#line 39 "syslog.h" } } #endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/tests/tracetool/ust.h b/tests/tracetool/ust.h index 079b2c74491..c6c5d6d7c1c 100644 --- a/tests/tracetool/ust.h +++ b/tests/tracetool/ust.h @@ -10,8 +10,6 @@ extern TraceEvent _TRACE_TEST_BLAH_EVENT; extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; extern uint8_t _TRACE_TEST_BLAH_DSTATE; extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; -#define TRACE_TEST_BLAH_ENABLED 1 -#define TRACE_TEST_WIBBLE_ENABLED 1 #include #include "trace-ust-testsuite.h" =20 diff --git a/trace/control-internal.h b/trace/control-internal.h index f626b047264..9a95e6714bb 100644 --- a/trace/control-internal.h +++ b/trace/control-internal.h @@ -33,12 +33,6 @@ static inline const char * trace_event_get_name(TraceEve= nt *ev) return ev->name; } =20 -static inline bool trace_event_get_state_static(TraceEvent *ev) -{ - assert(ev !=3D NULL); - return ev->sstate; -} - /* it's on fast path, avoid consistency checks (asserts) */ #define trace_event_get_state_dynamic_by_id(id) \ (unlikely(trace_events_enabled_count) && _ ## id ## _DSTATE) diff --git a/trace/control.h b/trace/control.h index e77c07a8e68..71f254728d4 100644 --- a/trace/control.h +++ b/trace/control.h @@ -102,39 +102,21 @@ static const char * trace_event_get_name(TraceEvent *= ev); * @id: Event identifier name. * * Get the tracing state of an event, both static and the QEMU dynamic sta= te. - * - * If the event has the disabled property, the check will have no performa= nce - * impact. */ #define trace_event_get_state(id) \ - ((id ##_ENABLED) && trace_event_get_state_dynamic_by_id(id)) + (trace_event_get_state_dynamic_by_id(id)) =20 /** * trace_event_get_state_backends: * @id: Event identifier name. * - * Get the tracing state of an event, both static and dynamic state from a= ll + * Get the tracing state of an event from all * compiled-in backends. * - * If the event has the disabled property, the check will have no performa= nce - * impact. - * - * Returns: true if at least one backend has the event enabled and the eve= nt - * does not have the disabled property. + * Returns: true if at least one backend has the event enabled */ #define trace_event_get_state_backends(id) \ - ((id ##_ENABLED) && id ##_BACKEND_DSTATE()) - -/** - * trace_event_get_state_static: - * @id: Event identifier. - * - * Get the static tracing state of an event. - * - * Use the define 'TRACE_${EVENT_NAME}_ENABLED' for compile-time checks (i= t will - * be set to 1 or 0 according to the presence of the disabled property). - */ -static bool trace_event_get_state_static(TraceEvent *ev); + (id ##_BACKEND_DSTATE()) =20 /** * trace_event_get_state_dynamic: @@ -148,7 +130,6 @@ static bool trace_event_get_state_dynamic(TraceEvent *e= v); * * Set the dynamic tracing state of an event. * - * Pre-condition: trace_event_get_state_static(ev) =3D=3D true */ void trace_event_set_state_dynamic(TraceEvent *ev, bool state); =20 diff --git a/trace/event-internal.h b/trace/event-internal.h index ad1578aa2c5..40f06691063 100644 --- a/trace/event-internal.h +++ b/trace/event-internal.h @@ -14,7 +14,6 @@ * TraceEvent: * @id: Unique event identifier. * @name: Event name. - * @sstate: Static tracing state. * @dstate: Dynamic tracing state * * Opaque generic description of a tracing event. @@ -24,7 +23,6 @@ typedef struct TraceEvent { uint32_t id; #endif const char * name; - const bool sstate; uint8_t *dstate; } TraceEvent; =20 diff --git a/stubs/trace-control.c b/stubs/trace-control.c index 3f196835db0..6016307ed8b 100644 --- a/stubs/trace-control.c +++ b/stubs/trace-control.c @@ -14,7 +14,6 @@ void trace_event_set_state_dynamic(TraceEvent *ev, bool state) { bool state_pre; - assert(trace_event_get_state_static(ev)); =20 /* * We ignore the "vcpu" property here, since there's no target code. T= hen diff --git a/tests/tracetool/all.c b/tests/tracetool/all.c index 3b8d4d32d17..670f9f06e85 100644 --- a/tests/tracetool/all.c +++ b/tests/tracetool/all.c @@ -12,7 +12,6 @@ TraceEvent _TRACE_TEST_BLAH_EVENT =3D { .id =3D 0, #endif .name =3D "test_blah", - .sstate =3D TRACE_TEST_BLAH_ENABLED, .dstate =3D &_TRACE_TEST_BLAH_DSTATE }; TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { @@ -20,7 +19,6 @@ TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { .id =3D 0, #endif .name =3D "test_wibble", - .sstate =3D TRACE_TEST_WIBBLE_ENABLED, .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE }; TraceEvent *testsuite_trace_events[] =3D { diff --git a/tests/tracetool/dtrace.c b/tests/tracetool/dtrace.c index f83d06252ea..d51ba85503a 100644 --- a/tests/tracetool/dtrace.c +++ b/tests/tracetool/dtrace.c @@ -12,7 +12,6 @@ TraceEvent _TRACE_TEST_BLAH_EVENT =3D { .id =3D 0, #endif .name =3D "test_blah", - .sstate =3D TRACE_TEST_BLAH_ENABLED, .dstate =3D &_TRACE_TEST_BLAH_DSTATE }; TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { @@ -20,7 +19,6 @@ TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { .id =3D 0, #endif .name =3D "test_wibble", - .sstate =3D TRACE_TEST_WIBBLE_ENABLED, .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE }; TraceEvent *testsuite_trace_events[] =3D { diff --git a/tests/tracetool/ftrace.c b/tests/tracetool/ftrace.c index f83d06252ea..d51ba85503a 100644 --- a/tests/tracetool/ftrace.c +++ b/tests/tracetool/ftrace.c @@ -12,7 +12,6 @@ TraceEvent _TRACE_TEST_BLAH_EVENT =3D { .id =3D 0, #endif .name =3D "test_blah", - .sstate =3D TRACE_TEST_BLAH_ENABLED, .dstate =3D &_TRACE_TEST_BLAH_DSTATE }; TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { @@ -20,7 +19,6 @@ TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { .id =3D 0, #endif .name =3D "test_wibble", - .sstate =3D TRACE_TEST_WIBBLE_ENABLED, .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE }; TraceEvent *testsuite_trace_events[] =3D { diff --git a/tests/tracetool/log.c b/tests/tracetool/log.c index f83d06252ea..d51ba85503a 100644 --- a/tests/tracetool/log.c +++ b/tests/tracetool/log.c @@ -12,7 +12,6 @@ TraceEvent _TRACE_TEST_BLAH_EVENT =3D { .id =3D 0, #endif .name =3D "test_blah", - .sstate =3D TRACE_TEST_BLAH_ENABLED, .dstate =3D &_TRACE_TEST_BLAH_DSTATE }; TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { @@ -20,7 +19,6 @@ TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { .id =3D 0, #endif .name =3D "test_wibble", - .sstate =3D TRACE_TEST_WIBBLE_ENABLED, .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE }; TraceEvent *testsuite_trace_events[] =3D { diff --git a/tests/tracetool/simple.c b/tests/tracetool/simple.c index 3b8d4d32d17..670f9f06e85 100644 --- a/tests/tracetool/simple.c +++ b/tests/tracetool/simple.c @@ -12,7 +12,6 @@ TraceEvent _TRACE_TEST_BLAH_EVENT =3D { .id =3D 0, #endif .name =3D "test_blah", - .sstate =3D TRACE_TEST_BLAH_ENABLED, .dstate =3D &_TRACE_TEST_BLAH_DSTATE }; TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { @@ -20,7 +19,6 @@ TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { .id =3D 0, #endif .name =3D "test_wibble", - .sstate =3D TRACE_TEST_WIBBLE_ENABLED, .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE }; TraceEvent *testsuite_trace_events[] =3D { diff --git a/tests/tracetool/syslog.c b/tests/tracetool/syslog.c index f83d06252ea..d51ba85503a 100644 --- a/tests/tracetool/syslog.c +++ b/tests/tracetool/syslog.c @@ -12,7 +12,6 @@ TraceEvent _TRACE_TEST_BLAH_EVENT =3D { .id =3D 0, #endif .name =3D "test_blah", - .sstate =3D TRACE_TEST_BLAH_ENABLED, .dstate =3D &_TRACE_TEST_BLAH_DSTATE }; TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { @@ -20,7 +19,6 @@ TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { .id =3D 0, #endif .name =3D "test_wibble", - .sstate =3D TRACE_TEST_WIBBLE_ENABLED, .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE }; TraceEvent *testsuite_trace_events[] =3D { diff --git a/tests/tracetool/ust.c b/tests/tracetool/ust.c index f83d06252ea..d51ba85503a 100644 --- a/tests/tracetool/ust.c +++ b/tests/tracetool/ust.c @@ -12,7 +12,6 @@ TraceEvent _TRACE_TEST_BLAH_EVENT =3D { .id =3D 0, #endif .name =3D "test_blah", - .sstate =3D TRACE_TEST_BLAH_ENABLED, .dstate =3D &_TRACE_TEST_BLAH_DSTATE }; TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { @@ -20,7 +19,6 @@ TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { .id =3D 0, #endif .name =3D "test_wibble", - .sstate =3D TRACE_TEST_WIBBLE_ENABLED, .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE }; TraceEvent *testsuite_trace_events[] =3D { diff --git a/trace/control-target.c b/trace/control-target.c index 87b0f5037df..348125a5822 100644 --- a/trace/control-target.c +++ b/trace/control-target.c @@ -12,8 +12,6 @@ =20 void trace_event_set_state_dynamic(TraceEvent *ev, bool state) { - assert(trace_event_get_state_static(ev)); - bool state_pre =3D *ev->dstate; if (state_pre !=3D state) { if (state) { diff --git a/trace/control.c b/trace/control.c index 947b220056a..d414b1a9072 100644 --- a/trace/control.c +++ b/trace/control.c @@ -167,15 +167,6 @@ static void do_trace_enable_events(const char *line_bu= f) =20 trace_event_iter_init_pattern(&iter, line_ptr); while ((ev =3D trace_event_iter_next(&iter)) !=3D NULL) { - if (!trace_event_get_state_static(ev)) { - if (!is_pattern) { - warn_report("trace event '%s' is not traceable", - line_ptr); - return; - } - continue; - } - /* start tracing */ trace_event_set_state_dynamic(ev, enable); if (!is_pattern) { diff --git a/trace/qmp.c b/trace/qmp.c index 074a27b204f..331496a1471 100644 --- a/trace/qmp.c +++ b/trace/qmp.c @@ -11,9 +11,10 @@ #include "qapi/error.h" #include "qapi/qapi-commands-trace.h" #include "control.h" +#include "qemu/error-report.h" =20 =20 -static bool check_events(bool ignore_unavailable, bool is_pattern, +static bool check_events(bool is_pattern, const char *name, Error **errp) { if (!is_pattern) { @@ -24,27 +25,8 @@ static bool check_events(bool ignore_unavailable, bool i= s_pattern, error_setg(errp, "unknown event \"%s\"", name); return false; } - - /* error for unavailable event */ - if (!ignore_unavailable && !trace_event_get_state_static(ev)) { - error_setg(errp, "event \"%s\" is disabled", name); - return false; - } - - return true; - } else { - /* error for unavailable events */ - TraceEventIter iter; - TraceEvent *ev; - trace_event_iter_init_pattern(&iter, name); - while ((ev =3D trace_event_iter_next(&iter)) !=3D NULL) { - if (!ignore_unavailable && !trace_event_get_state_static(ev)) { - error_setg(errp, "event \"%s\" is disabled", trace_event_g= et_name(ev)); - return false; - } - } - return true; } + return true; } =20 TraceEventInfoList *qmp_trace_event_get_state(const char *name, @@ -56,7 +38,7 @@ TraceEventInfoList *qmp_trace_event_get_state(const char = *name, bool is_pattern =3D trace_event_is_pattern(name); =20 /* Check events */ - if (!check_events(true, is_pattern, name, errp)) { + if (!check_events(is_pattern, name, errp)) { return NULL; } =20 @@ -68,14 +50,10 @@ TraceEventInfoList *qmp_trace_event_get_state(const cha= r *name, value =3D g_new(TraceEventInfo, 1); value->name =3D g_strdup(trace_event_get_name(ev)); =20 - if (!trace_event_get_state_static(ev)) { - value->state =3D TRACE_EVENT_STATE_UNAVAILABLE; + if (trace_event_get_state_dynamic(ev)) { + value->state =3D TRACE_EVENT_STATE_ENABLED; } else { - if (trace_event_get_state_dynamic(ev)) { - value->state =3D TRACE_EVENT_STATE_ENABLED; - } else { - value->state =3D TRACE_EVENT_STATE_DISABLED; - } + value->state =3D TRACE_EVENT_STATE_DISABLED; } QAPI_LIST_PREPEND(events, value); } @@ -91,18 +69,19 @@ void qmp_trace_event_set_state(const char *name, bool e= nable, TraceEvent *ev; bool is_pattern =3D trace_event_is_pattern(name); =20 + if (has_ignore_unavailable && ignore_unavailable) { + warn_report_once("the 'ignore-unavailable' property is deprecated " + "and has no effect"); + } + /* Check events */ - if (!check_events(has_ignore_unavailable && ignore_unavailable, - is_pattern, name, errp)) { + if (!check_events(is_pattern, name, errp)) { return; } =20 /* Apply changes (all errors checked above) */ trace_event_iter_init_pattern(&iter, name); while ((ev =3D trace_event_iter_next(&iter)) !=3D NULL) { - if (!trace_event_get_state_static(ev)) { - continue; - } trace_event_set_state_dynamic(ev, enable); } } diff --git a/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py index 5f6669c917c..9f06894623e 100644 --- a/scripts/tracetool/format/c.py +++ b/scripts/tracetool/format/c.py @@ -39,12 +39,10 @@ def generate(events, backend, group): ' .id =3D 0,', '#endif', ' .name =3D \"%(name)s\",', - ' .sstate =3D %(sstate)s,', ' .dstate =3D &%(dstate)s', '};', event =3D e.api(e.QEMU_EVENT), name =3D e.name, - sstate =3D "TRACE_%s_ENABLED" % e.name.upper(), dstate =3D e.api(e.QEMU_DSTATE)) =20 out('TraceEvent *%(group)s_trace_events[] =3D {', diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index 5ad3a419f82..544bbc0ba93 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -38,14 +38,6 @@ def generate(events, backend, group): for e in events: out('#define %s 0' % e.api(e.QEMU_DSTATE)) =20 - # static state - for e in events: - if 'disable' in e.properties: - enabled =3D 0 - else: - enabled =3D 1 - out('#define TRACE_%s_ENABLED %d' % (e.name.upper(), enabled)) - backend.generate_begin(events, group) =20 for e in events: --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646480; cv=none; d=zohomail.com; s=zohoarc; b=SrlCODcB0m/Y/FHsUbZQ0cF7lO75eL6Br1A46mu1L1nGLBbZkvVM3lih9Brs9IBDsIcJl+RTKb6Y5MKhKxHsY3reV+r7deH5auN/PCr2+NLdflIQ9jSua6kH6RbFHDkWkwgBWsVSLP89kKsiWqLCkz0MBiK8TnCC96rmPNV8R5E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646480; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iBUiZ9J/MXAwZUcV5uBewFxgpdyM35rzQHUpr8XDSZ8=; b=R+D1evg2lTbRmTxyMKSL9fmBttnED2I7ErTN1O4tku7krocC0FvgFxOJn+t9dSIp+zF06LCYASpEEvpBGmnfxwcIXBf/q9ati69BTsOC0zMiRgYx7wKxM2rk+YkFTSxw7BGH9KA74rInCnQFumNKYZV59ButIkkeilYY8j5cQiU= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793646480885838.307233682806; Mon, 2 Nov 2026 11:08:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNxKA-0006IU-BI; Mon, 02 Nov 2026 14:04:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxI7-0002E0-6c for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:02:00 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxI1-0008IX-MT for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:01:58 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-427-pRTpHzqOP7mjowoEFBt9TQ-1; Mon, 02 Nov 2026 14:01:47 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 00BBA1955F12; Mon, 2 Nov 2026 19:01:46 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A605B1955F43; Mon, 2 Nov 2026 19:01:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646112; 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=iBUiZ9J/MXAwZUcV5uBewFxgpdyM35rzQHUpr8XDSZ8=; b=AZGKmVptru0N5AAXrinWvl13tCsI6ehEcmgoakiImeNzbaCUsOn090ayY8FxkDyaQXFYgW cvUDLaGgLNlJAiYFG4cbB2wXWvKCuCm5j3sXSjM7IAWQvpkzknzYqWL3vVmVnrXH+6fiac 0uUppqQzCIdKtPuMPY/QJfwfqjdO4jo= X-MC-Unique: pRTpHzqOP7mjowoEFBt9TQ-1 X-Mimecast-MFC-AGG-ID: pRTpHzqOP7mjowoEFBt9TQ_1793646106 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 24/25] trace: remove parsing of "disable" event property Date: Mon, 2 Nov 2026 13:58:30 -0500 Message-ID: <20261102185831.1880189-25-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-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=lists1p.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: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646483999154100 From: Daniel P. Berrang=C3=A9 Finish the removal of the "disable" event property by removing code that parses properties and the backend code generators. This "fixes" a bug in the UST backends which looked for a property called "disabled" instead of "disable". Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-25-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- docs/devel/tracing.rst | 27 +++--------------- scripts/tracetool/__init__.py | 27 ++++-------------- scripts/tracetool/backend/dtrace.py | 2 -- scripts/tracetool/format/c.py | 9 ++---- scripts/tracetool/format/d.py | 3 -- scripts/tracetool/format/h.py | 30 +++++++++----------- scripts/tracetool/format/log_stap.py | 3 -- scripts/tracetool/format/rs.py | 26 ++++++++--------- scripts/tracetool/format/simpletrace_stap.py | 3 -- scripts/tracetool/format/stap.py | 3 -- scripts/tracetool/format/ust_events_c.py | 3 -- scripts/tracetool/format/ust_events_h.py | 3 -- 12 files changed, 39 insertions(+), 100 deletions(-) diff --git a/docs/devel/tracing.rst b/docs/devel/tracing.rst index f4557ee20e4..4bc344f0331 100644 --- a/docs/devel/tracing.rst +++ b/docs/devel/tracing.rst @@ -230,9 +230,6 @@ The "nop" backend generates empty trace event functions= so that the compiler can optimize out trace events completely. This imposes no performance penalty. =20 -Note that regardless of the selected trace backend, events with the "disab= le" -property will be generated with the "nop" backend. - Log --- =20 @@ -366,30 +363,14 @@ To facilitate simple usage of systemtap where there m= erely needs to be printf logging of certain probes, a helper script "qemu-trace-stap" is provided. Consult its manual page for guidance on its usage. =20 -Trace event properties +Trace event conditions =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -Each event in the "trace-events-all" file can be prefixed with a space-sep= arated -list of zero or more of the following event properties. - -"disable" ---------- - -If a specific trace event is going to be invoked a huge number of times, t= his -might have a noticeable performance impact even when the event is -programmatically disabled. - -In this case you should declare such event with the "disable" property. Th= is -will effectively disable the event at compile time (by using the "nop" bac= kend), -thus having no performance impact at all on regular builds (i.e., unless y= ou -edit the "trace-events-all" file). - -In addition, there might be cases where relatively complex computations mu= st be +There might be cases where relatively complex computations must be performed to generate values that are only used as arguments for a trace function. In these cases you can use 'trace_event_get_state_backends()' to -guard such computations, so they are skipped if the event has been either -compile-time disabled or run-time disabled. If the event is compile-time -disabled, this check will have no performance impact. +guard such computations, so they are skipped if the event is not currently +enabled: =20 :: =20 diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py index 6ed7cdd6ce4..bdbb06b5205 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -362,8 +362,6 @@ class Event(object): The event name. fmt : str The event format string. - properties : set(str) - Properties of the event. args : Arguments The event arguments. lineno : int @@ -373,23 +371,18 @@ class Event(object): =20 """ =20 - _CRE =3D re.compile(r"((?P[\w\s]+)\s+)?" - r"(?P\w+)" + _CRE =3D re.compile(r"(?P\w+)" r"\((?P[^)]*)\)" r"\s*" r"(?P\".+)?" r"\s*") =20 - _VALID_PROPS =3D set(["disable"]) - - def __init__(self, name, props, fmt, args, lineno, filename): + def __init__(self, name, fmt, args, lineno, filename): """ Parameters ---------- name : string Event name. - props : list of str - Property names. fmt : str Event printing format string. args : Arguments @@ -401,7 +394,6 @@ def __init__(self, name, props, fmt, args, lineno, file= name): =20 """ self.name =3D name - self.properties =3D props self.fmt =3D fmt self.args =3D args self.lineno =3D int(lineno) @@ -411,11 +403,6 @@ def __init__(self, name, props, fmt, args, lineno, fil= ename): raise ValueError("Event '%s' has more than maximum permitted " "argument count" % name) =20 - unknown_props =3D set(self.properties) - self._VALID_PROPS - if len(unknown_props) > 0: - raise ValueError("Unknown properties: %s" - % ", ".join(unknown_props)) - =20 @staticmethod def build(line_str, lineno, filename): @@ -435,7 +422,6 @@ def build(line_str, lineno, filename): groups =3D m.groupdict('') =20 name =3D groups["name"] - props =3D groups["props"].split() fmt =3D groups["fmt"] if fmt.find("%m") !=3D -1: raise ValueError("Event format '%m' is forbidden, pass the err= or " @@ -448,14 +434,13 @@ def build(line_str, lineno, filename): =20 args =3D Arguments.build(groups["args"]) =20 - return Event(name, props, fmt, args, lineno, posix_relpath(filenam= e)) + return Event(name, fmt, args, lineno, posix_relpath(filename)) =20 def __repr__(self): """Evaluable string representation for this object.""" - return "Event('%s %s(%s) %s')" % (" ".join(self.properties), - self.name, - self.args, - self.fmt) + return "Event('%s(%s) %s')" % (self.name, + self.args, + self.fmt) # Star matching on PRI is dangerous as one might have multiple # arguments with that format, hence the non-greedy version of it. _FMT =3D re.compile(r"(%[\d\.]*\w+|%.*?PRI\S+)") diff --git a/scripts/tracetool/backend/dtrace.py b/scripts/tracetool/backen= d/dtrace.py index f0b58cc1585..6bce25c8d2d 100644 --- a/scripts/tracetool/backend/dtrace.py +++ b/scripts/tracetool/backend/dtrace.py @@ -79,8 +79,6 @@ def generate_rs_begin(events, group): # These are the Rust declarations of the .probes section semaphores # generated by dtrace(1) in its .o file output. for e in events: - if 'disable' in e.properties: - continue out(' #[allow(dead_code)]', f' static qemu_{e.name}_semaphore: UnsafeCell;') out('}', diff --git a/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py index 9f06894623e..3754c7e06fd 100644 --- a/scripts/tracetool/format/c.py +++ b/scripts/tracetool/format/c.py @@ -16,9 +16,6 @@ =20 =20 def generate(events, backend, group): - active_events =3D [e for e in events - if "disable" not in e.properties] - header =3D "trace-" + group + ".h" =20 out('/* This file is autogenerated by tracetool, do not edit. */', @@ -62,7 +59,7 @@ def generate(events, backend, group): 'trace_init(trace_%(group)s_register_events)', group =3D group.lower()) =20 - backend.generate_begin(active_events, group) - for event in active_events: + backend.generate_begin(events, group) + for event in events: backend.generate(event, group) - backend.generate_end(active_events, group) + backend.generate_end(events, group) diff --git a/scripts/tracetool/format/d.py b/scripts/tracetool/format/d.py index e9e33dfe30a..df7780cb0af 100644 --- a/scripts/tracetool/format/d.py +++ b/scripts/tracetool/format/d.py @@ -30,9 +30,6 @@ =20 =20 def generate(events, backend, group): - events =3D [e for e in events - if "disable" not in e.properties] - # SystemTap's dtrace(1) warns about empty "provider qemu {}" but is ha= ppy # with an empty file. Avoid the warning. # But dtrace on macOS can't deal with empty files. diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index 544bbc0ba93..f719fe09397 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -46,14 +46,13 @@ def generate(events, backend, group): '#define %(api)s() ( \\', api=3De.api(e.QEMU_BACKEND_DSTATE)) =20 - if "disable" not in e.properties: - backend.generate_backend_dstate(e, group, check_trace_event_ge= t_state=3DFalse) + backend.generate_backend_dstate(e, group, check_trace_event_get_st= ate=3DFalse) =20 - if backend.check_trace_event_get_state: - event_id =3D 'TRACE_' + e.name.upper() - out(' trace_event_get_state_dynamic_by_id(%(event_id)s)= || \\', - event_id=3Devent_id) - backend.generate_backend_dstate(e, group, check_trace_even= t_get_state=3DTrue) + if backend.check_trace_event_get_state: + event_id =3D 'TRACE_' + e.name.upper() + out(' trace_event_get_state_dynamic_by_id(%(event_id)s) || = \\', + event_id=3Devent_id) + backend.generate_backend_dstate(e, group, check_trace_event_ge= t_state=3DTrue) =20 out(' false)') =20 @@ -63,16 +62,15 @@ def generate(events, backend, group): api=3De.api(), args=3De.args) =20 - if "disable" not in e.properties: - backend.generate(e, group, check_trace_event_get_state=3DFalse) + backend.generate(e, group, check_trace_event_get_state=3DFalse) =20 - if backend.check_trace_event_get_state: - event_id =3D 'TRACE_' + e.name.upper() - cond =3D "trace_event_get_state(%s)" % event_id - out(' if (%(cond)s) {', - cond=3Dcond) - backend.generate(e, group, check_trace_event_get_state=3DT= rue) - out(' }') + if backend.check_trace_event_get_state: + event_id =3D 'TRACE_' + e.name.upper() + cond =3D "trace_event_get_state(%s)" % event_id + out(' if (%(cond)s) {', + cond=3Dcond) + backend.generate(e, group, check_trace_event_get_state=3DTrue) + out(' }') out('}') =20 backend.generate_end(events, group) diff --git a/scripts/tracetool/format/log_stap.py b/scripts/tracetool/forma= t/log_stap.py index 259303a189d..3fa6c2dd3f2 100644 --- a/scripts/tracetool/format/log_stap.py +++ b/scripts/tracetool/format/log_stap.py @@ -90,9 +90,6 @@ def generate(events, backend, group): '') =20 for event_id, e in enumerate(events): - if 'disable' in e.properties: - continue - out('probe %(probeprefix)s.log.%(name)s =3D %(probeprefix)s.%(name= )s ?', '{', probeprefix=3Dprobeprefix(), diff --git a/scripts/tracetool/format/rs.py b/scripts/tracetool/format/rs.py index 1fddcee1ad2..97d89a981da 100644 --- a/scripts/tracetool/format/rs.py +++ b/scripts/tracetool/format/rs.py @@ -52,11 +52,10 @@ def generate(events, backend, group): '{', api=3De.api(e.QEMU_RUST_DSTATE)) =20 - if "disable" not in e.properties: - backend.generate_backend_dstate(e, group) - if backend.check_trace_event_get_state: - out(' trace_event_state_is_enabled(unsafe { _%(event_id= )s_DSTATE}) ||', - event_id =3D 'TRACE_' + e.name.upper()) + backend.generate_backend_dstate(e, group) + if backend.check_trace_event_get_state: + out(' trace_event_state_is_enabled(unsafe { _%(event_id)s_D= STATE}) ||', + event_id =3D 'TRACE_' + e.name.upper()) =20 out(' false', '}', @@ -68,15 +67,14 @@ def generate(events, backend, group): api=3De.api(e.QEMU_TRACE), args=3De.args.rust_decl()) =20 - if "disable" not in e.properties: - backend.generate(e, group, check_trace_event_get_state=3DFalse) - if backend.check_trace_event_get_state: - event_id =3D 'TRACE_' + e.name.upper() - out(' if trace_event_state_is_enabled(unsafe { _%(event= _id)s_DSTATE}) {', - event_id =3D event_id, - api=3De.api()) - backend.generate(e, group, check_trace_event_get_state=3DT= rue) - out(' }') + backend.generate(e, group, check_trace_event_get_state=3DFalse) + if backend.check_trace_event_get_state: + event_id =3D 'TRACE_' + e.name.upper() + out(' if trace_event_state_is_enabled(unsafe { _%(event_id)= s_DSTATE}) {', + event_id =3D event_id, + api=3De.api()) + backend.generate(e, group, check_trace_event_get_state=3DTrue) + out(' }') out('}', '') =20 diff --git a/scripts/tracetool/format/simpletrace_stap.py b/scripts/traceto= ol/format/simpletrace_stap.py index c7bde97a855..393d85319c7 100644 --- a/scripts/tracetool/format/simpletrace_stap.py +++ b/scripts/tracetool/format/simpletrace_stap.py @@ -24,9 +24,6 @@ def generate(events, backend, group): '') =20 for event_id, e in enumerate(events): - if 'disable' in e.properties: - continue - out('probe %(probeprefix)s.simpletrace.%(name)s =3D %(probeprefix)= s.%(name)s ?', '{', probeprefix=3Dprobeprefix(), diff --git a/scripts/tracetool/format/stap.py b/scripts/tracetool/format/st= ap.py index 285c9203ba7..e3d16b72d34 100644 --- a/scripts/tracetool/format/stap.py +++ b/scripts/tracetool/format/stap.py @@ -34,9 +34,6 @@ def stap_escape(identifier): =20 =20 def generate(events, backend, group): - events =3D [e for e in events - if "disable" not in e.properties] - out('/* This file is autogenerated by tracetool, do not edit. */', '/* SPDX-License-Identifier: GPL-2.0-or-later */', '') diff --git a/scripts/tracetool/format/ust_events_c.py b/scripts/tracetool/f= ormat/ust_events_c.py index 074226bfd37..93f88a03e90 100644 --- a/scripts/tracetool/format/ust_events_c.py +++ b/scripts/tracetool/format/ust_events_c.py @@ -16,9 +16,6 @@ =20 =20 def generate(events, backend, group): - events =3D [e for e in events - if "disabled" not in e.properties] - out('/* This file is autogenerated by tracetool, do not edit. */', '/* SPDX-License-Identifier: GPL-2.0-or-later */', '', diff --git a/scripts/tracetool/format/ust_events_h.py b/scripts/tracetool/f= ormat/ust_events_h.py index 76c883bc5c0..441e6a41933 100644 --- a/scripts/tracetool/format/ust_events_h.py +++ b/scripts/tracetool/format/ust_events_h.py @@ -16,9 +16,6 @@ =20 =20 def generate(events, backend, group): - events =3D [e for e in events - if "disabled" not in e.properties] - if group =3D=3D "all": include =3D "trace-ust-all.h" else: --=20 2.56.0 From nobody Thu Nov 5 07:32:38 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1793646184; cv=none; d=zohomail.com; s=zohoarc; b=jYqA836AivlVXUx32gWe1R7x58ZDQiGciK+w7TAqkCp2TKu8xaaIvs2y9NPFELrUmncda276WzV8j24aSES3zWPoMIVwNkbDBRedQHvcc3vxg41Red+95JEDuX3yNwjjJoMy4VWGPN7eGNMnIkbxLKgBbMur5SyMrbygGxt2JqI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793646184; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=bJ+MsD8/YM7jmhRRHSgSa9gB390FKakWl0PZSBzNXqg=; b=NhrNuJTlXDga5xj00IrKb7IJxj8FfjqEqHCiWsBWtFeYBYkg+trn7Vc7Gh7+e8ff8DVFHRWOK4Eq4Z9LSpEK6vvXBJdq6hTEDx76I5V3Y3cPU7LQcVH5wJbaTCrSZ842zYr2KkV5ST598Up9Ky8Ff0vxoHNgssijvoRTGHp+4cg= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179364618456955.923401248223854; Mon, 2 Nov 2026 11:03:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNxIv-0003bT-R4; Mon, 02 Nov 2026 14:02:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxI7-0002Dw-2J for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:02:00 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xNxI2-0008Ir-Io for qemu-devel@nongnu.org; Mon, 02 Nov 2026 14:01:58 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-587-QpPQZrGqOGWkL1Q-bCpvkA-1; Mon, 02 Nov 2026 14:01:50 -0500 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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B23151954B2A; Mon, 2 Nov 2026 19:01:48 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5F04D1956088; Mon, 2 Nov 2026 19:01:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793646113; 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=bJ+MsD8/YM7jmhRRHSgSa9gB390FKakWl0PZSBzNXqg=; b=g2w3CayHyHTe1f0RaBWckdZvkuBzgAocwKDDg02JOsSilocYuuwGBwWIw4UQdU3PINBaox ylUA6ATjUW5aCg4uil1wsEF1vqXeJ6EAiuaaJG1XyTTxN2IhdULW8+LCW+QnLMb9X1LwPM QOcvuDsdvxBm3JytEetEDpUOqCcLWWQ= X-MC-Unique: QpPQZrGqOGWkL1Q-bCpvkA-1 X-Mimecast-MFC-AGG-ID: QpPQZrGqOGWkL1Q-bCpvkA_1793646108 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Markus Armbruster , Eric Blake , Pierrick Bouvier , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Deller , xen-devel@lists.xenproject.org, Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 25/25] trace: remove 'trace_event_get_state' wrapper Date: Mon, 2 Nov 2026 13:58:31 -0500 Message-ID: <20261102185831.1880189-26-stefanha@redhat.com> In-Reply-To: <20261102185831.1880189-1-stefanha@redhat.com> References: <20261102185831.1880189-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=lists1p.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: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1793646185535154100 From: Daniel P. Berrang=C3=A9 The 'trace_event_get_state' macro is a wrapper around the 'trace_event_get_state_dynamic_by_id' macro, which is a direct check of the _TRACE_...._DSTATE global variable. The only code that should be using this is the generated trace probes, but the name looks rather appealing causing it to be mistakenly used in other places, instead of the recommended 'trace_event_get_state_dynamic_backends'. Removing the 'trace_event_get_state' macro reduces the potential for confusion. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20261102142844.3464712-26-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- tests/tracetool/all.h | 8 ++++---- tests/tracetool/ftrace.h | 4 ++-- tests/tracetool/log.h | 4 ++-- tests/tracetool/simple.h | 4 ++-- tests/tracetool/syslog.h | 4 ++-- trace/control.h | 9 --------- scripts/tracetool/backend/__init__.py | 3 ++- scripts/tracetool/backend/log.py | 2 +- scripts/tracetool/format/h.py | 2 +- 9 files changed, 16 insertions(+), 24 deletions(-) diff --git a/tests/tracetool/all.h b/tests/tracetool/all.h index 01971827e4b..d4c91cdd1a4 100644 --- a/tests/tracetool/all.h +++ b/tests/tracetool/all.h @@ -51,14 +51,14 @@ void _simple_trace_test_wibble(void *context, int value= ); static inline void trace_test_blah(void *context, const char *filename) { QEMU_TEST_BLAH(context, filename); - if (trace_event_get_state(TRACE_TEST_BLAH) && + if (trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) && qemu_loglevel_mask(LOG_TRACE)) { #line 4 "trace-events" qemu_log("test_blah " "Blah context=3D%p filename=3D%s" "\n", = context, filename); #line 59 "all.h" } tracepoint(qemu, test_blah, context, filename); - if (trace_event_get_state(TRACE_TEST_BLAH)) { + if (trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH)) { #line 4 "trace-events" ftrace_write("test_blah " "Blah context=3D%p filename=3D%s" "\n" ,= context, filename); #line 65 "all.h" @@ -80,14 +80,14 @@ static inline void trace_test_blah(void *context, const= char *filename) static inline void trace_test_wibble(void *context, int value) { QEMU_TEST_WIBBLE(context, value); - if (trace_event_get_state(TRACE_TEST_WIBBLE) && + if (trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) && qemu_loglevel_mask(LOG_TRACE)) { #line 5 "trace-events" qemu_log("test_wibble " "Wibble context=3D%p value=3D%d" "\n",= context, value); #line 88 "all.h" } tracepoint(qemu, test_wibble, context, value); - if (trace_event_get_state(TRACE_TEST_WIBBLE)) { + if (trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE)) { #line 5 "trace-events" ftrace_write("test_wibble " "Wibble context=3D%p value=3D%d" "\n" = , context, value); #line 94 "all.h" diff --git a/tests/tracetool/ftrace.h b/tests/tracetool/ftrace.h index 4eba6b4d599..b55ee08bbfe 100644 --- a/tests/tracetool/ftrace.h +++ b/tests/tracetool/ftrace.h @@ -19,7 +19,7 @@ extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; =20 static inline void trace_test_blah(void *context, const char *filename) { - if (trace_event_get_state(TRACE_TEST_BLAH)) { + if (trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH)) { #line 4 "trace-events" ftrace_write("test_blah " "Blah context=3D%p filename=3D%s" "\n" ,= context, filename); #line 26 "ftrace.h" @@ -32,7 +32,7 @@ static inline void trace_test_blah(void *context, const c= har *filename) =20 static inline void trace_test_wibble(void *context, int value) { - if (trace_event_get_state(TRACE_TEST_WIBBLE)) { + if (trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE)) { #line 5 "trace-events" ftrace_write("test_wibble " "Wibble context=3D%p value=3D%d" "\n" = , context, value); #line 39 "ftrace.h" diff --git a/tests/tracetool/log.h b/tests/tracetool/log.h index 9afbe721a47..02bb1309e20 100644 --- a/tests/tracetool/log.h +++ b/tests/tracetool/log.h @@ -20,7 +20,7 @@ extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; =20 static inline void trace_test_blah(void *context, const char *filename) { - if (trace_event_get_state(TRACE_TEST_BLAH) && + if (trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) && qemu_loglevel_mask(LOG_TRACE)) { #line 4 "trace-events" qemu_log("test_blah " "Blah context=3D%p filename=3D%s" "\n", = context, filename); @@ -35,7 +35,7 @@ static inline void trace_test_blah(void *context, const c= har *filename) =20 static inline void trace_test_wibble(void *context, int value) { - if (trace_event_get_state(TRACE_TEST_WIBBLE) && + if (trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) && qemu_loglevel_mask(LOG_TRACE)) { #line 5 "trace-events" qemu_log("test_wibble " "Wibble context=3D%p value=3D%d" "\n",= context, value); diff --git a/tests/tracetool/simple.h b/tests/tracetool/simple.h index 9b066364b0a..0b9e7cba35c 100644 --- a/tests/tracetool/simple.h +++ b/tests/tracetool/simple.h @@ -20,7 +20,7 @@ void _simple_trace_test_wibble(void *context, int value); =20 static inline void trace_test_blah(void *context, const char *filename) { - if (trace_event_get_state(TRACE_TEST_BLAH)) { + if (trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH)) { _simple_trace_test_blah(context, filename); } } @@ -31,7 +31,7 @@ static inline void trace_test_blah(void *context, const c= har *filename) =20 static inline void trace_test_wibble(void *context, int value) { - if (trace_event_get_state(TRACE_TEST_WIBBLE)) { + if (trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE)) { _simple_trace_test_wibble(context, value); } } diff --git a/tests/tracetool/syslog.h b/tests/tracetool/syslog.h index 6a9304489f6..173b35dcf69 100644 --- a/tests/tracetool/syslog.h +++ b/tests/tracetool/syslog.h @@ -19,7 +19,7 @@ extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; =20 static inline void trace_test_blah(void *context, const char *filename) { - if (trace_event_get_state(TRACE_TEST_BLAH)) { + if (trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH)) { #line 4 "trace-events" syslog(LOG_INFO, "test_blah " "Blah context=3D%p filename=3D%s" , = context, filename); #line 26 "syslog.h" @@ -32,7 +32,7 @@ static inline void trace_test_blah(void *context, const c= har *filename) =20 static inline void trace_test_wibble(void *context, int value) { - if (trace_event_get_state(TRACE_TEST_WIBBLE)) { + if (trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE)) { #line 5 "trace-events" syslog(LOG_INFO, "test_wibble " "Wibble context=3D%p value=3D%d" ,= context, value); #line 39 "syslog.h" diff --git a/trace/control.h b/trace/control.h index 71f254728d4..dfb52b23ac4 100644 --- a/trace/control.h +++ b/trace/control.h @@ -97,15 +97,6 @@ static uint32_t trace_event_get_id(TraceEvent *ev); */ static const char * trace_event_get_name(TraceEvent *ev); =20 -/** - * trace_event_get_state: - * @id: Event identifier name. - * - * Get the tracing state of an event, both static and the QEMU dynamic sta= te. - */ -#define trace_event_get_state(id) \ - (trace_event_get_state_dynamic_by_id(id)) - /** * trace_event_get_state_backends: * @id: Event identifier name. diff --git a/scripts/tracetool/backend/__init__.py b/scripts/tracetool/back= end/__init__.py index 72f549c77c4..2749c4e6315 100644 --- a/scripts/tracetool/backend/__init__.py +++ b/scripts/tracetool/backend/__init__.py @@ -26,7 +26,8 @@ considered "public". CHECK_TRACE_EVENT_GET_STATE If exists and is set to 'True', the backend-sp= ecific code inside the tracepoint is emitted within an - ``if trace_event_get_state()`` conditional. + ``if trace_event_get_state_dynamic_by_id()`` + conditional. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D =20 =20 diff --git a/scripts/tracetool/backend/log.py b/scripts/tracetool/backend/l= og.py index 4a622dd4dcb..00a0dd9c9dc 100644 --- a/scripts/tracetool/backend/log.py +++ b/scripts/tracetool/backend/log.py @@ -28,7 +28,7 @@ def generate_h(event, group): if len(event.args) > 0: argnames =3D ", " + argnames =20 - out(' if (trace_event_get_state(%(event_id)s) &&', + out(' if (trace_event_get_state_dynamic_by_id(%(event_id)s) &&', ' qemu_loglevel_mask(LOG_TRACE)) {', '#line %(event_lineno)d "%(event_filename)s"', ' qemu_log("%(name)s " %(fmt)s "\\n"%(argnames)s);', diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index f719fe09397..ad4ce4414fe 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -66,7 +66,7 @@ def generate(events, backend, group): =20 if backend.check_trace_event_get_state: event_id =3D 'TRACE_' + e.name.upper() - cond =3D "trace_event_get_state(%s)" % event_id + cond =3D "trace_event_get_state_dynamic_by_id(%s)" % event_id out(' if (%(cond)s) {', cond=3Dcond) backend.generate(e, group, check_trace_event_get_state=3DTrue) --=20 2.56.0