From nobody Mon Nov 23 04:26:10 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=1793629772; cv=none; d=zohomail.com; s=zohoarc; b=V06ba13MJYmkdUqVly2R51GAjzlZLCBVY2vc2HIycYYNEFjKgiNvvXV4ic2cQj+bgEbIq5qCkmaYN9DYaF5tJ27JwYPrLtP4ywqOnMZPwLs7fCu8QPpMyC73ydzpEp5PdrowG0SjuqTusUrTuAL+OviNCAt7sT++wUgOb/7JiIo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629772; 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=1m62k7l0Q/iT7x8yExV1dEHGGhNHo8St4Pmv019YViQ=; b=M6T2W/qCNeeu9ZUprliG3eGEeRi06XJxxgAyp6navehIC0+jPk5IeGp3MisHQldXtiq8dpFuTm1dDQRoPpgEAAtUbt4+YD4PA2/BRGySVfsfnti3lvnh0SUyf1IJwBJd36erEtYQCkURhORSmdVbuy22bWdNAMDIO11XHwLmDrQ= 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 1793629772376848.9751132110144; Mon, 2 Nov 2026 06:29:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt1v-0007mw-9T; Mon, 02 Nov 2026 09:29:00 -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 1xNt1r-0007mU-Rj for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:28:55 -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 1xNt1p-00077V-Pb for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:28:55 -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-352-56OTi2ErNeKxTBhjuRAYWg-1; Mon, 02 Nov 2026 09:28: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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EC94A19541A2 for ; Mon, 2 Nov 2026 14:28:48 +0000 (UTC) Received: from berrange.csb (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 7FCFD1800444; Mon, 2 Nov 2026 14:28:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629733; 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=1m62k7l0Q/iT7x8yExV1dEHGGhNHo8St4Pmv019YViQ=; b=Xa411/n2RBanZXVMl4A3ApLezRFY1dnZuhnpwdWyFnoe5KpWPpHCeaVz8SdZR/BDSZa6B1 qHl6KxSUCBVi7eHF1gY0EzFgCjTmBVKHC4a06B3/csIcMsYQzQn/ei6bwk1i6YApidIEoL qaGcd49w7T5IX6d8ou/u8+XF2k0uido= X-MC-Unique: 56OTi2ErNeKxTBhjuRAYWg-1 X-Mimecast-MFC-AGG-ID: 56OTi2ErNeKxTBhjuRAYWg_1793629729 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v4 01/25] osdep: add 'ignore_value(x)' macro Date: Mon, 2 Nov 2026 14:28:20 +0000 Message-ID: <20261102142844.3464712-2-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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: 1793629774236158500 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 --- 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 Mon Nov 23 04:26:10 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=1793630044; cv=none; d=zohomail.com; s=zohoarc; b=HzA79VtmgLx/kogeh7KihfIU92JLE8yi8Po8olX9+1oHRHRrlhEqt/87jiB9axvXROsq1cjoFGUHp7Gz1mnEHy870CTa/ESVX3Dr2/e6RB53iIsbxcOrqmdGIoEAWMZiIFBwt+k/EbXyl6qmjr48/CoL92w/deE0FrTZCs+KrH8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630044; 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=+qk3LiFePbj0Z0xkiZE49KKohSjlm/EGLWTSTNDKR/s=; b=C7bwfoNDyxw7dNyoZk433552pkJB8IBE6xs24Vj04+0ZPxAxDSXDnzkNkJM0GAkc0QDFllGb5ppYumNOJj3wc8hTPARo9lu/zPVFp3837Fg1Dt5SixyWSIxbYLgpyP5Wa7REhO0E00503ZVpCafwooM0SI0+jFBjsY3MH4hGHSM= 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 1793630044051597.3144952772464; Mon, 2 Nov 2026 06:34:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt24-0007pc-1Z; Mon, 02 Nov 2026 09:29:08 -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 1xNt1t-0007ms-HV for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:28: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 1xNt1q-00077U-Bb for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:28:56 -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-657-xkaYyHezMeuq22PGjzUBcg-1; Mon, 02 Nov 2026 09:28:51 -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 872701944D02 for ; Mon, 2 Nov 2026 14:28:50 +0000 (UTC) Received: from berrange.csb (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 48A371800480; Mon, 2 Nov 2026 14:28:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629732; 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=+qk3LiFePbj0Z0xkiZE49KKohSjlm/EGLWTSTNDKR/s=; b=KXqnzl6h7CgCt+0kUCNPoGw6c6RLZB1C0N2TqPlcrQ/13c8jVM+wfVL7aFenM9QBsMONoI BMhmw/gVaaYTilX84S9L/+O9/JVIAa1M+1nKbKgtwEFEqIzGHbNVmXs9eZBov0AVcfY8SZ j3s9brNWEQZHXywLvvlQ0K1HzoYBtkw= X-MC-Unique: xkaYyHezMeuq22PGjzUBcg-1 X-Mimecast-MFC-AGG-ID: xkaYyHezMeuq22PGjzUBcg_1793629730 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v4 02/25] trace: use 'ignore_value()' instead of a dummy variable Date: Mon, 2 Nov 2026 14:28:21 +0000 Message-ID: <20261102142844.3464712-3-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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: 1793630044609158500 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 --- 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 Mon Nov 23 04:26:10 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=1793629772; cv=none; d=zohomail.com; s=zohoarc; b=KWpwvpwS6QcROb6vbwod+D93gJvtvl6qxnJnh7m69z2Aciy25haBG/Pdj8CjNFxVfOPVNFNcxtkavGQ1pRhr9XAmdBj29sDm3QQkuzwea+6JdfpYtrhV89isx0W5VX3K1+4KNsnHx/A+XDxGv6CHuUd6gRWUZHo43Y35zdYCV4Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629772; 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=Qb+97AneHC4z/PFts4CafDaAjLPDGUnmDafnKqrlYxM=; b=m0AuV8Ux8IJgYsrDThgWHA5Z9sJTtIAU6DGqf2cdCV4JKgwbLfKlUDl1/Qd42fVlABe9DX2o0FWrz8AiaicQolocGvFQdZsliNwLSVjquuqpGVSUQPFm24LGqFo/rMQnc6mZ4mH9q/VNhISjCDt9ihOwh8bthezlsaOyt7mRLHg= 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 1793629772220191.33518637738564; Mon, 2 Nov 2026 06:29:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt1z-0007oK-54; Mon, 02 Nov 2026 09:29:03 -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 1xNt1t-0007mr-Hm for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:28:57 -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 1xNt1r-00077e-FC for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:28:56 -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-691-BQdbaPLMMIKkWf_7iwenCg-1; Mon, 02 Nov 2026 09:28:52 -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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F1D4F19539A1 for ; Mon, 2 Nov 2026 14:28:51 +0000 (UTC) Received: from berrange.csb (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 D2FAD18005B0; Mon, 2 Nov 2026 14:28:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629734; 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=Qb+97AneHC4z/PFts4CafDaAjLPDGUnmDafnKqrlYxM=; b=cXws+IgwSmTqCe4NkHRWPBuvGqIDJQbZobbccAPLtRbX9VUC70y9dvUlS3llElzYdu8TZM d5D62XdGcy6G1gl0gLsO9oZKN+mHBB4PbLNt7xdCaDPynmW9SyLDxwRErHzEtoVAVcCe0j iX2RVvy9mbqWi51R+/ANCnK5zMDrLZc= X-MC-Unique: BQdbaPLMMIKkWf_7iwenCg-1 X-Mimecast-MFC-AGG-ID: BQdbaPLMMIKkWf_7iwenCg_1793629732 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v4 03/25] trace: fix handling of char** in UST backend Date: Mon, 2 Nov 2026 14:28:22 +0000 Message-ID: <20261102142844.3464712-4-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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: 1793629774407154100 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 --- 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 Mon Nov 23 04:26:10 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=1793629918; cv=none; d=zohomail.com; s=zohoarc; b=S3NX2zHiUS168i0oLhY2Mozj0hxTcTzrfN0iXlU450TMkRJ6xM3fSkNBaHtx8KkBvjrHPsHhBzfhesUpNmHBGvuWrKvRJkaaVB3d04S05vm8srmFE9ZEAmjyP7FYbqALUukPk0MwwxZ+ma+BefXkV+BgTUahYa11YjJ8cj9+rG8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629918; 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=OHk+UrXWaZv/R7APztNh1dlflQ3sDrVW4gL4mEiNNto=; b=Uhyxv5DEFQCMLv8fc+4CfrFag/rZ5cOkN/3Iab6lH/pGn1gFWU1LL5kOfuzEIc30NGdbVpgnSgQIgyf2Zby74Ua+XLZceksAffcO8inDVdUgzHGyiUaOUwM++pitoQ0p7UrAeUbpJRpoDaTU3rvO4IhYj509azeQqtObsG4UjJI= 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 1793629918078387.64167140829045; Mon, 2 Nov 2026 06:31:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt2C-0007sm-0l; Mon, 02 Nov 2026 09:29:16 -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 1xNt21-0007om-17 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:06 -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 1xNt1u-000780-JU for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:01 -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-520-z_gmDSXWMzS-6qp8gzb13g-1; Mon, 02 Nov 2026 09:28:55 -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 8FAA51801315; Mon, 2 Nov 2026 14:28:53 +0000 (UTC) Received: from berrange.csb (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 4DFBA180029C; Mon, 2 Nov 2026 14:28:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629736; 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=OHk+UrXWaZv/R7APztNh1dlflQ3sDrVW4gL4mEiNNto=; b=HYUm5GYy/JP05qnUPvtNaV0p+ip/riiuBb+jHA2/FwQyaZv9mjVOWAeSN0dO00UOn0QOpZ aNw45Z5DwWhVUOc+NTUz9IVV+GlqZYSQSfd01MfGxcQWTdpM1w7hOQETOllaBTI1wNj0wb XrEls9+4DqGDIUf8XIqQaGrsuEwuhbo= X-MC-Unique: z_gmDSXWMzS-6qp8gzb13g-1 X-Mimecast-MFC-AGG-ID: z_gmDSXWMzS-6qp8gzb13g_1793629733 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v4 04/25] hw/xen: replace "long unsigned int" with "unsigned long " for dtrace Date: Mon, 2 Nov 2026 14:28:23 +0000 Message-ID: <20261102142844.3464712-5-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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: 1793629920281158500 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 --- 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 Mon Nov 23 04:26:10 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=1793629878; cv=none; d=zohomail.com; s=zohoarc; b=aSER8rWMd5NmVXv0Y/z2gPSXYTuVS3NOZbIpPUjQLE6gY6i2ZYay6/TmHQs9Haou4xTfVzaNZnchPHhUyWF9jyuhrK4JRiSy/A+tW4j4cCeJ7sh93YPpBtrNBENyP+w9IRU+WsnLFJWdTWKr8YeacGRFXAkMFprSOTJ6I8Xl+Rc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629878; 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=sCbp70ZG34Gkj4xZ3D3uirjL7bEXP92ny3O19BxCPi8=; b=MR18o9HBGCfBubp+FrY+COk5kn8Xhca+SrtHrjhRT2wYxzZ5lHAORsVgMyBvyvly55ADu2NwNIhK9/ZXAdtlj/EZLZHc0OaQtgg8jNCLUWNqQXj7/7ZGlujlbsKTcyU5PNV1guSINwCyfWVCwYLRY7wwXFEyRv/ELx59Dm6GlVA= 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 1793629878959405.86391869490285; Mon, 2 Nov 2026 06:31:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt26-0007qM-M9; Mon, 02 Nov 2026 09:29:10 -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 1xNt21-0007on-4C for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:06 -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 1xNt1v-00078F-PC for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:04 -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-596-zJmbCoVsPK6PFN6hFbZOQw-1; Mon, 02 Nov 2026 09:28:56 -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 1E67C1809CA9 for ; Mon, 2 Nov 2026 14:28:55 +0000 (UTC) Received: from berrange.csb (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 DE5771800444; Mon, 2 Nov 2026 14:28:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629737; 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=sCbp70ZG34Gkj4xZ3D3uirjL7bEXP92ny3O19BxCPi8=; b=a4KANnY6Tky97/0GEQzD4nwl9Gm1JHdkff1uHlg2TeHFSQNC2Mb9yMpDPY5jHBHrzaR83O 4ACrk2GqAtYBnQhtGhGfRrXMrBDvWLqHSba/cpxp2X0BEi+HRJeoR5SQOAI0da6Mv4MR5F hh8MeaxjYpRH8Z+U9fFrCTnqme2NVJA= X-MC-Unique: zJmbCoVsPK6PFN6hFbZOQw-1 X-Mimecast-MFC-AGG-ID: zJmbCoVsPK6PFN6hFbZOQw_1793629735 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v4 05/25] trace: block use of "long int" for dtrace Date: Mon, 2 Nov 2026 14:28:24 +0000 Message-ID: <20261102142844.3464712-6-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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: 1793629881864154100 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 --- 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 Mon Nov 23 04:26:10 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=1793629829; cv=none; d=zohomail.com; s=zohoarc; b=n94fRbQGO4Nt3y+NCrRXci0XhJ8kf6yNjGSsuacd5eXIZyS4g/13mcnR4UUWp00WXUgD7ZJm4VFt296UZwWFkWBff4V03aNQ23jb6Iq3x/FsaJ5g3KEm9gEmpS2OiRoNFbBL+qzoUyT3z6J0brrhU0O3WWyoi/EAxVa69pO/ZgM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629829; 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=Pmc9v7u/W7f1wpGbx3/tDjjY7nm6Ord8c0Efd4962BA=; b=H4AsSXHIervLnSogOWqjRy8WAfPnz0LDX4dgtfKtujVXB8yWB/TDbQ5SBoTeaFMHt0eyO9fr/EjmJ7v3+pGKYEC1Obp3z1pXR9pRXOaHVv8ZQ99UknYUnwkP3P6Qw+pdHgMf8WBsDj/Rh7+ckolALa+Be5jYQdBC3GZQZk0HAps= 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 1793629829300988.2821551062932; Mon, 2 Nov 2026 06:30:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt27-0007ql-Td; Mon, 02 Nov 2026 09:29:12 -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 1xNt22-0007oq-D2 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:06 -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 1xNt20-00078P-P7 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:06 -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-606-7aStgvL8MYqsqK7ZM1lWJg-1; Mon, 02 Nov 2026 09:28:57 -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 82AC41802560 for ; Mon, 2 Nov 2026 14:28:56 +0000 (UTC) Received: from berrange.csb (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 7089C1800480; Mon, 2 Nov 2026 14:28:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629739; 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=Pmc9v7u/W7f1wpGbx3/tDjjY7nm6Ord8c0Efd4962BA=; b=S7n8lEc8/YxSKEDYWks52/re/xCqWdxxrr42SDf0nnaKY9/Uc+UQbHbHrgDhl/jvQelsAD a2teljMCmMooRWmDB7UscRNR0f9zdI1EhW7wkNOgJP1nDxjLf8q4PSFe7UX3c0HLKve3l8 VR5KVWpDTUE+0B8Dxj49awUrUckGLKA= X-MC-Unique: 7aStgvL8MYqsqK7ZM1lWJg-1 X-Mimecast-MFC-AGG-ID: 7aStgvL8MYqsqK7ZM1lWJg_1793629736 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v4 06/25] trace: drop unused trace_event_set_state_dynamic_init() Date: Mon, 2 Nov 2026 14:28:25 +0000 Message-ID: <20261102142844.3464712-7-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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: 1793629830901158500 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 --- stubs/trace-control.c | 5 ----- trace/control-target.c | 21 --------------------- trace/event-internal.h | 2 -- 3 files changed, 28 deletions(-) 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)); 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 */ --=20 2.56.0 From nobody Mon Nov 23 04:26:10 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=1793629778; cv=none; d=zohomail.com; s=zohoarc; b=euK8qU0IlXNRcG8j8EHQF1/pPVX2ELzB9ZjTahxtNCXpaxf06IlI2bFNo+uRVpHUENsJEarP4V1pufg6EJaabWiJoWWBhx6NzwlU9ikNBUa4eqgetAIOnl0DsbldQzVixTjvFlmAhVcq179abZoN35OvKheWtWoTYmP8INH1R74= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629778; 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=kosoFqwi9RZUq4Rp4qEurlaVi6hF2rsZxtd6oLNka+o=; b=iOa8+Sjqt++GWdxUlXJsi4dUb41bLOPZJENB2ZQqhRrZfPVOlEqEuw1M2/iqSnA5kX7U7negC8NthkTNNzNosY7gkygCS/9xgUWBKgJurgLZRFNZJ8pW/2oQbOt15hW8Xl3ge7Hx6q0TNYba8XiOjrw5L6a1l3iJIpP7/hf18Mg= 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 1793629778535782.1493782467761; Mon, 2 Nov 2026 06:29:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt29-0007rS-4P; Mon, 02 Nov 2026 09:29:13 -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 1xNt22-0007or-ED for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:06 -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 1xNt20-00078j-Pi for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:06 -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-263-zSIzcVkrO02fT-3j-hEvvQ-1; Mon, 02 Nov 2026 09:28:59 -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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 31FEE1954102; Mon, 2 Nov 2026 14:28:58 +0000 (UTC) Received: from berrange.csb (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 D5A801800444; Mon, 2 Nov 2026 14:28:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629743; 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=kosoFqwi9RZUq4Rp4qEurlaVi6hF2rsZxtd6oLNka+o=; b=h52TafaiTus1CkXGTLEESW2RRcz1IghhJaN5Zp19jeCYR3+YuYjZ02P1yKVkw65SZuLtQn ydOD48fqq5QE9ID/XpJKRXF3s5Q/977rywfIsbAACWcOaVqzNQJinX6fl/SPzMR4AIxtJ5 bSJ970NvlfPL29BH5u7B4HbJo4XyxNg= X-MC-Unique: zSIzcVkrO02fT-3j-hEvvQ-1 X-Mimecast-MFC-AGG-ID: zSIzcVkrO02fT-3j-hEvvQ_1793629738 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v4 07/25] trace: remove obsolete references to vcpu property Date: Mon, 2 Nov 2026 14:28:26 +0000 Message-ID: <20261102142844.3464712-8-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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: 1793629780168158500 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 --- trace/control-target.c | 6 ------ trace/control.c | 6 ------ trace/control.h | 12 ------------ trace/event-internal.h | 11 ----------- 4 files changed, 35 deletions(-) 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; -} 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 { --=20 2.56.0 From nobody Mon Nov 23 04:26:10 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=1793629979; cv=none; d=zohomail.com; s=zohoarc; b=LUvuzL1oW3XMEO7DcG35PyyA9VYANL8rZLh66cppSi2G+/SwwUBY+UjeEXVq46abr2CuCvcXf7FUESU2fPcSGOfYlAlQG0JR8K4qn3QvE1q6mryqje7dwwqM1qamFlOO9TgXX+RVQY0Z7xxcIlo4gfVnv/jRuMV26VT0vSk0J1k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629979; 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=TbQdyGh1LiyfzuTPR8+3OvaPIm/ZnewczRhdLqtZjrE=; b=I7FJ2h/EsQqs/WcZ6e/QwN7/GWEatd9nPIsGCwpixobCMA7FbOBQfwcaJIRurW7QY/z4HjzabNGaV+Asnvv8rmWJbCyFUj+tqtBebD7AqczO0zzByAJTFf2Q/NfNLFoyjBq3U9WOXwioHGFJ8V3Crf3dtHY0FWNoO4olGSrGbvQ= 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 1793629979710310.84853364661456; Mon, 2 Nov 2026 06:32:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt2G-0007uf-Fl; Mon, 02 Nov 2026 09:29:20 -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 1xNt24-0007q0-AK for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:08 -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 1xNt20-00078c-RR for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:07 -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-25-_VjD149ROsSBD9MAH969Lw-1; Mon, 02 Nov 2026 09:29:00 -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 96EDC194510C for ; Mon, 2 Nov 2026 14:28:59 +0000 (UTC) Received: from berrange.csb (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 8142C1800480; Mon, 2 Nov 2026 14:28:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629742; 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=TbQdyGh1LiyfzuTPR8+3OvaPIm/ZnewczRhdLqtZjrE=; b=DJv7pvh6RvxPjHDxvX1VNtQjAAjWwxd8rYt0zxZr2meji6ceGsKq8GiMMqKIZER+GSQaom HaErZDeoxRq23ND82KCrhIglAryCxAiOW8UGnL/TnPOvXkageMEfqRZfzm5onduY56n0uR e853HVwXwHXf1fz4Wx57N7SbVKvQLUA= X-MC-Unique: _VjD149ROsSBD9MAH969Lw-1 X-Mimecast-MFC-AGG-ID: _VjD149ROsSBD9MAH969Lw_1793629739 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v4 08/25] trace: drop 'id' from TraceEvent struct when not required Date: Mon, 2 Nov 2026 14:28:27 +0000 Message-ID: <20261102142844.3464712-9-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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: 1793629981446158500 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 --- scripts/tracetool/format/c.py | 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-internal.h | 2 ++ trace/control.c | 4 +++- trace/control.h | 3 ++- trace/event-internal.h | 2 ++ 11 files changed, 35 insertions(+), 2 deletions(-) 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', 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-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.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/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; --=20 2.56.0 From nobody Mon Nov 23 04:26:10 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=1793629810; cv=none; d=zohomail.com; s=zohoarc; b=ZTk9VVR6Ow5t+rYcD5EzwItDBcsyIROJXt72EYNVcrxFUu/YtaJdSrZIrsILyXUcMVhOSqscbKzFhHWYcs2T0fVVznnObNo84vmiHDvqVbpfmetdQeZT2IiMBPHfF6cn/1mpAHjcaojlHFJHoSHameb3HUinlwXFmN3laLlqLFo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629810; 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=52FBCEGOSIF52Yt3Fxj2P82A8OnRPXEvnjHC2AfX3ws=; b=HSw0llnQr07gTyGIPS1WlFVwdSV8EPAMGQe1tbHm7Hwjp/xBAyeu0qgbrSOIW+5Rnh0BGeE460z4l1zRqGCk1WTpBGrnBjAkqrdOHoZF+Y371SAR1ieIWlzzne4puqZKd3QhzaKrqx1s1zUU39QAZ6ruowp0TMKP95zXHD0c/P4= 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 1793629810909335.15609176182295; Mon, 2 Nov 2026 06:30:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt2C-0007tI-FI; Mon, 02 Nov 2026 09:29:16 -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 1xNt24-0007q1-Gk for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:08 -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 1xNt20-00078n-R5 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:08 -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-676-dpoDFXDAO0qLIoaK4ZpCzw-1; Mon, 02 Nov 2026 09:29:02 -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 30A4E1800771 for ; Mon, 2 Nov 2026 14:29:01 +0000 (UTC) Received: from berrange.csb (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 E72EA180057F; Mon, 2 Nov 2026 14:28:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629743; 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=52FBCEGOSIF52Yt3Fxj2P82A8OnRPXEvnjHC2AfX3ws=; b=KGFve16XkGCZp3v2lN8AJ6Fs4fZK6QgBLRXrVyou4W+/wF57XsgXCacjosSys8SAvr96OZ aPDW1s/LWr1kTwBDgbZglE6Ss+F3b6XETzJXBlnrUSpyHtwD2Epm9HwXQnH64+7PA8tPxp BSDft5e0IM/wyLD3DbOOwncHM0Wu8oo= X-MC-Unique: dpoDFXDAO0qLIoaK4ZpCzw-1 X-Mimecast-MFC-AGG-ID: dpoDFXDAO0qLIoaK4ZpCzw_1793629741 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v4 09/25] trace: change "DSTATE" variables from uint16_t to uint8_t Date: Mon, 2 Nov 2026 14:28:28 +0000 Message-ID: <20261102142844.3464712-10-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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: 1793629812891158500 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 --- scripts/tracetool/format/c.py | 2 +- scripts/tracetool/format/h.py | 2 +- scripts/tracetool/format/rs.py | 4 ++-- tests/tracetool/dtrace.c | 4 ++-- tests/tracetool/dtrace.h | 4 ++-- tests/tracetool/dtrace.rs | 6 +++--- tests/tracetool/ftrace.c | 4 ++-- tests/tracetool/ftrace.h | 4 ++-- tests/tracetool/ftrace.rs | 6 +++--- tests/tracetool/log.c | 4 ++-- tests/tracetool/log.h | 4 ++-- tests/tracetool/log.rs | 6 +++--- tests/tracetool/simple.c | 4 ++-- tests/tracetool/simple.h | 4 ++-- tests/tracetool/simple.rs | 6 +++--- tests/tracetool/syslog.c | 4 ++-- tests/tracetool/syslog.h | 4 ++-- tests/tracetool/syslog.rs | 6 +++--- tests/tracetool/ust.c | 4 ++-- tests/tracetool/ust.h | 4 ++-- trace/event-internal.h | 2 +- 21 files changed, 44 insertions(+), 44 deletions(-) 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.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/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/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.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/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/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.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/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/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.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/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/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.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/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/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)] 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/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 */ --=20 2.56.0 From nobody Mon Nov 23 04:26:10 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=1793629772; cv=none; d=zohomail.com; s=zohoarc; b=SwDaCKPC7vPbZsg/W0VotkVzEE0E4BHfnsGghSTblBTUpGPpya9LKIWQ6AqgRp18swVklDUwIM+eXGFhYev/nt5aLzYtfdSGoB+Rk7nlz4bxowZ2EYvdAPPbu+pvxkTB7JN3ExLeLVyqWFhtC0hoc0Mm/MJy4nL1ZIRmHYPwufU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629772; 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=U1l9NOHCVGyjiDL1lpWIz+goGhWbq2cNTaAb8VgWuoE=; b=jW2CWSdnnz6b1euK0uGnUZt+jnNB8n59k7mIP5w+6OB23lFLJisPc7tFFLM0Q3Cp+vEtOgH0klolMGHhFziUJWhlqQuyjKvEInCZEGnd1z7kPqoHnOTyR8rjUCCZnp/bI52Zxq+FTLhnVwrJ7JzJO203f2plIrKxmts9vKAEm9s= 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 1793629772290610.2303651043713; Mon, 2 Nov 2026 06:29:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt2B-0007sO-2O; Mon, 02 Nov 2026 09:29:15 -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 1xNt23-0007pi-TW for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:07 -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 1xNt22-000792-4C for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:07 -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-90-j0ikLGr-P2yg2dPTCyYNfQ-1; Mon, 02 Nov 2026 09:29:03 -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 986DC1955D93 for ; Mon, 2 Nov 2026 14:29:02 +0000 (UTC) Received: from berrange.csb (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 8465918004D2; Mon, 2 Nov 2026 14:29:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629744; 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=U1l9NOHCVGyjiDL1lpWIz+goGhWbq2cNTaAb8VgWuoE=; b=iR3QslXBEFlNwsZgIANiCweWbH7su91kZnltw5W1Q/MG5/yS6UxoOnNfW8E9wryew+iP1P Fo5Kj/XIpQHzB47lW77raObWc3UtOx99A6boDkR6K/obx18Q46g7N6vhQT+ENcG2eQtwlC ObudSx/c9RQBNvBVY22Hf5F8kgDn5bY= X-MC-Unique: j0ikLGr-P2yg2dPTCyYNfQ-1 X-Mimecast-MFC-AGG-ID: j0ikLGr-P2yg2dPTCyYNfQ_1793629742 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v4 10/25] trace: add testing of 'nop' trace backend Date: Mon, 2 Nov 2026 14:28:29 +0000 Message-ID: <20261102142844.3464712-11-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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: 1793629774040158500 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 --- tests/tracetool/meson.build | 1 + tests/tracetool/nop.c | 36 ++++++++++++++++++++++ tests/tracetool/nop.h | 29 ++++++++++++++++++ tests/tracetool/nop.rs | 51 +++++++++++++++++++++++++++++++ tests/tracetool/tracetool-test.py | 2 +- 5 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 tests/tracetool/nop.c create mode 100644 tests/tracetool/nop.h create mode 100644 tests/tracetool/nop.rs 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.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/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.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 Mon Nov 23 04:26:10 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=1793629778; cv=none; d=zohomail.com; s=zohoarc; b=MXNbxRgT/HIfRbhFvdFaMAhkpTft8mtGjzJLfdHsqy0ZkqVvBwJHuqWroYFC/08Sfiv+CZeGibVsHrzouyO1acErBL6hY8EQX8ghkr9mZ/voSezpLokNKY+EqV4MlOs8BlnVwqAwGQ72BXQ/I3g5uYk94A+wjMnFqm+sLIJWQY8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629778; 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=4XLTuEWEdw51O+gTv0F7gRIBIgHVlVJoqC1VcPH2Vd4=; b=MnSEnVYAUv+TEu7kY1g97QP4Lj6vxV6b/muBbGYs4qfvjt/894nvWb/+PyM+BaIhTU0dnghkJvf1Pmvf7mzFKIILwOaAsemHR3kM8WfCYaV3D8E1Iixv0Lii4ToGliYsO/DnLxuD6aCnvhCSkLkoEYOwcA4BiofC1HS7wQFgkXg= 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 17936297788441011.5698123798106; Mon, 2 Nov 2026 06:29:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt2C-0007tK-V0; Mon, 02 Nov 2026 09:29:16 -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 1xNt26-0007qT-9p for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:10 -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 1xNt24-00079b-31 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:09 -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-628-NIstzPTVPP6cBHzYBx08Yg-1; Mon, 02 Nov 2026 09:29:05 -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 75F2D18028BD for ; Mon, 2 Nov 2026 14:29:04 +0000 (UTC) Received: from berrange.csb (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 2FEA11800480; Mon, 2 Nov 2026 14:29:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629747; 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=4XLTuEWEdw51O+gTv0F7gRIBIgHVlVJoqC1VcPH2Vd4=; b=CfFTxRwyhhklWBWbKyVu1wUlVgYBG1HQHT9x4fIMxIgTDV6BoTEITHJzx6ojV2TgfKRPTm LDVKLLwrJWo4vUGBiZRmljdZFOPtdVdpZStFLkQsU/1aQ853a8Slerg3Ta3jmMlT2GR5kv GV15SU+BbW+LiRqHnitrARvx1uaP6nQ= X-MC-Unique: NIstzPTVPP6cBHzYBx08Yg-1 X-Mimecast-MFC-AGG-ID: NIstzPTVPP6cBHzYBx08Yg_1793629744 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v4 11/25] trace: don't emit TraceEvent structs when 'nop' backend is used Date: Mon, 2 Nov 2026 14:28:30 +0000 Message-ID: <20261102142844.3464712-12-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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: 1793629805558154100 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 --- scripts/tracetool/format/c.py | 75 ++++++++++++++++++----------------- scripts/tracetool/format/h.py | 16 +++++--- tests/tracetool/nop.c | 29 -------------- tests/tracetool/nop.h | 6 +-- 4 files changed, 50 insertions(+), 76 deletions(-) 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)) - - 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', + if len(list(backend.backend_modules())): + for e in events: + out('uint8_t %s;' % e.api(e.QEMU_DSTATE)) + + 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)) - - 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,', - '};', - '') - - 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) + '') + + 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) 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)) - - for e in events: - out('extern uint8_t %s;' % e.api(e.QEMU_DSTATE)) + if len(list(backend.backend_modules())): + for e in events: + out('extern TraceEvent %(event)s;', + event =3D e.api(e.QEMU_EVENT)) + + 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: 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/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 --=20 2.56.0 From nobody Mon Nov 23 04:26:10 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=1793630036; cv=none; d=zohomail.com; s=zohoarc; b=EaM9LYPv6k0xjtZO+81D8f0B8vEMRODQiqeaGirZu+3+0rMxfvMvz8mNaX05euNms2ZrS2oT9C+r0UAbYWHsvDh4dUbUPIJdu3wXMo4RJ1X0ullSky8YOsihjk55pAvafUidnBcINj5ZOWlN75C5ZIGpcre2TH8I4NyGy0bOyds= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630036; 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=FAobnS0dYG+n5av0kwdZVZubKSX4CzrwDquRcUgrVhI=; b=Awu/QT/gBjL+FMyzOxsk1h+0WC3UsfarfnkKytSIHujl6yLRd/q7Hw9gpgGkPniv8oY6tqKPI3svgudrNb5FmbODrhXo4EVOUSwuS9I1k4oHauhBJ3vxE9NhM2ISUne0fUH3RkTKe5/aYJs+lkFa9Q7Ub/c4ixsuhJrFhTsxh9M= 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 179363003634220.298771444674344; Mon, 2 Nov 2026 06:33:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt2H-0007vN-H6; Mon, 02 Nov 2026 09:29: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 1xNt28-0007rQ-K2 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:12 -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 1xNt26-0007A0-33 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:12 -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-304-dy7qwFThMnK8cIdewIN2sw-1; Mon, 02 Nov 2026 09:29:07 -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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5B2C319541BE for ; Mon, 2 Nov 2026 14:29:06 +0000 (UTC) Received: from berrange.csb (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 D13CE1800444; Mon, 2 Nov 2026 14:29:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629748; 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=FAobnS0dYG+n5av0kwdZVZubKSX4CzrwDquRcUgrVhI=; b=CbdjHGRfR+9urb1jPHl3ZtZeiaPnRYn031RR31E++Jx0s1/6LAvlP9wwOczAJpPog1rjpi cMNoerMU2UiuRMUQxOhI8mnbok2qprW98trJdHYlQYglYmuRJ0CB/M7IOBnoCnygAt2LYi mQs2nncBoRIepiFoK8IstFJvKwQdNaY= X-MC-Unique: dy7qwFThMnK8cIdewIN2sw-1 X-Mimecast-MFC-AGG-ID: dy7qwFThMnK8cIdewIN2sw_1793629746 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v4 12/25] trace: add test of generation with all backends enabled Date: Mon, 2 Nov 2026 14:28:31 +0000 Message-ID: <20261102142844.3464712-13-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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: 1793630038496158500 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 --- tests/tracetool/all.c | 65 +++++++++++++++++ tests/tracetool/all.d | 10 +++ tests/tracetool/all.h | 102 +++++++++++++++++++++++++++ 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.c create mode 100644 tests/tracetool/all.d create mode 100644 tests/tracetool/all.h 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.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.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.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 Mon Nov 23 04:26:10 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=1793629910; cv=none; d=zohomail.com; s=zohoarc; b=NTDaDee/lUTxmvVHuXJ+4pADyYIut0XyCn07in+l07NcUJYpIvwH41BZOCJ12Ppbi8QJ696msWkEgkXdouSlnfKSi/PokV6amYCN7ppiv61EYdGiCPtk9YUvZDd+MSdHKdYCmRpViPlpptYFD4+9sdIz3/cBTMHSROeRQpuqoeI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629910; 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=vI+mTTeGHYSS9o8mG0pzNtcIPCOQW9QkhJIuBWl8Pug=; b=g1/guiEUXzL2ByoH8CNZUrL8TayWdQRiV/GWzm9ZxMqn+lVZpIaeCHlCc8cqGIDBJIh3LILwT9ZFGU5u+cLfzNuFJlI8qc940UtdGHnZhWCAYsdg7i4cdFPjn+tqldd0723vWetHrywGPbQCxMwidXTyIFm+JPE2NrZ2eVhwg7Y= 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 1793629910084547.8302450522135; Mon, 2 Nov 2026 06:31:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt2E-0007u3-N3; Mon, 02 Nov 2026 09:29:18 -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 1xNt2A-0007sC-Dr for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:14 -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 1xNt28-0007AJ-Qq for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:14 -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-659-KFcHDIFsPvaVvQebaZiXBg-1; Mon, 02 Nov 2026 09:29:08 -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 DDCD91806D22 for ; Mon, 2 Nov 2026 14:29:07 +0000 (UTC) Received: from berrange.csb (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 AC41F1800480; Mon, 2 Nov 2026 14:29:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629752; 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=vI+mTTeGHYSS9o8mG0pzNtcIPCOQW9QkhJIuBWl8Pug=; b=jA2SPT17bpVCEYX5NmHBJGLEamorGweRaVZqYN835CtJZUmbl2yahKfHrcTNMynmJ2DzEi nA1MLEFtnwY6Pep3yrmxx1tVGZq98dtFQWtpKGpF/RTY6/S6lwJaa7TgFd4WpnFDdXDfFG R2DLhLQgkIQ8Iz5LF4cYYuAGrXuCcfY= X-MC-Unique: KFcHDIFsPvaVvQebaZiXBg-1 X-Mimecast-MFC-AGG-ID: KFcHDIFsPvaVvQebaZiXBg_1793629748 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v4 13/25] trace: remove redundant headers from simple trace backend code Date: Mon, 2 Nov 2026 14:28:32 +0000 Message-ID: <20261102142844.3464712-14-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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=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: 1793629912177158500 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 --- scripts/tracetool/backend/simple.py | 4 +--- tests/tracetool/all.c | 2 -- tests/tracetool/simple.c | 2 -- 3 files changed, 1 insertion(+), 7 deletions(-) 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 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) --=20 2.56.0 From nobody Mon Nov 23 04:26:10 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=1793629818; cv=none; d=zohomail.com; s=zohoarc; b=nR4JKEDwocvQEdNq3ViZWtsH3F8VXy68rGpsZTJX2ITkmnQg+5MHVfl5O5UID894Z2QDggMCLsav895OjAtpmVcP6X1GRB+xyGIkOz8XT6YsvDvZBwtPtcF8RuL6J2F53XCpQdQXDnDeNku5SBO0AR+omgozm1O3ByTpZ1b6REE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629818; 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=yjJ4jusQTbkOmcSsx3/DXHfmUL/yDbDqnTWsh1Pfb4A=; b=Qn24goI7fo96hH/86qZjbw189WM+nx4Va3OghnxElN9fwOuSmZyXC6lLeMgIh4Fk4cTgOxXmIcGYFHKy0/b4kVTG0BJupNwWNZHLgPc8OZeq3def3nBOOAIbR/6M1qGQ2HVrP7zZ8AgGzX16dBjOixIdbHV8CnWW4f8AwNjFF94= 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 179362981842274.01772559416429; Mon, 2 Nov 2026 06:30:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt2F-0007uJ-4y; Mon, 02 Nov 2026 09:29:19 -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 1xNt2D-0007tL-4U for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:17 -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 1xNt2B-0007Ah-4M for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:16 -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-450-3zf5MHnONfqTeUIm_WzD9w-1; Mon, 02 Nov 2026 09:29:10 -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 4B67A180256F for ; Mon, 2 Nov 2026 14:29:09 +0000 (UTC) Received: from berrange.csb (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 39BEA1800444; Mon, 2 Nov 2026 14:29:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629754; 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=yjJ4jusQTbkOmcSsx3/DXHfmUL/yDbDqnTWsh1Pfb4A=; b=dQw0Fur0bazzOInPam0xkk5kAOh65emri/Nm+hJ06vVLsp4NnNO/1iHWkYmVugLF08ThxB Wa+ub07MtF1H7stVDVmUqGbPz1ZY7B2qjtJc3ZrGVVgBAwlej2lGrbtrjyoV+XTcYLXqZ0 bLX3dSG+ZDX+DeCoV/oCC1ugDWSJk/4= X-MC-Unique: 3zf5MHnONfqTeUIm_WzD9w-1 X-Mimecast-MFC-AGG-ID: 3zf5MHnONfqTeUIm_WzD9w_1793629749 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake Subject: [PATCH v4 14/25] trace: include probe name in Rust format strings Date: Mon, 2 Nov 2026 14:28:33 +0000 Message-ID: <20261102142844.3464712-15-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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: 1793629821168154100 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 Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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 Mon Nov 23 04:26:10 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=1793629849; cv=none; d=zohomail.com; s=zohoarc; b=lVynu9yO1LS7bAgKd1Dd6PUM6NPyFmo6jmUaQM9xKTxPNs9qysYGv6bp0JNBYlUulmfI4Ad9AmsbfIzcMOu3p75MyIfbL2NC+3wHhO9q+bxoIIVmVueuLz0qRWlH2SMJhnwS+VcwPVzisKHTC+GKZmO9y6UQkS9NN7pOMqi1t24= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629849; 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=KVfS3UtHmZwn0YDiZ1DfB+K8XGDItIIhijU9Tow0TNE=; b=ECEyQk1WPHeApyid9lH6ES4dg8dsvBPS2iH55g/HjwQtZVHQakXuc+7GVpBW4l7jtNgKKMfxTvlqomuxS+uyHXMbTyjaUYzNjqIHMWFQSrL3p/JytJ6Z8wdzXHlKyLO+xYKIQ6IcvLa6Fnr8nPu9vr/7eK9JIYaY+yYujiNH0Dg= 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 1793629849819606.7220533369539; Mon, 2 Nov 2026 06:30:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt2G-0007uh-GV; Mon, 02 Nov 2026 09:29:20 -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 1xNt2B-0007sQ-8W for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:15 -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 1xNt29-0007AS-Fl for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:14 -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-633-sVpJUNywNSevpDSsSdj7HQ-1; Mon, 02 Nov 2026 09:29:11 -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 B1C0B1809CBE for ; Mon, 2 Nov 2026 14:29:10 +0000 (UTC) Received: from berrange.csb (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 9CE261800444; Mon, 2 Nov 2026 14:29:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629752; 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=KVfS3UtHmZwn0YDiZ1DfB+K8XGDItIIhijU9Tow0TNE=; b=K9ZjqbtlkxZc+UNzWD3NI1P9jCdGJOQLBV+kXSdU96CO12WG8mW23GlN/9UthoH7BFfeV0 T+VKyTNYpH6V98hrc/IvFStuN62dnVyQCij5BForFA/PU4X+Pyr/iaL4/Dmp04q65q8/Q+ bfqCuZM1af3q0Nz8J450Vf7fo31nzr8= X-MC-Unique: sVpJUNywNSevpDSsSdj7HQ-1 X-Mimecast-MFC-AGG-ID: sVpJUNywNSevpDSsSdj7HQ_1793629750 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake Subject: [PATCH v4 15/25] trace: add missing newline in ftrace Rust format string Date: Mon, 2 Nov 2026 14:28:34 +0000 Message-ID: <20261102142844.3464712-16-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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=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: 1793629851160158500 The ftrace_write() method expects the caller to provide the newline. Reviewed-by: Eric Blake Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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 Mon Nov 23 04:26:10 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=1793629934; cv=none; d=zohomail.com; s=zohoarc; b=TQjEJBoTyq2PYq15PwQy+qAVtW1l7BX1XV2YrrH1Iq4I578O5nLauyuOQAuKDlFx8jXvxiW9Nz2iIMkZdyv/LLmehL0+5pvqY5ftGVT8h3RmBVwalqWobeUv8wvY/k0hIKhwC9QzIe5ePHkSsTdnujn5bQRS9qFTo93/vZCjRM0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629934; 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=yxt6rBZ3NCiZmlYKDRHKtcJCtgHRzf9Bq9k2Y8lYS28=; b=Iv4VWh+v+N+GaqlmTiSFNgbDQTZF6bB9bmYnQ1aOPVTSmEOUWVV1SAOXv2sbEhq/s6LYeeHUKlO0nLz+cbtKxkw6KGuBaohYrq4ARgrBkx/sQH1hK4iOcYl4AhVCOLBVuFtkQbHiSY1tXqaiqm2CsiOvcYlngDIuCLbItm/CjRE= 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 1793629934022965.9434124788887; Mon, 2 Nov 2026 06:32:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt2H-0007vE-FK; Mon, 02 Nov 2026 09:29: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 1xNt2D-0007tM-4j for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:17 -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 1xNt2B-0007Ae-2U for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:16 -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-347-pLgFVy0eNJ-ig1akgRnoiQ-1; Mon, 02 Nov 2026 09:29:12 -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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1FC761955D93 for ; Mon, 2 Nov 2026 14:29:12 +0000 (UTC) Received: from berrange.csb (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 0DB4E18004D2; Mon, 2 Nov 2026 14:29:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629754; 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=yxt6rBZ3NCiZmlYKDRHKtcJCtgHRzf9Bq9k2Y8lYS28=; b=Bh8wq3PUtPHg80pRJzLObpHwtcMXi+Gq43tUcMgGOide1uS/i0kKDxci9GOtrBvwH56ntg 3k8VB30S+0DgSgQm05hVzG2Ga8HkFkSCSoBOAMriu8meV24Ul/7DG5aG4HvqBsWax2RwRe jdqh0s0Ik8lp1j4AjatEFaJeOS92DrU= X-MC-Unique: pLgFVy0eNJ-ig1akgRnoiQ-1 X-Mimecast-MFC-AGG-ID: pLgFVy0eNJ-ig1akgRnoiQ_1793629752 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake Subject: [PATCH v4 16/25] trace: eliminate dupe trace_event_get_state_dynamic_by_id() calls Date: Mon, 2 Nov 2026 14:28:35 +0000 Message-ID: <20261102142844.3464712-17-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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: 1793629934575158500 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 Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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 +++++++- tests/tracetool/all.h | 22 ++++++++-------------- 7 files changed, 17 insertions(+), 34 deletions(-) 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 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 */ --=20 2.56.0 From nobody Mon Nov 23 04:26:10 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=1793629829; cv=none; d=zohomail.com; s=zohoarc; b=mzyYSwp0i9Z046xHWGQCEdvp5XwcbrbYL+BBoPNJ70wtSNCtL3Ke0BSPVsg+4pjOKeRrUz/bcq8zaQvdWNwSjsCkt+tWUXuvPFDcKacpinNuqa9PmqIMBP52QGyB9/e3oYiZky9hga9v4m0kqB2j0kvbHoL+n6n/A4F331iBC3c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629829; 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=gi9VwDa/i01bqWGvOdFJZnuHaMnKO/Z4EyFyeJ3x4s8=; b=SQ/ZNG9cooBiqGYreaOyyD5ikSQ8TbNef9lVHsUpTlDbCMgahh8bmqE0kTIw74FboSuMo5fn0Ei++ulC/NVm7BqJ0D9uyocAvXCUnbj6F7HPVcQXhHS24SHhIBC2N08kSbcBgpVMt2ER+6CtJtuKdAgQ5vjMhliiq5iqRWbetsw= 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 1793629829163100.6776827716069; Mon, 2 Nov 2026 06:30:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt2J-0007wD-IJ; Mon, 02 Nov 2026 09:29:23 -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 1xNt2F-0007uH-1L for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:19 -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 1xNt2D-0007B6-Fl for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:18 -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-232-i8G9DPn0O7ueg_sRxN2f0Q-1; Mon, 02 Nov 2026 09:29:15 -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 BC1D11800D8B; Mon, 2 Nov 2026 14:29:13 +0000 (UTC) Received: from berrange.csb (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 72A711800444; Mon, 2 Nov 2026 14:29:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629756; 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=gi9VwDa/i01bqWGvOdFJZnuHaMnKO/Z4EyFyeJ3x4s8=; b=RsaNxXAuJNaNujR+OypLhwoFwY9LuuPjUdm85/d4Q5YlKb0JKsxziTfuYrwJ5cRE82CC7t 9Xv+bN5AQxx4O7OPnGPzXQAvSCXVAquzIdKwIr5tjihva+Jlrp2CPuNe9PC73JWA9O8hdg r3wbGbnteSyLBjpC36m3BipusOzKjH4= X-MC-Unique: i8G9DPn0O7ueg_sRxN2f0Q-1 X-Mimecast-MFC-AGG-ID: i8G9DPn0O7ueg_sRxN2f0Q_1793629753 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v4 17/25] audio: remove mistaken use of trace_event_get_state() Date: Mon, 2 Nov 2026 14:28:36 +0000 Message-ID: <20261102142844.3464712-18-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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: 1793629831284154100 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 --- 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 Mon Nov 23 04:26:10 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=1793629934; cv=none; d=zohomail.com; s=zohoarc; b=BWvHykyRQTiuSx0mbfxI6K325uXzTJRdWmCQJsqmGu8V3hlRHxNGdK+BKQ9H3TQsJzWiyftGm2UeX1NzVkFHNfIx6JFsm4EOjqhve590K0cD8vBGl/L/lOc14tSS80ifLdDQcZh49iA76ZAxnfdXlPhQPpsOc2aKlHzy1xioLZA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629934; 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=EtRHsEP0BhVRB1hLbXnl2pGI9U2k40CZuJQKVQdkTbs=; b=jNUeoKpWvGKLZ9swvinqIKKQiRVihJplHtJjH0wK8Q6jtER4jwTP3LDRCrX+IIu97dtV04fkANUc5aQZqteyNXnFiBq8OhgZs8jESLuGs1VQQ00M5nC98DPiL+/00Q8j9cqNauE7FOi8cAP8JkDcsTvkRSnTDpnwN12eQw3PDoU= 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 1793629934008653.3607507669157; Mon, 2 Nov 2026 06:32:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt2K-0007wF-Cf; Mon, 02 Nov 2026 09:29:24 -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 1xNt2H-0007vT-M5 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:21 -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 1xNt2G-0007Bd-5e for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:21 -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-567-TYBZikHFNoaZYekwDHn9EA-1; Mon, 02 Nov 2026 09:29:16 -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 575F21955F2A; Mon, 2 Nov 2026 14:29:15 +0000 (UTC) Received: from berrange.csb (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 18C1B1800480; Mon, 2 Nov 2026 14:29:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629759; 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=EtRHsEP0BhVRB1hLbXnl2pGI9U2k40CZuJQKVQdkTbs=; b=Fo1qIYDSMxVeVBoq2aKLWnF5NejHxpgRlo6uAXD28syZIvwNJQwEZWbld+H0HPLDN8GEkq wwA/9E9+QGB4dJ/B3WfhN9bBaDX8HvqodOc0hmH0HwBPhPkhQz4NmHwjnqjvygxmPXveqo Sc12y4QN9ZdWwGwxn2InF2tiYUXfSdQ= X-MC-Unique: TYBZikHFNoaZYekwDHn9EA-1 X-Mimecast-MFC-AGG-ID: TYBZikHFNoaZYekwDHn9EA_1793629755 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v4 18/25] hw/ppc: remove mistaken use of trace_event_get_state() Date: Mon, 2 Nov 2026 14:28:37 +0000 Message-ID: <20261102142844.3464712-19-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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: 1793629934512158500 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 --- 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 Mon Nov 23 04:26:10 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=1793629829; cv=none; d=zohomail.com; s=zohoarc; b=BoxxBMeCnQeeI/bVUVc2K5wGeJI4cpgNqe5Gm1BqRFySEGxqNmDjvIlQ3yBFPbbh977AMFooQ5L5L0skFU60neOxFO4dcblzmwFPvDFozE0zJdApUV5Puq5qPto6oWx5QRFar9Q/gbWZR5Qb1WJW0B5HxQtkbS1Ui/3UlV+Zg3A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629829; 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=Wha8pve/S0YCfpjuANSumn6xFX6+g9XAO20nEsxA+TA=; b=FydJMTTzFCJ8tWZBUWiQ8H1aRDi1mNr+ZMnG733z2qccGYe13Dm5yTTlpWN9Z7ikgrqB9dYSfmljuMrRqMDC6kRCJm4DsUXSsbkvwce+v/pOKP/GIhdQaHEo5YR4nAloOirNT/8nIANXq6747tEzFhilrbaEt2xkf1X/yLXPLfo= 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 1793629829983555.7922174672818; Mon, 2 Nov 2026 06:30:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt2J-0007wC-I9; Mon, 02 Nov 2026 09:29:23 -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 1xNt2H-0007v3-1n for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:21 -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 1xNt2F-0007BU-Gm for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:20 -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-303-6XSzh8srMQCZexhddmxLTw-1; Mon, 02 Nov 2026 09:29:17 -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 BB8561964CF9 for ; Mon, 2 Nov 2026 14:29:16 +0000 (UTC) Received: from berrange.csb (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 A87A31800480; Mon, 2 Nov 2026 14:29:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629758; 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=Wha8pve/S0YCfpjuANSumn6xFX6+g9XAO20nEsxA+TA=; b=F7ZO2sCmNqTdhRZ49t0yKh4qRGvoS7Vs2XQBcusTWpllnm05K4Fg3/QYGh0Tm2ZKRprcFW ex1YZp5t3AZpj/GYO7u+QUWOfBbw+i9crPJdIvVCIqxzcb6PVutNfKqWdEpT3bT/Qtzj/3 +xRbD6joOB1XEgAchAH0ZP3CMNIric8= X-MC-Unique: 6XSzh8srMQCZexhddmxLTw-1 X-Mimecast-MFC-AGG-ID: 6XSzh8srMQCZexhddmxLTw_1793629757 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v4 19/25] monitor: remove mistaken use of trace_event_get_state() Date: Mon, 2 Nov 2026 14:28:38 +0000 Message-ID: <20261102142844.3464712-20-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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: 1793629830861158500 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 --- 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 Mon Nov 23 04:26:10 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=1793629889; cv=none; d=zohomail.com; s=zohoarc; b=jckI7EHnA02Arlit/nPDscaeBbbbCu7T0R99IphDApe/jU5oWCuuWbJldVqpMyIzstvxrOHVX+X0VDBFjIbHPBhssQNUGsEKkFv/QQAVasQauQSadt9GMP2KNuJpCRt20KZ1+ZMOeOJYtfn3BfiTh5jRaQKMtW6Sh8UY2SlUuEk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629889; 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=cWvb6WBM6KgpHymHGBnwHHh/5j83ONx+FV1rzdVYSiw=; b=Az9ppwuc2imFV1oH58R9JowRABleHKTovaP3a73EIR8RgvxiiyxMzPkuJ4z6zygkU0y9VcgbY5Z4dGQjpiPpw+TZQPq6u9XttHSFJyvF42bLLJdx+T52W6Az6SIy9D50b8WpW7ltELn74Ir44IyjY6gulZ3asDp/JcREYdA2uTk= 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 1793629889052204.49340926977914; Mon, 2 Nov 2026 06:31:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt2L-0007xZ-Rt; Mon, 02 Nov 2026 09:29:25 -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 1xNt2K-0007wJ-7B for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:24 -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 1xNt2H-0007Bp-OF for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:23 -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-369-ExllkFvdPWSGE1YmaKc4ug-1; Mon, 02 Nov 2026 09:29:18 -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 2A1041801239 for ; Mon, 2 Nov 2026 14:29:18 +0000 (UTC) Received: from berrange.csb (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 17E5318002B7; Mon, 2 Nov 2026 14:29:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629761; 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=cWvb6WBM6KgpHymHGBnwHHh/5j83ONx+FV1rzdVYSiw=; b=N8QjlAaSLB8CcFP8ht2uLBVgHOeNs5Kld9RIChByvQrpf0uIDVxViMKKI9TJ4rUbrBBrz5 FDYxokpBUNqlklEIGawwuBYk13+6pNjoMX2VdUv4W63yT+uLZy43tBbkFudissG+aGil3P OgQ7X5d8jhmpVAEc+TtgDgFdr8T4j7E= X-MC-Unique: ExllkFvdPWSGE1YmaKc4ug-1 X-Mimecast-MFC-AGG-ID: ExllkFvdPWSGE1YmaKc4ug_1793629758 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake Subject: [PATCH v4 20/25] trace: include qemu_loglevel_mask(LOG_TRACE) in guard Date: Mon, 2 Nov 2026 14:28:39 +0000 Message-ID: <20261102142844.3464712-21-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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=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: 1793629889949158500 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 --- scripts/tracetool/backend/log.py | 24 +++++++++++++++++----- tests/tracetool/all.h | 34 +++++++++++++++++++------------- tests/tracetool/all.rs | 16 +++++++++++---- tests/tracetool/log.h | 20 +++++++++---------- tests/tracetool/log.rs | 6 ++++-- 5 files changed, 65 insertions(+), 35 deletions(-) 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.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/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.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/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 Mon Nov 23 04:26:10 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=1793630035; cv=none; d=zohomail.com; s=zohoarc; b=CvszB9K5PM9KAQ1IOvpKk+boQO3M3uTSVTC3j5w601qpu/s5bNu57ilgbP+Axgx5sVeW843TP36NQWRdGyWTytrmV9M9ZuWd1XRDd/jIR0yQ7ldEAfvx0W7ps9vy28MuNE/LJF1mMdES4hqiLwFMCXgS+B8FlNSjfTWP6OJln3A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793630035; 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=k4HuzDeshd/Ax++IliknprMSsTVNH5yLWx4K3b5XHRc=; b=l3SIcuA1zNCW1lBiyeW7tv2SHdxy4bKONjRMhi4cK5HZ8MrRRsyi3nF0Tm7o+U6zrYrnxCY+NnTXz1/nOL6bgpuWhDLUjUhrM+6x1F0I82RV5eJheKPUijIhDZZmsDSUVPHdVSv5RigOCi+sKbL/gHAgvpsjzVq256LcGmIGGrs= 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 1793630035677323.42702854652305; Mon, 2 Nov 2026 06:33:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt2N-0007yF-I6; Mon, 02 Nov 2026 09:29:27 -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 1xNt2L-0007xG-79 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:25 -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 1xNt2J-0007C0-Cz for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29: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-168-n_DiOZHwNf2BPZYBaax-yg-1; Mon, 02 Nov 2026 09:29:20 -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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 63AC919539A6 for ; Mon, 2 Nov 2026 14:29:19 +0000 (UTC) Received: from berrange.csb (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 7BCBF1800480; Mon, 2 Nov 2026 14:29:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629762; 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=k4HuzDeshd/Ax++IliknprMSsTVNH5yLWx4K3b5XHRc=; b=Mw/DsA+KKw12Mzinu+QZCXd9itr0jVs2sR5D4DptkXV8mXzuBFCH8773Hiri56svqFVs+s Wmtekg+ePsGwUxdJyAr/JOtY69IKxv0gBa310EIqsFp8ukjh4KNu4S5ryIpKaIQC9DUDkV b0dHKyWCKj+CW1DHQaXyvID0FBL7z14= X-MC-Unique: n_DiOZHwNf2BPZYBaax-yg-1 X-Mimecast-MFC-AGG-ID: n_DiOZHwNf2BPZYBaax-yg_1793629759 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v4 21/25] target/hppa: use PRIx64 in trace-events Date: Mon, 2 Nov 2026 14:28:40 +0000 Message-ID: <20261102142844.3464712-22-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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: 1793630038511154100 %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 Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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 Mon Nov 23 04:26:10 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=1793629940; cv=none; d=zohomail.com; s=zohoarc; b=a2ptXcCivlu9Y3mvFxXXaq0xof0HJ7nHERkDm4MJhwLqX/UTkYLWaH2HFdD0nMljRSfInufBrkVjx0nhmrvuiHSgAmEOCsI5A+WcDl6QMhZENLZ+0xDJj4LGdGPwOSqccOxaOXBjIBzT9FKfs6pi5jTM6/br3s0Fz5CSUWw8zP8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629940; 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=MowG0Mygy2ZRE/MSemz74oshFf53gNumjGCNvKaSHnQ=; b=VTVpgqCt2BjW5+Pcg1RyXp/aHH0HqFyzqkHJnBfGdkLnbDBrnhG0CZ1bsLmG2EXDm0f1b63JecPZOD+aVSQr0tDmBSc3wqTTSxjBwzzx0A69wbPEJK5Wk4+8pOA1G32ePUvS4lh3fJktBjsVrzegFUR/q5OXk/B8HqVH9oPns7o= 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 179362994052622.602422652905375; Mon, 2 Nov 2026 06:32:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt2O-0007yq-Nk; Mon, 02 Nov 2026 09:29:28 -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 1xNt2L-0007xT-KN for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:25 -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 1xNt2J-0007C4-UT for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:25 -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-459-jVkd7GulMUWnyjKdICGXvw-1; Mon, 02 Nov 2026 09:29:21 -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 0E39F1809C89 for ; Mon, 2 Nov 2026 14:29:21 +0000 (UTC) Received: from berrange.csb (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 B532F1800480; Mon, 2 Nov 2026 14:29:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629763; 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=MowG0Mygy2ZRE/MSemz74oshFf53gNumjGCNvKaSHnQ=; b=HHVxhKwT8rbzw/m4SyXUB1eXs9eyQ3SLYzuIOWw6VZA1oJ6IudhOH5TSpMwNhojaO8lNg9 6akZlDI7NHTIKzA8Ves6zIu0YyI5qzFf/Bdp9TdQE5W2IuDUCAwVt+2OeiOvWYmPMeQIRy E5cUZzWCDECnbYSoZZFhSxMgeeU6ipU= X-MC-Unique: jVkd7GulMUWnyjKdICGXvw-1 X-Mimecast-MFC-AGG-ID: jVkd7GulMUWnyjKdICGXvw_1793629761 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v4 22/25] trace: remove "disable" property from trace files Date: Mon, 2 Nov 2026 14:28:41 +0000 Message-ID: <20261102142844.3464712-23-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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=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: 1793629942620158500 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 --- 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 Mon Nov 23 04:26:10 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=1793629844; cv=none; d=zohomail.com; s=zohoarc; b=W0Zgtn/xvvPxVRLxGZeFeNG4A2c8lAMnNEb1Hw1L/k22VK7XP55W85brgLqCG2syqVcCk1JMgH0OGdQHCW8lEuKEigJre6feyJm8jqzuW4uUW8O0aFld7GQetZgQbPe8LTQm9dg041a359n5Q4VUUgb9gxqP2cvq5gsWbx5Kk/s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629844; 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=h2IY1h7EUH5eDc6WOn+X4uZQXFLl24LL7gk1tLmJEdg=; b=e6WyFyzD3HGzUSLv/Fue9TxBAfwvnMKFdLR/KESBNPSJNuOGztNK/jygN2Hcxyc0AQMreA8akcSV0rUveUilT1wkmbjBff+6dT+gejD2fcyjYzBxV8t9aFOPiHg8wIXzNPuPx93LwdoFEuE28oASnyH6viJjgM+MczQ1ZkMD9qU= 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 1793629844386660.6944331210176; Mon, 2 Nov 2026 06:30:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt2W-000882-7B; Mon, 02 Nov 2026 09:29:37 -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 1xNt2U-00087J-Ai for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:34 -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 1xNt2Q-0007Cb-TC for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:34 -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-131-6pS3QfurNnOz8MxFa_ACRw-1; Mon, 02 Nov 2026 09:29:28 -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 DE8451802175 for ; Mon, 2 Nov 2026 14:29:27 +0000 (UTC) Received: from berrange.csb (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 60F5C1800444; Mon, 2 Nov 2026 14:29:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629770; 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=h2IY1h7EUH5eDc6WOn+X4uZQXFLl24LL7gk1tLmJEdg=; b=M6Doqwcxwf9m2MODPRaJrTC8FkfMOGiwUF3QBGPCwwXHTXHfsIyNn+Pm3x1XBYF196ti6u Ce/wUmTPBwY1RbAei3+AVl5dbdep260U2fP84GvqKrav1CEGGn2DxdV5IOGJ927YfLg3h2 zQq1IusvSrjOts/ALxfXRwRrTbbllcQ= X-MC-Unique: 6pS3QfurNnOz8MxFa_ACRw-1 X-Mimecast-MFC-AGG-ID: 6pS3QfurNnOz8MxFa_ACRw_1793629768 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v4 23/25] trace: stop tracking static disabled state Date: Mon, 2 Nov 2026 14:28:42 +0000 Message-ID: <20261102142844.3464712-24-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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=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: 1793629845309158500 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 --- qapi/trace.json | 5 ++-- scripts/tracetool/format/c.py | 2 -- scripts/tracetool/format/h.py | 8 ------ stubs/trace-control.c | 1 - tests/tracetool/all.c | 2 -- tests/tracetool/all.h | 14 +++++------ tests/tracetool/dtrace.c | 2 -- tests/tracetool/dtrace.h | 2 -- tests/tracetool/ftrace.c | 2 -- tests/tracetool/ftrace.h | 6 ++--- tests/tracetool/log.c | 2 -- tests/tracetool/log.h | 6 ++--- tests/tracetool/nop.h | 2 -- tests/tracetool/simple.c | 2 -- tests/tracetool/simple.h | 2 -- tests/tracetool/syslog.c | 2 -- tests/tracetool/syslog.h | 6 ++--- tests/tracetool/ust.c | 2 -- tests/tracetool/ust.h | 2 -- trace/control-internal.h | 6 ----- trace/control-target.c | 2 -- trace/control.c | 9 ------- trace/control.h | 27 +++----------------- trace/event-internal.h | 2 -- trace/qmp.c | 47 ++++++++++------------------------- 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/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: 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/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.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/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.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/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.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/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.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/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.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/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.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/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-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/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/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); } } --=20 2.56.0 From nobody Mon Nov 23 04:26:10 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=1793629791; cv=none; d=zohomail.com; s=zohoarc; b=eTQa2qhpBLyv0lzLMATCgoG61fB6tSh1+pWaCTXsFLTAfGOLDfU0/VRuFoNV3YllkAfp7Mgzzr7nSx2vZBT/sgky9eo46pmOk2hUFUak+hQosJpP3Q23e/PwchHImnXBZdKD8GMQml8D5Mw3pb8p+gXqgr1xsiAgixp8fOFqvWc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629791; 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=vLIeJcw0spM+u1PiAYV88mAwHCbkaNTsiQSn6t9zUsQ=; b=iv352IGzRtJD7yxQd60IBPp1GLbbN3EC+39qR3IDGHw7YviA978d7bjDqHS5p+Q/qdApPgZkYU5Qo+QYDydiI+MNvb3qwkQ8n0mqxMPan06sDB7YRxljOXXYi1CsCqAy3gEQNRDli806h/PbUWDnBXlm2y1wPKWJRhMGDGahoMQ= 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 1793629791800859.4233501825408; Mon, 2 Nov 2026 06:29:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt2e-0008DO-Pr; Mon, 02 Nov 2026 09:29: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 1xNt2V-00087d-3e for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:35 -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 1xNt2S-0007Ck-Cx for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:34 -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-609-56FA5UqcOpqmAg4oc9QA8g-1; Mon, 02 Nov 2026 09:29:30 -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 680511964CC8 for ; Mon, 2 Nov 2026 14:29:29 +0000 (UTC) Received: from berrange.csb (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 3D1FD1800347; Mon, 2 Nov 2026 14:29:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629771; 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=vLIeJcw0spM+u1PiAYV88mAwHCbkaNTsiQSn6t9zUsQ=; b=MG+sklh74tdWGgExlemdalaM6SA4/JEaRCS1bCdiB8zUorsBS0s+4/JW1bGKu/ArVsLwVZ nIRvdMKW8oFmx2aklJjZGfVtflZ3lvfToDQupJr4aMwBojbSEY6tBdYgf1aGaDz694JsRE 8JCYaPqde1PaDtxe9yUnwdfGVkXykcw= X-MC-Unique: 56FA5UqcOpqmAg4oc9QA8g-1 X-Mimecast-MFC-AGG-ID: 56FA5UqcOpqmAg4oc9QA8g_1793629769 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v4 24/25] trace: remove parsing of "disable" event property Date: Mon, 2 Nov 2026 14:28:43 +0000 Message-ID: <20261102142844.3464712-25-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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: 1793629792411158500 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 --- 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 Mon Nov 23 04:26:10 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=1793629835; cv=none; d=zohomail.com; s=zohoarc; b=cK03qRHFcLGOGvQYSZnR+M8Clo0FEjV3WBkglbka/jSZZ4KnAyMsBGNsAF6kQNzFQ2zCLTXLUXfCUJW23et9f1MQK2k8FZx5hr3XdvQisBCoVLqFNmQvMV4Iu0Ri6u7HaEORDV+vk3zybidDpgkT6IFGKMXfYGYp+RvvBmMSrgM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793629835; 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=Lu6+drg66abBaGeER6CdTUQLuSTnldG42ZoylZEa6/w=; b=V3zVCt5ufS05NV9sEK2m2lcOCnBkVpnd7S8QEalQkcJewQlcxC2unDYPB2nk2cpZyuyNH8Et6V37mdBDrhlNJW5SHckElAH+I9XM6mSydmUFkKgzDgJGsPy9GPeqlEVgWKRkhXoK4mdyCSiXhklVFKAgiLKwbsMH3Nfm08VhLAw= 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 1793629835002646.7622182681322; Mon, 2 Nov 2026 06:30:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xNt2h-0008Et-St; Mon, 02 Nov 2026 09:29:47 -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 1xNt2Y-0008AB-25 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:38 -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 1xNt2V-0007DD-U9 for qemu-devel@nongnu.org; Mon, 02 Nov 2026 09:29:37 -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-539-OLIgRGJdNIu3t4qDHrj3CQ-1; Mon, 02 Nov 2026 09:29:31 -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 0FE991802140 for ; Mon, 2 Nov 2026 14:29:31 +0000 (UTC) Received: from berrange.csb (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 C520418004D2; Mon, 2 Nov 2026 14:29:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793629775; 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=Lu6+drg66abBaGeER6CdTUQLuSTnldG42ZoylZEa6/w=; b=OqyzpPtWk8dCdMTJhwa60W4LNlN8JznCrEoKPFyrH14eq95UTc2cLkBZTDv7l+JPtacZOP PA4eVJGcWl8BEsPKI2BUL2GdJgRvS4XrL/Mgf73ACGTHHNn8u1q1JgPjF6/NnsfgcMaYRU JmaHugLD5alLpdb1CKHwQQ26dG3+6ks= X-MC-Unique: OLIgRGJdNIu3t4qDHrj3CQ-1 X-Mimecast-MFC-AGG-ID: OLIgRGJdNIu3t4qDHrj3CQ_1793629771 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v4 25/25] trace: remove 'trace_event_get_state' wrapper Date: Mon, 2 Nov 2026 14:28:44 +0000 Message-ID: <20261102142844.3464712-26-berrange@redhat.com> In-Reply-To: <20261102142844.3464712-1-berrange@redhat.com> References: <20261102142844.3464712-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.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=berrange@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=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: 1793629839468154100 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 --- scripts/tracetool/backend/__init__.py | 3 ++- scripts/tracetool/backend/log.py | 2 +- scripts/tracetool/format/h.py | 2 +- 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 --------- 9 files changed, 16 insertions(+), 24 deletions(-) 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) 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. --=20 2.56.0