From nobody Sat Oct 24 00:32:22 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=1790867867; cv=none; d=zohomail.com; s=zohoarc; b=oI0TvBLRJ9Q2EQvaZ/DZDh5cgQiqXBk2oK0GOoELO8nlT1cS3msqEKJ/kO5qm12OitxteKD6VJxyMXJ9gorsQriZRsXTExaG0gSYY1Kgs8hL6IjF5o+KdQL7sjtzcsokW0IB+75MxPo8JwlVBm+Y7Nvc28UVYf+yeaT7n+Dbq9Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790867867; 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=f2c4XpE3ZdexjMElI2n5rNHArTQqEYsq1YF9TekGdwM=; b=dsFTfi0SGumtq8SYL1cYetLs1GvmpoZMRZHCjIxPZI/K3pJM8ht9/y8cDNKcLT9xXK4hKBnGvvjXOceD+ZAbbycpAVrxxawVAYxrd9U1SkrtIHYH+4CS20QERDypQV/HZY8CeNGvHGtyT27GvFFlPVvVBW4GlyKLGDZSU8TlDK0= 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 1790867867458658.6480493550016; Thu, 1 Oct 2026 08:17:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCISg-0000qD-Mg; Thu, 01 Oct 2026 11:12:42 -0400 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 1xCISe-0000pS-3r for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xCISc-0000uH-Aj for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:39 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-52-aeeA_tLPNpaLZ-d1E6QANA-1; Thu, 01 Oct 2026 11:12:33 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 128901865D8A for ; Thu, 1 Oct 2026 15:12:32 +0000 (UTC) Received: from berrange.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 29B7C1956045; Thu, 1 Oct 2026 15:12:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790867557; 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=f2c4XpE3ZdexjMElI2n5rNHArTQqEYsq1YF9TekGdwM=; b=NjS7id8N/p3vN35pqhteoEpON+hPzJcjSha//q2BTuNvi9FxviVkzJryzg5Zuw+ZyWwDZX 5B18Lf+wdSmcRWJEnzt5G5PJfW7VvjSsUw3OuedApoCkcu0Hjswny+ItxrwW2qplWxaZX8 lZ239WW/VSJxX36i4jHPAQ1O5K7t5bY= X-MC-Unique: aeeA_tLPNpaLZ-d1E6QANA-1 X-Mimecast-MFC-AGG-ID: aeeA_tLPNpaLZ-d1E6QANA_1790867552 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 01/20] osdep: add 'ignore_value(x)' macro Date: Thu, 1 Oct 2026 16:12:09 +0100 Message-ID: <20261001151228.3373747-2-berrange@redhat.com> In-Reply-To: <20261001151228.3373747-1-berrange@redhat.com> References: <20261001151228.3373747-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.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.331, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: 1790867868979158500 Functions annotated with 'warn_unused_result' cannot be cast to (void) to silence the compiler. Add the ignore_vaule() 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. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- include/qemu/osdep.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 1ec5b42230b..c1ca2c127b6 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.55.0 From nobody Sat Oct 24 00:32:22 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=1790867612; cv=none; d=zohomail.com; s=zohoarc; b=NCpGYz3Jw/ICO7FYZwHKZnwlYfrzxriLi/TiqJJQSfHBnE68uQ051LQlzwaZrIcuDXJw6XH1ToSqEso+/D+WSxd4nACGO0xdKQZHl/hLA/ns4hQQ1oTfvGTBZIdf57k+na/MGiQIxveKD9eOwdhTbfyH3F7gXQ1NRSdhhcS7sAk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790867612; 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=JNBATASZe1maK+R/uHj4ADwON7Pzkeu5Yslw+3mrzWY=; b=Wkxwv3O08BJtkDUWwwZeKkRQP/dr971TIgXpMM/oyZf/ioZ9BmuZ1/C94opPuYD731UKZhluCUvxHfpzuT5Kw8wv7B1iuixM8Cw5zwoVTvFKxKnjSUsIQYjK8kHMgrqVVyhxisVkVX8HBDuqWFUSr4dJ4JvmbpAvWVbMGONO4XI= 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 1790867612568757.2237827450472; Thu, 1 Oct 2026 08:13:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCISj-0000rc-5G; Thu, 01 Oct 2026 11:12:45 -0400 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 1xCISc-0000p3-Hp for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xCISa-0000tz-St for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:38 -0400 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-567-OUF9I2wqMZ6sO-k24QNh4g-1; Thu, 01 Oct 2026 11:12:34 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 780451955F7B for ; Thu, 1 Oct 2026 15:12:33 +0000 (UTC) Received: from berrange.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8EF431956042; Thu, 1 Oct 2026 15:12:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790867555; 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=JNBATASZe1maK+R/uHj4ADwON7Pzkeu5Yslw+3mrzWY=; b=akUAcNPI5p0M14h51y30Ux0fOCDRkn9dZN7bk0ZD/XX3QEOG63Tn2S0Gjb3mA/glcsXGvq cjO9e77h5IbEaFu9m/biBVazVEYnoQYiRYR68FBIfoEgl5wvNmoTEz6Acph6wiMNSoNlwZ 8qsIh1ks/FdRNB1C457oLhlb50GPrZg= X-MC-Unique: OUF9I2wqMZ6sO-k24QNh4g-1 X-Mimecast-MFC-AGG-ID: OUF9I2wqMZ6sO-k24QNh4g_1790867553 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 02/20] trace: use 'ignore_value()' instead of a dummy variable Date: Thu, 1 Oct 2026 16:12:10 +0100 Message-ID: <20261001151228.3373747-3-berrange@redhat.com> In-Reply-To: <20261001151228.3373747-1-berrange@redhat.com> References: <20261001151228.3373747-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.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.331, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_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: 1790867614939158500 This pattern is more concise than using a dummy variable which in turn needs annotating as unused. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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.55.0 From nobody Sat Oct 24 00:32:22 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=1790867862; cv=none; d=zohomail.com; s=zohoarc; b=MQvCKDkQQjkT7Gp2koBBdz8VAO/vKM4eCal4VzicQWF6e6TcdfdFAuwggZJEkiTxwz96uW+jYfQLYB6T1sMHhnti3vM4QKV74MOpUseIJgMsPcFtoZVWdouUuJD00fq05bGmANK25wTN0ol6/MdfVu5Axjsvw0ITgXEeceuC06E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790867862; 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=lcWLmzele1KePFBt1NDM09SM7asBQ6cEdSXpYPeRAqw=; b=S9heJ1mbcNAViiy+LLSXVkaTVQilVcQGp9+80eDvWT7XEo4M9b2BDutcW7AdoFrrLJaYtH9ShpgPEb88aj/Moj/u5BOovQdNmHWDbr+TWjDTyJwJNHBjGrYr85+5VIdzxyaDjH/X+lmb5R0sdTjNhnIcAK6gBgR6I5l99Nr7lgo= 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 1790867862145655.8866742038235; Thu, 1 Oct 2026 08:17:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCISg-0000qC-MM; Thu, 01 Oct 2026 11:12:42 -0400 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 1xCISd-0000pD-BU for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xCISb-0000u6-Q0 for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:39 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-599-8T1r2-9jOAaMpExoM4UuOA-1; Thu, 01 Oct 2026 11:12:35 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B40901802164 for ; Thu, 1 Oct 2026 15:12:34 +0000 (UTC) Received: from berrange.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C9A031956042; Thu, 1 Oct 2026 15:12:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790867556; 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=lcWLmzele1KePFBt1NDM09SM7asBQ6cEdSXpYPeRAqw=; b=LrzESRSXxmiLWOJaaT6jzXNtoIlYVbbfkraCj1ZoHQRkaeYhiibfJ73uCBh7NGwS2iKg0i z9yPomw6wv5Mw7jrH8XE61EVR4z+ycsFJnRk1A/6FNUwM/+yevrT+kGm5Of9zT0Hwmr9nh dJvc9FFEvJdF2wyOGsKBE6TpUvw7QXM= X-MC-Unique: 8T1r2-9jOAaMpExoM4UuOA-1 X-Mimecast-MFC-AGG-ID: 8T1r2-9jOAaMpExoM4UuOA_1790867554 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 03/20] trace: fix handling of char** in UST backend Date: Thu, 1 Oct 2026 16:12:11 +0100 Message-ID: <20261001151228.3373747-4-berrange@redhat.com> In-Reply-To: <20261001151228.3373747-1-berrange@redhat.com> References: <20261001151228.3373747-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.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.331, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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: 1790867862969158500 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. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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.55.0 From nobody Sat Oct 24 00:32:22 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=1790867795; cv=none; d=zohomail.com; s=zohoarc; b=Iu0MzvFHSS8fSEazLzbIBczjtEVT8MHsvk2yesPsSc4kmPh1GPG25O9yUvWZwhhamU//dZ0deVsttqFKi3OmOOk+iGB6RyeOZd+Bx1aPGDejoEFBq90JSI/3wey6PX0AmyN9c4p11RFk6ma6OZ/ZUOrQjRdorpphuOa6dQ4hiHc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790867795; 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=UBXW5CfbhulYWh9Kv3fiG/udYwabQTozUv6fsZfiu+U=; b=HKGOiHsHTNhl6EYJFJGKRJDp9LKuaJuQINW/1EtXAWnveo+v9IdylbS7tMhgOUeaV24jh/Ex8upZISHbE1jFuceX/n4/aHZUbPYLFCdxUkgXbpq1qCdHDVFYiUzafl6zDhifMfQInub5gfm4ltYpIN+d3qU5PN/qfrEVsaST9hE= 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 1790867795044706.4218488865484; Thu, 1 Oct 2026 08:16:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCISl-0000sh-4k; Thu, 01 Oct 2026 11:12:47 -0400 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 1xCISj-0000sD-PF for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xCISi-0000vB-5w for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:45 -0400 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-328-2-HowbOrN1O-yrFdu3v6kg-1; Thu, 01 Oct 2026 11:12:41 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0FE36196C406 for ; Thu, 1 Oct 2026 15:12:36 +0000 (UTC) Received: from berrange.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 121CF1955F73; Thu, 1 Oct 2026 15:12:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790867563; 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=UBXW5CfbhulYWh9Kv3fiG/udYwabQTozUv6fsZfiu+U=; b=NGlyZlYlx5qHmE8WiROMpKb/Lh4Cwe2Fs3zJ9B44KJeu3gHrUV8WbdUhgOKnAq4wwPZYdu 1AVYaOVNtlK+NyZNgMd1GRU7PvNCP0W1nSG28FLBzA7K8+eiJtRL05re9DlitJcoCJdtMN qqy1x6p/sT0qD47DM2hUQzgpdaeUtAw= X-MC-Unique: 2-HowbOrN1O-yrFdu3v6kg-1 X-Mimecast-MFC-AGG-ID: 2-HowbOrN1O-yrFdu3v6kg_1790867556 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 04/20] hw/xen: replace "long unsigned int" with "unsigned long " for dtrace Date: Thu, 1 Oct 2026 16:12:12 +0100 Message-ID: <20261001151228.3373747-5-berrange@redhat.com> In-Reply-To: <20261001151228.3373747-1-berrange@redhat.com> References: <20261001151228.3373747-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.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.331, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_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: 1790867796411158500 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". Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=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.55.0 From nobody Sat Oct 24 00:32:22 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=1790867645; cv=none; d=zohomail.com; s=zohoarc; b=jzzQPvNE51pmG4dEdZzWDnr7IbfXQdttXBVBetzV717VkW6f2+gBp87biqFKXmY9PsboA+2hQFANRgZFWgNHNf+CuMOKO0KVqC3QuLszOyOVoDRpiCHbT6WatcuaeLHX2CRShISiOsEhregr8ZPIWCYT/fvSABbpopU6usthTas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790867645; 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=sypz/BgWChTRSIxZdQNXlaZ+pSkAaVAKoHDa+kh8fWk=; b=lYeaOhxcm40KtqsvG69Gdi++kfIsQtta0UcYOlq/9x6iOuPGcnXnBevQOvgxOaxr1vImvNrAWf+WTFv9/2s69I3oG5cjSs/1zxRs3BfiADVWOEcvrd7fvQy+aR4kJyksJKKEnX9+5uRx3ewTPbDJMkiOWkURkN2iEp9TgutlX1M= 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 1790867645375891.9241988740895; Thu, 1 Oct 2026 08:14:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCISh-0000qI-6x; Thu, 01 Oct 2026 11:12:43 -0400 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 1xCISf-0000q3-OL for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xCISe-0000uX-Bc for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:41 -0400 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-665-zG2bluv8NTqSV-b6MvbiEw-1; Thu, 01 Oct 2026 11:12:38 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3E36A1955F7B for ; Thu, 1 Oct 2026 15:12:37 +0000 (UTC) Received: from berrange.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4C67D1956042; Thu, 1 Oct 2026 15:12:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790867559; 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=sypz/BgWChTRSIxZdQNXlaZ+pSkAaVAKoHDa+kh8fWk=; b=DPAQqnjYVAdZjkl4T6vu3z1efKEsJStTxmqxa66/q+LQuVXI7fx9brAJUEU5CqBPq5tXuN 4xn4As7zM2lIrzvCFyQMoFbttqnV4UUBZGNACHeW7HMC5zSyeA1naXk+aNBT8GJ07LkWwj uRlMUg1jfoiYQIfYkxIiGtb3OaZ/YIs= X-MC-Unique: zG2bluv8NTqSV-b6MvbiEw-1 X-Mimecast-MFC-AGG-ID: zG2bluv8NTqSV-b6MvbiEw_1790867557 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 05/20] trace: block use of "long int" for dtrace Date: Thu, 1 Oct 2026 16:12:13 +0100 Message-ID: <20261001151228.3373747-6-berrange@redhat.com> In-Reply-To: <20261001151228.3373747-1-berrange@redhat.com> References: <20261001151228.3373747-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.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.331, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_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: 1790867647075158500 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. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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.55.0 From nobody Sat Oct 24 00:32:22 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=1790867774; cv=none; d=zohomail.com; s=zohoarc; b=grBZB/m05JVHTUQFcmNqxVMZyAre3unV5kd/SMNAPDsR4D/HLQh/OtB8j0olj3hRK6Oq9tgv+7Y4LMDMqdBaDNzYIJaQ3ExoVl/SEyMe2B47y5lYQ7mgKCzbRpB8Wm4RnO24zM7ipunr/1vxMNa3Zvi2btJrRu/kO+Xf6XfIgck= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790867774; 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=qXFOggXubYiYkcxn3XTLD/V6gI4xI2xtd0k1Uy0a7wg=; b=LQNO1ttYNVswD85MjDKq9eRE7ZKpEUES5mY/AOJ4qXaAxf0KROU6zQW/2Ln3gHBeY7emxsbEmgiYlUulnsZP71ZEFpl2UKncolKYd3nt57N3CraYAwvLN9WXnK/+zHGIa7TyOsTUaN+ecI4IZuiVYtuRVq9dJhkZzHUkBUBT9zk= 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 SMTP id 1790867774239565.2054018165126; Thu, 1 Oct 2026 08:16:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCISi-0000qt-5d; Thu, 01 Oct 2026 11:12:44 -0400 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 1xCISh-0000qE-2k for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xCISf-0000um-Jn for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:42 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-218-IQHRO8gnPBKF0THrlCk_cA-1; Thu, 01 Oct 2026 11:12:39 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 787D11955F41 for ; Thu, 1 Oct 2026 15:12:38 +0000 (UTC) Received: from berrange.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8FFD81956042; Thu, 1 Oct 2026 15:12:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790867560; 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=qXFOggXubYiYkcxn3XTLD/V6gI4xI2xtd0k1Uy0a7wg=; b=bBvBjBH88bfLO1j/dO6KawU6xLMGTmeHzPDkvmw/PkmHUZDdkXSquSWqKZcOYRhA8kOg4k GS5n8Vc5lMuVZjEBXY7E7UaTP87WagdFeEhsmzNWLBBNnlgtA5NgLfWFcYfSvxHw3Ne5n+ sim71PuLeEAZTKpYeKog3hukt2MF65w= X-MC-Unique: IQHRO8gnPBKF0THrlCk_cA-1 X-Mimecast-MFC-AGG-ID: IQHRO8gnPBKF0THrlCk_cA_1790867558 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 06/20] trace: drop unused trace_event_set_state_dynamic_init() Date: Thu, 1 Oct 2026 16:12:14 +0100 Message-ID: <20261001151228.3373747-7-berrange@redhat.com> In-Reply-To: <20261001151228.3373747-1-berrange@redhat.com> References: <20261001151228.3373747-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.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.331, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_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: 1790867776306158500 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: 0d4e995c7368f8bdc8845beb499b650386a38819 Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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.55.0 From nobody Sat Oct 24 00:32:22 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=1790867659; cv=none; d=zohomail.com; s=zohoarc; b=OUNhhwZOncc+PuVLfx1h/SApnWifMpT0FK8f8H60ulsbZSFKHKFO+I0hwCcBEQASTDhGHn26Yt+w+JOV+JhhgHlzYO3cswLi5ilMtOboKAqvJ+zRSWoy2/CuH/qjMjq2eZj4HtbNtONLnng79jAdjENf3fBtRFpzm+0UXz16xtw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790867659; 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=/z3aFk1Np3yQEBd0G9ugOCENeVZRxfoiuPxk0XaPfXA=; b=Ok5y6Pl6FQS0pwPtD/QC66ExOaquGY/Ps8doYXNOzQbpGd3mgCMtGKy+s3VrINI21PdjlMp2yj9Kz5nezcn7kRH55NBmcZcmPqlZ3IW5H9CLhML526IzAAWy+YfELSBYw/Hy0U5WvpovTollCYyjG2ZbWo9KkELU1yPfcVzzF6c= 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 17908676591492.5321697265551393; Thu, 1 Oct 2026 08:14:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCISn-0000tV-0J; Thu, 01 Oct 2026 11:12:49 -0400 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 1xCISi-0000qu-8t for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xCISg-0000uz-Nl for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:44 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-407-I6BFbvCwPZ6YSMCcDgSkeg-1; Thu, 01 Oct 2026 11:12:40 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B2BD01955DC9 for ; Thu, 1 Oct 2026 15:12:39 +0000 (UTC) Received: from berrange.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C99A31956042; Thu, 1 Oct 2026 15:12:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790867562; 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=/z3aFk1Np3yQEBd0G9ugOCENeVZRxfoiuPxk0XaPfXA=; b=PnH9vnEXRZ/jq7cse8Ra3VLvyjbyW1Yh4Sa0Fa+E54+44hUaPKgs5U/yZyI1xSKRuJupP0 Pjhroxp3DwUCSCVtJFlQT2sneTyk7v72rY1bEtuDKw2YIJ1eoKh2ocfhD8zQ0h3RuPv3Ha ZINRZZiw5Av+8j6rmvfGrOcDBzdrwwE= X-MC-Unique: I6BFbvCwPZ6YSMCcDgSkeg-1 X-Mimecast-MFC-AGG-ID: I6BFbvCwPZ6YSMCcDgSkeg_1790867559 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 07/20] trace: remove obsolete references to vcpu property Date: Thu, 1 Oct 2026 16:12:15 +0100 Message-ID: <20261001151228.3373747-8-berrange@redhat.com> In-Reply-To: <20261001151228.3373747-1-berrange@redhat.com> References: <20261001151228.3373747-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.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.331, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_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: 1790867661230158500 The 'vcpu' property for trace events was removed 2 years ago but some mentions of it remain in the code. Fixes: 7ffc4894a6(trace: Remove deprecated 'vcpu' field from QMP trace even= ts) Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=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.55.0 From nobody Sat Oct 24 00:32:22 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=1790867595; cv=none; d=zohomail.com; s=zohoarc; b=NRMCwSbrvDxq4P76TLjsYLrF9cqOCBoXlesfdO/zr8KMQMdpKgxG5IOsw7dvILFfqNMl0Zo6FTmhn022oUvRk10Sesskz0uJ91n2fpcZlAX2PRdJjb6UmU1NxQufo1Mos5b//ChooJHcwvTV+JSpzdI8/A1ThSktSrO4m8VDgig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790867595; 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=idnktq9Uo7qt8zbP6jL5VhvBquWghBq/WnLltkaiz1I=; b=VaiqK6TFwWB5FPJQLkNCa2y0FJLYzWWWz+vE/3xfI8qffJXpcJczOI0mPZgDzE+T4xWsUF5oq7fX68QqbphTHw3yqEaSJB6pTXsXiluM2AtUJHC1V6YMOcsDaTf3Fl2I5nAvuVrDv1gTagw4vxBe/PmYUZ72VjOFBxsf4eRY5n0= 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 1790867595246967.5240656821725; Thu, 1 Oct 2026 08:13:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCISm-0000sy-SY; Thu, 01 Oct 2026 11:12:48 -0400 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 1xCISj-0000sM-Rf for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xCISi-0000v9-23 for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:45 -0400 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-449-hlW23hj0PgmIJbnisPodqQ-1; Thu, 01 Oct 2026 11:12:41 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EC9E91953943 for ; Thu, 1 Oct 2026 15:12:40 +0000 (UTC) Received: from berrange.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0ECD31956042; Thu, 1 Oct 2026 15:12:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790867563; 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=idnktq9Uo7qt8zbP6jL5VhvBquWghBq/WnLltkaiz1I=; b=PWcQnfd+zQlJlLW3KjGPjitDOXR+hQVSRv1P/eWQCNiSZG0gsxZQqbD5R6wJDvDRWLeqvs VSdML962eGnBjkja3RqIz4ybkRFQnsmzPwwL4nvwtFRxZnlZW90ZaXV07xsNk9SjVCAXHi jK4voNGPOAtOVACFCm8WLeyMcggvqHU= X-MC-Unique: hlW23hj0PgmIJbnisPodqQ-1 X-Mimecast-MFC-AGG-ID: hlW23hj0PgmIJbnisPodqQ_1790867561 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 08/20] trace: drop 'id' from TraceEvent struct when not required Date: Thu, 1 Oct 2026 16:12:16 +0100 Message-ID: <20261001151228.3373747-9-berrange@redhat.com> In-Reply-To: <20261001151228.3373747-1-berrange@redhat.com> References: <20261001151228.3373747-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.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.331, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_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: 1790867597091158500 Only "simpletrace" uses the "id" field from the TraceEvent struct. Omit it when this backend is not enabled to save memory. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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.55.0 From nobody Sat Oct 24 00:32:22 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=1790867657; cv=none; d=zohomail.com; s=zohoarc; b=iREyvGdnC59t3rGsy+g9w/nYjHCKOwQTaKroe5qwGDsxLmZ5hlH4WIaiOV1quw4qZqaM6b5qXVwMbo7Vs13Qd8hn0jz80i4SqeBEX00v95LifbtN7jFwPq8EAnK6Ot7Op2koJXf9lZHAPMzC4U2aLf8xRfqFHJlVIPZX77iPVtM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790867657; 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=1gNTcaAF2n50blvNYEoPnxxzQ36hlvLj5GvVYcThhi4=; b=dZw84xnNPu5GjEM3CCAQdxhTTJKw2Hm13fLZzskM4FfNC4/W667Qj6+mrli44DKiOJ0nY28sppoi01R3OPdM4Gb8Sm+pb3hdo2H4PMln23rjM+e5Bkj3PLLholGai0sZ9VpBB5/D94rA2kPtgKHdSzkfjR+6C7IG2cff8RJ/j+A= 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 17908676572575.204398837522945; Thu, 1 Oct 2026 08:14:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCIT0-0000zF-OR; Thu, 01 Oct 2026 11:13:02 -0400 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 1xCISl-0000sz-UT for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xCISj-0000vR-Hi for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:47 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-616-4_ssnkwRM9OPNuOvCi_RPA-1; Thu, 01 Oct 2026 11:12:43 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 32E071801358 for ; Thu, 1 Oct 2026 15:12:42 +0000 (UTC) Received: from berrange.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4A5321956042; Thu, 1 Oct 2026 15:12:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790867564; 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=1gNTcaAF2n50blvNYEoPnxxzQ36hlvLj5GvVYcThhi4=; b=NLDBcM4onNxTdIe5ZezhaTeo7JkBZ4p+0KZat2TepC0nqhyjMPqERxsGCMRaKFInmz4j6b ixLgyI/uKeRWQuoqDx9qSu1YN/J+NcW2e7X4mNb/6SEp9vgWPqLSxfTYMJjlPx0D4VFxzr 9l6P+fHEOctONw3arV0vPWxqbGEcrEE= X-MC-Unique: 4_ssnkwRM9OPNuOvCi_RPA-1 X-Mimecast-MFC-AGG-ID: 4_ssnkwRM9OPNuOvCi_RPA_1790867562 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 09/20] trace: change "DSTATE" variables from uint16_t to uint8_t Date: Thu, 1 Oct 2026 16:12:17 +0100 Message-ID: <20261001151228.3373747-10-berrange@redhat.com> In-Reply-To: <20261001151228.3373747-1-berrange@redhat.com> References: <20261001151228.3373747-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.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.331, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: 1790867659416158500 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. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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.55.0 From nobody Sat Oct 24 00:32:22 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=1790867856; cv=none; d=zohomail.com; s=zohoarc; b=UEUpGqMg8SxuyDd535xbwD7Qvc0W2NNRa5fpYj9nmsknsVwJV+eEzltxB0lZQOJwowNHYWeINwIUtrsmWsGainc27askBAIz5rHArDtpQ3yKTTbaNkjWgvzztSBoK962wNn/6Z8Xik3QPjEKNTUhEHrkXrxPDpOFWyjzzxs0GNw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790867856; 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=5M/lTi0dFEyGuGUtXD3oLpwdwGCtBiVJVWpXtVUyNGI=; b=c4huVcYKP0178UpvszvNhBRBlQYnppNM1Qzql2DezU2cS1h3UdBICeYKUn+lsY1ufIr7AqHfSL+Z7rzEDNmcsgPVt7395ROX3RJImDJ50lChAYRDfbZAmdT+pXn3L8aI0xLo+OapApqYPPK5E+w+5yqIFrCp8rDnbnP0RTeXYeg= 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 1790867856303114.23323798255547; Thu, 1 Oct 2026 08:17:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCISp-0000uG-3U; Thu, 01 Oct 2026 11:12:51 -0400 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 1xCISn-0000tj-2n for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xCISk-0000vh-IS for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:48 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-341-G8AQjkmeNwa5hXzLgvf65w-1; Thu, 01 Oct 2026 11:12:44 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6C935182FA26 for ; Thu, 1 Oct 2026 15:12:43 +0000 (UTC) Received: from berrange.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 83EB71956042; Thu, 1 Oct 2026 15:12:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790867565; 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=5M/lTi0dFEyGuGUtXD3oLpwdwGCtBiVJVWpXtVUyNGI=; b=i6pXkmrTxMEsNltOGsL0p2iGRw6Qg7WeGyYKqiD7qOCiYclVwB0ZgSL0KLD1l1o77hPQvR mjeL46jA16vWWrC+tnuN7er6L7ax/CJRRvuRkvVrpYXgLneUqTnkwbTusl12AyzCQmnsat ShtYrFQNanAuU6ZdncGUuRkB8L5Ig+E= X-MC-Unique: G8AQjkmeNwa5hXzLgvf65w-1 X-Mimecast-MFC-AGG-ID: G8AQjkmeNwa5hXzLgvf65w_1790867563 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 10/20] trace: add testing of 'nop' trace backend Date: Thu, 1 Oct 2026 16:12:18 +0100 Message-ID: <20261001151228.3373747-11-berrange@redhat.com> In-Reply-To: <20261001151228.3373747-1-berrange@redhat.com> References: <20261001151228.3373747-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.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.331, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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: 1790867856940158500 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. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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.55.0 From nobody Sat Oct 24 00:32:22 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=1790867661; cv=none; d=zohomail.com; s=zohoarc; b=NcN9Tfkk0OvVGAZ7qS1Smg5o34gb59SwI6EbU8UPyH57jV22w7vWyC5PJc0MdMhv9eu+9DfL6Q8RP2NjViPbus6ypsP2paUiszxXsSb+w5tXpEjk8lNcxBsxKxVZY/fryjHnwSnNH5cYJ4SDMg7cc1cIqTFV2md0Cmex8xO0sws= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790867661; 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=w2L5CrhoSugN4PNDdEeU0BB2o3/ygoEPgplMTHGAPFI=; b=U2VkbzSGITEkP5gx70JtuZX8GYGcEm4/ZsrgJT2FypUBsyVRxkCMXjsOj5UjiiRwaTVaGosJkrH+HentGb0A5EKI/8wt2V12aIzaczXXmFNRbw6vMcTntapwmpAl3V3bDlJSFQZShLzfuFZac0Stbv1ZQjrXRMP2ljBiIKbVv3U= 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 1790867661372294.48486137308555; Thu, 1 Oct 2026 08:14:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCISq-0000vK-KU; Thu, 01 Oct 2026 11:12:52 -0400 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 1xCISn-0000tp-G7 for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xCISl-0000vm-P4 for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:49 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-481-ObeAAzGSNxKM2TFRMJ392Q-1; Thu, 01 Oct 2026 11:12:45 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A67BF1955D80 for ; Thu, 1 Oct 2026 15:12:44 +0000 (UTC) Received: from berrange.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BEB571956042; Thu, 1 Oct 2026 15:12:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790867567; 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=w2L5CrhoSugN4PNDdEeU0BB2o3/ygoEPgplMTHGAPFI=; b=OknV2ummGW/Bi2niMIwtQOK1+FdWBCvptdSwS8qIUGg+YuVrxWZXzIy1RckRjCVQit6Fbl zWLiWYM5ozx1AqthiVU04xqRkHBLWllIdCPJqq6ZJ2/CANlLNZsRmSfupn9Fw4qS0OVD7b EcpOIPukjLMSvu2CiY+jT0hg9esJX7Q= X-MC-Unique: ObeAAzGSNxKM2TFRMJ392Q-1 X-Mimecast-MFC-AGG-ID: ObeAAzGSNxKM2TFRMJ392Q_1790867564 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 11/20] trace: don't emit TraceEvent structs when 'nop' backend is used Date: Thu, 1 Oct 2026 16:12:19 +0100 Message-ID: <20261001151228.3373747-12-berrange@redhat.com> In-Reply-To: <20261001151228.3373747-1-berrange@redhat.com> References: <20261001151228.3373747-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.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.331, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_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: 1790867663403158500 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. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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.55.0 From nobody Sat Oct 24 00:32:22 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=1790867663; cv=none; d=zohomail.com; s=zohoarc; b=GinoPs+somgqfF3WoAJgV3DrFe0ZZiMSksHTJBlHZKiDRFot5OLO6WlzcUC5qQA7PTVBHQk6yk2bOseARlBnV51Dqivmx5Bh6RbdzHBmKA9MpjfAMDsE2TQOInOqXxsdCQITBqj1nQncU49rf8ExPoQSL08nv52XiEmNTPGnLao= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790867663; 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=1eONkIU9bvtey167WbKeGlRPiRMK9+I3Cr4R1a2upyQ=; b=HQJAZM0kWK23orzBtScf8ke7iCuAhMYFj6IXVtn+dWZgEP0U2IxLreAw++zOOfbCIXh4ggq7yoCigzqQVy4DFGJ+bIAyFzaxWCjqblawn2fWGiHu+DFZKXqr9V1uxU4lTbu4jKE91di8GPVbSb4twzEL1I4d45GxgGMsr/b5qTk= 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 1790867663720581.0037844672054; Thu, 1 Oct 2026 08:14:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCISw-0000xS-7r; Thu, 01 Oct 2026 11:12:59 -0400 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 1xCISq-0000vM-Mv for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xCISo-0000wD-3K for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:52 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-688-cJIBLBRTO-GvVENAbBPJVQ-1; Thu, 01 Oct 2026 11:12:46 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0575B1954128 for ; Thu, 1 Oct 2026 15:12:46 +0000 (UTC) Received: from berrange.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 050CD1956042; Thu, 1 Oct 2026 15:12:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790867569; 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=1eONkIU9bvtey167WbKeGlRPiRMK9+I3Cr4R1a2upyQ=; b=U6M9HwLXpUUMf9nzGf2ZIOPzA1zgKK1bgfOpirHdssJnXn8wYKyvB3MuXKeSfAeki/0mVV aCu5+R7XHpy/7uyZ0DsfTTOcPKIXhsYDBBvoOT5pNchEPcNP8qmPDTaBiTCvs2AJMHoydw RIwDSK8U9PAKp2gzXuCPdn9peio+w9c= X-MC-Unique: cJIBLBRTO-GvVENAbBPJVQ-1 X-Mimecast-MFC-AGG-ID: cJIBLBRTO-GvVENAbBPJVQ_1790867566 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 12/20] trace: add test of generation with all backends enabled Date: Thu, 1 Oct 2026 16:12:20 +0100 Message-ID: <20261001151228.3373747-13-berrange@redhat.com> In-Reply-To: <20261001151228.3373747-1-berrange@redhat.com> References: <20261001151228.3373747-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.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.331, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_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: 1790867665423158500 This reveals potentially interesting patterns in the generated code when multiple backends are present. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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.55.0 From nobody Sat Oct 24 00:32:22 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=1790867848; cv=none; d=zohomail.com; s=zohoarc; b=H2sO5Mq70oTvWcRktDQj3r/pZ/nuxGAfFAQC9uNThmJ96TqoUCsZW6fduTGTEoivtpRB1IDBgSWG3lQRAv0hATlwVeeNdo120MNXPNozuYzwOdc1lYluk5wZU1zq+6Xn3EHOMrS4jM/4LBqcqLibiTRuh1EWPXbXjFlPR7aK2sM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790867848; 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=bQJWHACpyQBfwqC9SDBwkDNAYtW03AwoPC0S3PeYVh4=; b=bGoYCxK3e6KG2L76jHuoX+RGgIZ1qQPT1SO/kLkwM6XnTd1gkUnsOMgAyQIbPtOcjGSmkK/SNvtJZM/1SkM70gGLtChwRBQEIu/vRAB3cdox6ZbBaTqh64IeMWc7X8h2cU9aIt7Du1fJ6GKvyhsFBw5OMV+D83LvvKSOzdX6gzM= 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 1790867848673554.1529294455253; Thu, 1 Oct 2026 08:17:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCISs-0000wd-Lb; Thu, 01 Oct 2026 11:12:54 -0400 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 1xCISq-0000v7-6i for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xCISo-0000wG-9O for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:51 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-652-yhEUs1XYPuibDGJGSYVCmQ-1; Thu, 01 Oct 2026 11:12:48 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 54E591800597 for ; Thu, 1 Oct 2026 15:12:47 +0000 (UTC) Received: from berrange.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 55DC11956045; Thu, 1 Oct 2026 15:12:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790867569; 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=bQJWHACpyQBfwqC9SDBwkDNAYtW03AwoPC0S3PeYVh4=; b=IMLC865hcXKyi232jUML1fwfW+a58QAqk36x/9RRnDIQf+Hyj+LJqdrmsk3o2dGSkSyoUX luT2R1DS3xpKKdDfp4gF/jJArZqKj+9/tHO1XLCE0lfY7oaOpfmfhHrZnLaogGAso/cTHp JXN1diblsD5ldBOjqnelL7OUHUe9Isg= X-MC-Unique: yhEUs1XYPuibDGJGSYVCmQ-1 X-Mimecast-MFC-AGG-ID: yhEUs1XYPuibDGJGSYVCmQ_1790867567 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 13/20] trace: remove redundant headers from simple trace backend code Date: Thu, 1 Oct 2026 16:12:21 +0100 Message-ID: <20261001151228.3373747-14-berrange@redhat.com> In-Reply-To: <20261001151228.3373747-1-berrange@redhat.com> References: <20261001151228.3373747-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.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.331, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: 1790867850892158500 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. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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.55.0 From nobody Sat Oct 24 00:32:22 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=1790867662; cv=none; d=zohomail.com; s=zohoarc; b=ECFtFrJzZLRAzQuI9d/R9mO7Rex0gyLkFDaSCCErinTlfonprNYiUP9xawSNc6ZqNcIFnywrqXrfYTiLKoTm5Lfw2JPdqKNlliecG7MitNiGajXVEO6qfreG8ZJpPNb7yziqNVsA/SpuDgl+inH0waGChTYVCFsCu/BnulDVl2Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790867662; 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=Z0i6smfKv0q/tf+MIdUzBldzbG/E/DdqFQkiGj4iPrg=; b=Ehv5t8tE7rJpELF8vJ/bTa+kOI3Ve+YlQONSVZbewMjQ+iv45T8VmWKaTkmqlOfmDZnmoZqcys0JuwwfglsLr2UOhWQlIch6JEYk2ZgjdeHQjMslKy9LYqPeS6/G/bcODopwtEAGPG58wOOW9XS6qByi27MTjqBHY9PXdkVukxc= 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 1790867662631791.4731616492281; Thu, 1 Oct 2026 08:14:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCISz-0000yZ-2P; Thu, 01 Oct 2026 11:13:01 -0400 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 1xCISr-0000wO-AX for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xCISp-0000wM-Df for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:53 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-473-t0mof2CGM1OHnLAmwUs9IA-1; Thu, 01 Oct 2026 11:12:49 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 975501954232 for ; Thu, 1 Oct 2026 15:12:48 +0000 (UTC) Received: from berrange.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A626D1956042; Thu, 1 Oct 2026 15:12:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790867570; 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=Z0i6smfKv0q/tf+MIdUzBldzbG/E/DdqFQkiGj4iPrg=; b=AhedplQY/5zLpxSnvkXfHViGB+/NuxUhDbIVJWj5Fkg7xiDjRAXfYP5Soi7Ppk7hkt6E0C rlD5G2z2uMWPwi4sr86oyVuTtgjY4OBKnLS4Oe7uVzRJnQvJuSD1eYuXe9TDwAZ7KSatVP pGu+Ac5k41swB/0reWmoYoyOojJ6268= X-MC-Unique: t0mof2CGM1OHnLAmwUs9IA-1 X-Mimecast-MFC-AGG-ID: t0mof2CGM1OHnLAmwUs9IA_1790867568 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 14/20] audio: remove mistaken use of trace_event_get_state() Date: Thu, 1 Oct 2026 16:12:22 +0100 Message-ID: <20261001151228.3373747-15-berrange@redhat.com> In-Reply-To: <20261001151228.3373747-1-berrange@redhat.com> References: <20261001151228.3373747-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.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.331, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_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: 1790867663362158501 Conditional checks must call trace_event_get_state_dynamic() which checks the state of all backends, while trace_event_get_state() only validates state for backends using QEMU's internal state tracking. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=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 f7d73d85608..60a4007817c 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.55.0 From nobody Sat Oct 24 00:32:22 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=1790867657; cv=none; d=zohomail.com; s=zohoarc; b=IJ/JTgCJk9wVcu3Kke5/Z9spHkqrusbaROctrgBS8ydtN1/dAiuhne1dO/cVXYPzXisq5aepm7q/D71wjqcRDv1klXtaq8PAl4K5J9iF6BYtgHh4fDJFbrs5UdeKfMA/2SYmFXzlnt6iUMt3/oDjayGyIImehVpc++Rndv5977o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790867657; 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=UljxjXzXSX1lkCDOAkvJzvzSDuWf1l0nN3ENy0CVeGk=; b=TMYTLHMWrcXtH/t7eUJYS7FrhcL9vJqWeRpaZUetAR+PMP1W3OaxOh9JXKGJrU3m3/2AK3t4JH/jnJWTWWVmPKF40D643+5DGwL/us+HT7lyrlHazN6wOZH11civzb7LdBmaBpM3nRIvukOt0TdzZlIkMadbShentW2KMqjjXFw= 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 1790867657242430.1709962068019; Thu, 1 Oct 2026 08:14:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCIT2-0000zj-F9; Thu, 01 Oct 2026 11:13:04 -0400 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 1xCISw-0000y0-DQ for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xCISu-0000xB-Tx for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:58 -0400 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-682-mvpiMBKDPvKSAsG8Y27vEA-1; Thu, 01 Oct 2026 11:12:50 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F3184195394E for ; Thu, 1 Oct 2026 15:12:49 +0000 (UTC) Received: from berrange.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EA9131956042; Thu, 1 Oct 2026 15:12:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790867576; 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=UljxjXzXSX1lkCDOAkvJzvzSDuWf1l0nN3ENy0CVeGk=; b=VY05vWzbNcM2Lp0xkUUthqrkP8YMEthJnbrVDDv2g2pmXmZRMJr8uAA/ZB1qSoH2v1i/Q2 hZ3EPBiT48ZMKphAaQJPOIt/zPK4ffkDkjrFpMkGVu1afDBsDavuBBa5uLdsOT/+cu1KIz X34AXQsvqsSGQPQt/m1y4AeZpasEKts= X-MC-Unique: mvpiMBKDPvKSAsG8Y27vEA-1 X-Mimecast-MFC-AGG-ID: mvpiMBKDPvKSAsG8Y27vEA_1790867570 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 15/20] hw/ppc: remove mistaken use of trace_event_get_state() Date: Thu, 1 Oct 2026 16:12:23 +0100 Message-ID: <20261001151228.3373747-16-berrange@redhat.com> In-Reply-To: <20261001151228.3373747-1-berrange@redhat.com> References: <20261001151228.3373747-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.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.331, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_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: 1790867659305158500 Conditional checks must call trace_event_get_state_dynamic() which checks the state of all backends, while trace_event_get_state() only validates state for backends using QEMU's internal state tracking. Furthermore, checking qemu_loglevel_mask() is inappropriate since there are many trace backends, of which 'log' is only one. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=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.55.0 From nobody Sat Oct 24 00:32:22 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=1790867658; cv=none; d=zohomail.com; s=zohoarc; b=nQMdHQ0Pen/bWRW4SZH50Fyj8axRtDuCuF7ibx5gAMt/2Y+s2/ujOQJfEomsGuvYbX/H+ZcETsRjVsbAoWj9ztjFJT6z2apwSmCBpMXwKgx2Jph+fZQrK1SWWhmrB4cSkJoIV6auXCpgyrmN61pAhHPegNHSG6Ncbim8XKCsptg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790867658; 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=JUzHE7QdyiOQS5vqzhgnKaHT8pU2BBeH6IsrzWgV98o=; b=Wi3tlOaI5hCOqzW7H5u0pRQNKT1qGo9la56qe3+631aijL545r0mChP2JQVxY7qHtD8y7MTbYfSXR+Gc/RHVqgK1b1N3VnfuGuPBxz9CsA3Sv5hJB2CDROKCguomzRaliCpX37QdeULwQ9C/NFowOXsTunrLLR87CBTxcidyZp4= 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 1790867658884817.9884820666011; Thu, 1 Oct 2026 08:14:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCIT0-0000z1-D8; Thu, 01 Oct 2026 11:13:02 -0400 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 1xCISu-0000x8-SP for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xCISs-0000wo-Au for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:55 -0400 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-489-GeUPiaPpOYu6ZKY4kPK2WA-1; Thu, 01 Oct 2026 11:12:52 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 376D41954B34 for ; Thu, 1 Oct 2026 15:12:51 +0000 (UTC) Received: from berrange.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4EA721956042; Thu, 1 Oct 2026 15:12:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790867573; 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=JUzHE7QdyiOQS5vqzhgnKaHT8pU2BBeH6IsrzWgV98o=; b=QMU2JCiupt/GaW8HEt2bAwuuvQDRGGFeshbIYOAxrPPmEb9vKOtoQip14SP42CJIC89Nhx Wy5CcCz0RVzfA4AxX5pdSB9Uy44nVdOpEboNCA845jEHsNOWAzNgUd0TlTmF/t8+GKF7ec ssZToUlUJHDCUATBD18l8iIgGjqxqvc= X-MC-Unique: GeUPiaPpOYu6ZKY4kPK2WA-1 X-Mimecast-MFC-AGG-ID: GeUPiaPpOYu6ZKY4kPK2WA_1790867571 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 16/20] trace: include qemu_loglevel_mask(LOG_TRACE) in guard Date: Thu, 1 Oct 2026 16:12:24 +0100 Message-ID: <20261001151228.3373747-17-berrange@redhat.com> In-Reply-To: <20261001151228.3373747-1-berrange@redhat.com> References: <20261001151228.3373747-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.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.331, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_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: 1790867659331158501 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 the 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. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- scripts/tracetool/backend/log.py | 3 ++- tests/tracetool/all.h | 6 ++++-- tests/tracetool/log.h | 6 ++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/tracetool/backend/log.py b/scripts/tracetool/backend/l= og.py index 9e3e5046f5f..7834e5b0d40 100644 --- a/scripts/tracetool/backend/log.py +++ b/scripts/tracetool/backend/log.py @@ -42,7 +42,8 @@ def generate_h(event, group): =20 =20 def generate_h_backend_dstate(event, group): - out(' trace_event_get_state_dynamic_by_id(%(event_id)s) || \\', + out(' (trace_event_get_state_dynamic_by_id(%(event_id)s) && \\\n' + ' qemu_loglevel_mask(LOG_TRACE)) || \\', event_id=3D"TRACE_" + event.name.upper()) =20 def generate_rs(event, group): diff --git a/tests/tracetool/all.h b/tests/tracetool/all.h index 41fa4d0e8a2..a2c2d40388e 100644 --- a/tests/tracetool/all.h +++ b/tests/tracetool/all.h @@ -45,7 +45,8 @@ void _simple_trace_test_wibble(void *context, int value); #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) && \ + qemu_loglevel_mask(LOG_TRACE)) || \ 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) || \ @@ -74,7 +75,8 @@ static inline void trace_test_blah(void *context, const c= har *filename) #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) && \ + qemu_loglevel_mask(LOG_TRACE)) || \ 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) || \ diff --git a/tests/tracetool/log.h b/tests/tracetool/log.h index ff510d54908..fe08277887f 100644 --- a/tests/tracetool/log.h +++ b/tests/tracetool/log.h @@ -16,7 +16,8 @@ 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) @@ -31,7 +32,8 @@ static inline void trace_test_blah(void *context, const c= har *filename) } =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) --=20 2.55.0 From nobody Sat Oct 24 00:32:22 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=1790867647; cv=none; d=zohomail.com; s=zohoarc; b=ikRiTVI0e14Avw07ATkpkV3xersaMVKYpqwd9+TX3EWABbjwpEx1hu6aqKfhiirEPD0gweD8rP9TjkQoWJONIdeoSM9gbuMCWfdPYBAQGpBdMBcND0thnAsvFmRhwgS/QB1Vfe4S/HrYBDWgaaptYR8WHohNsx5klTVKd8Vtmq0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790867647; 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=G7iaZPI6BqXig10NmgcIbIlFNdla2yflwu0xr4IggAU=; b=bcnrtOTBkVBJB1okUKFJx71POgaxLRtcjEQk1BjLNNjm3vuUEPPq/5z86KQ3aMM+AHoAkkTvLhaVf+6uaMXllAr1dZu2eKBeMQchMjEKgUApWXDNZ249ligDztfRP5zLMfk1v1mD2lq85OZbLNTNeWcYMZLQjzY1w56yY2JRN4w= 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 1790867647534340.432296456033; Thu, 1 Oct 2026 08:14:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCIT9-000105-DL; Thu, 01 Oct 2026 11:13:11 -0400 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 1xCISw-0000xo-6t for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xCISu-0000wz-Az for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:12:57 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-54-0oz5XdI8NfONgy1WN2p8WA-1; Thu, 01 Oct 2026 11:12:53 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 732321955D80 for ; Thu, 1 Oct 2026 15:12:52 +0000 (UTC) Received: from berrange.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 878821956042; Thu, 1 Oct 2026 15:12:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790867574; 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=G7iaZPI6BqXig10NmgcIbIlFNdla2yflwu0xr4IggAU=; b=E5Zgm3Nu3CLUAAVywCAne1k8lrLQA69tq3koi7QMaUBAmhddiqYpoXPnic1PI2NB9SRH15 JGcRUiTVyszDo0bnupn0HPw+pkNQgGlxrNJCS6wtmnSmydFg6Mqi+zi3hP+ICIEfyFrTRL gU2iTx7o4KgbvwrIN4iu+Wd2SHCbwVc= X-MC-Unique: 0oz5XdI8NfONgy1WN2p8WA-1 X-Mimecast-MFC-AGG-ID: 0oz5XdI8NfONgy1WN2p8WA_1790867572 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 17/20] trace: remove "disable" property from trace files Date: Thu, 1 Oct 2026 16:12:25 +0100 Message-ID: <20261001151228.3373747-18-berrange@redhat.com> In-Reply-To: <20261001151228.3373747-1-berrange@redhat.com> References: <20261001151228.3373747-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.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.331, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_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: 1790867649221158500 The scenarios are not significant enough to justify its use Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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 01761a4559b..7c897610a9e 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_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" +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%lx va_e=3D0x%lx 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%lx va_e=3D0x%= lx pa=3D0x%" PRIx64 +hppa_tlb_find_entry_not_found(void *env, uint64_t addr) "env=3D%p addr=3D%= 08lx" +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" +hppa_tlb_fill_excp(void *env, uint64_t addr, int size, int type, int mmu_i= dx) "env=3D%p addr=3D0x%lx 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%lx phys=3D0x%lx size=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%lx va_e=3D0x%lx 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=3D%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%lx phys=3D0x%lx" +hppa_tlb_lpa_failed(void *env, uint64_t addr) "env=3D%p addr=3D0x%lx" =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" +hppa_tlb_probe(uint64_t addr, int level, int want) "addr=3D0x%lx level=3D%= d want=3D%d" --=20 2.55.0 From nobody Sat Oct 24 00:32:22 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=1790867848; cv=none; d=zohomail.com; s=zohoarc; b=a+C31+jFFvx2ugf7mPwypblrezDtxNdmr4NUBHCQ/EyFpWrdXrnEWjstno916LdEBczYeHJ2RPrmMgq9X2VcxzFLTIdX1hBdmiWlLt5FuRg7n0RYL9lqKDr137xS8tsZjOA4LQjpm5WwuQOKTnlfnfXltV7R6WQIFMMbfXmsk0A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790867848; 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=gh6GvLedMPXxMa7C6DrVw9z9ZSeYEC1PbeWcSzEncw0=; b=cCyhRQphfaPCokHRrPA/LHXaUPS32MwTIbiTzRqk2ByV9FFNbSQXmnSRQ9bYJ/CLmAXeg2fR06xgjX+SujWvUmXiaAMW8W66n8pK5xZsONmOG0fohuJRYwtDa3XMr/BeHulLXBF8AOnZr2L3zZwKM66KjDOpiStawHi/kXr8ddQ= 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 1790867848870153.03578965185193; Thu, 1 Oct 2026 08:17:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCIU5-0001dh-Gn; Thu, 01 Oct 2026 11:14:10 -0400 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 1xCITU-00018E-LS for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:13:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xCITR-0000z8-HK for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:13:32 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-122-qmqvfyAJO5KThgzjEUnECA-1; Thu, 01 Oct 2026 11:13:05 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AC23E18007F7 for ; Thu, 1 Oct 2026 15:12:53 +0000 (UTC) Received: from berrange.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C3F9F1956042; Thu, 1 Oct 2026 15:12:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790867603; 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=gh6GvLedMPXxMa7C6DrVw9z9ZSeYEC1PbeWcSzEncw0=; b=Cji2c/x+9iy+Tzi5s2CjaQ/EUTexRmw8sGd4cCgDCOclkmhsQk3IZiN2I1ShWqJZqy0+BY HaW++RW3is06b5usl2iYvXvqtOPQEG+MrMJ72G5bV1/sQZV1r27VD2VTnrUlcuqTO93drN bBXqXgSpk+n+p1dtBsBCVf8FEhyYiSg= X-MC-Unique: qmqvfyAJO5KThgzjEUnECA-1 X-Mimecast-MFC-AGG-ID: qmqvfyAJO5KThgzjEUnECA_1790867573 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 18/20] trace: stop tracking static disabled state Date: Thu, 1 Oct 2026 16:12:26 +0100 Message-ID: <20261001151228.3373747-19-berrange@redhat.com> In-Reply-To: <20261001151228.3373747-1-berrange@redhat.com> References: <20261001151228.3373747-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.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.331, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: 1790867850999158500 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. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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 | 18 +++----------- trace/event-internal.h | 2 -- trace/qmp.c | 47 ++++++++++------------------------- 25 files changed, 30 insertions(+), 124 deletions(-) diff --git a/qapi/trace.json b/qapi/trace.json index de369dae6b5..a5aaf2cab0e 100644 --- a/qapi/trace.json +++ b/qapi/trace.json @@ -17,8 +17,6 @@ # # State of a tracing event. # -# @unavailable: The event is statically disabled. -# # @disabled: The event is dynamically disabled. # # @enabled: The event is dynamically enabled. @@ -26,7 +24,7 @@ # Since: 2.2 ## { 'enum': 'TraceEventState', - 'data': ['unavailable', 'disabled', 'enabled'] } + 'data': ['disabled', 'enabled'] } =20 ## # @TraceEventInfo: @@ -73,6 +71,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 6ffb7256e31..3ca92ba5fbe 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 a2c2d40388e..6eed86edb4d 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 @@ -59,16 +57,16 @@ 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 60 "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 64 "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 @@ -89,16 +87,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 89 "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 93 "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 fe08277887f..cf37ed3ce26 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) 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 29 "log.h" +#line 27 "log.h" } } } @@ -42,7 +40,7 @@ static inline void trace_test_wibble(void *context, int v= alue) 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 44 "log.h" +#line 42 "log.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..80eb2bd14e6 100644 --- a/trace/control.h +++ b/trace/control.h @@ -107,13 +107,13 @@ static const char * trace_event_get_name(TraceEvent *= ev); * 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 @@ -123,18 +123,7 @@ static const char * trace_event_get_name(TraceEvent *e= v); * does not have the disabled property. */ #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 +137,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.55.0 From nobody Sat Oct 24 00:32:22 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=1790867595; cv=none; d=zohomail.com; s=zohoarc; b=B9ijkhLk4zeJgAFEUO6B5qQcaWSAWUGYes/GuxKsSNJjOLKKDIKzpBm0U9ThcCUXHqziN5GuLdUQfrCEkNgxHIfnlCNWVf/nSDctZX5BuR+XUONhJbLz2PssqtFvauZpA/oGj3t0Au7XsscN7Us+GSB95H7NQIxltlRQZNwvL68= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790867595; 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=/916oowHlZcH6J7SgN/42og/2yE/p4n/hLGiHY3t/no=; b=azfm91AKjvVF0J4aadJqvuqL7SExC4468N3Je245l6qzORIMcFXskfK+wfl8VI/3KhrsHzNsRG5qOPsAz/xa4X00QnV6t+u24004CaPNitejnJjDmZ8xkW7ehFHow/8HonDHzI9307yeZvRAnaBsyKPxoIh/mKTKOFzJxH75N9c= 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 1790867595530811.5647979866018; Thu, 1 Oct 2026 08:13:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCIT3-0000zz-Ov; Thu, 01 Oct 2026 11:13:05 -0400 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 1xCIT0-0000zS-SE for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:13:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xCISv-0000xM-Ul for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:13:02 -0400 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-12-z5AL3rAzMMqwa1PemJ9XTA-1; Thu, 01 Oct 2026 11:12:55 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E7FDC1954B34 for ; Thu, 1 Oct 2026 15:12:54 +0000 (UTC) Received: from berrange.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0A1611956045; Thu, 1 Oct 2026 15:12:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790867577; 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=/916oowHlZcH6J7SgN/42og/2yE/p4n/hLGiHY3t/no=; b=KeApjuIAPOdFv+/9M4aCpG/yzExhd8uzL/Oex+JgJ+jONWaIDANlS1SULLRqnyjSPjkwpo 5hcQ45W79Y/e+20+7L3WqhhXsvsJ+42KHUS7UGZC86iqH3mYt0OBHHF9isoNWhWrYoMbos aHZzWWg9dRD5knJV1MfgLHlCDuMXm2Q= X-MC-Unique: z5AL3rAzMMqwa1PemJ9XTA-1 X-Mimecast-MFC-AGG-ID: z5AL3rAzMMqwa1PemJ9XTA_1790867575 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 19/20] trace: remove parsing of "disable" event property Date: Thu, 1 Oct 2026 16:12:27 +0100 Message-ID: <20261001151228.3373747-20-berrange@redhat.com> In-Reply-To: <20261001151228.3373747-1-berrange@redhat.com> References: <20261001151228.3373747-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.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.331, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_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: 1790867597048158500 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". Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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 | 20 +++++++-------- 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 --- 11 files changed, 30 insertions(+), 72 deletions(-) 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 3ca92ba5fbe..af1482f6238 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -46,8 +46,7 @@ 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) + backend.generate_backend_dstate(e, group) =20 out(' false)') =20 @@ -57,16 +56,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.55.0 From nobody Sat Oct 24 00:32:22 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=1790867642; cv=none; d=zohomail.com; s=zohoarc; b=BZLmFY3NBnsy9+mbRWUkK6E5xSN2CdM5KxwkToB6f7tLpcgDt/uULhCqUFiUxs1QCrjVPkshc3AG913Eg5iH32nOQY25C6s8ZlpERXYWxj8U433ffY7ZcqCxEFAYaJDTUWfQg2NFbYPask0gaGBNa3r/wIXA4nzsMJKEZjD/y4g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790867642; 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=eq6ZOcez9dknKy1iaNlIuqdUh9gjVW+5YKgWKiIzfhI=; b=m70S2ZPWZYgi8owF+e7shhaEePfzwTFyhG/VTgoWep8SNXABe3J+SPzwm9yvxMlhiKugkkdWeM0ZlbuJC5rEkZZK0Say+BccZfMHzjZiN/Z5y2loLkP2+fq6HwGI92ykVnlEYOMr82ZKpn/ldR7jesM2FsDErThP9tvE26PnP7I= 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 1790867642026192.87606241468632; Thu, 1 Oct 2026 08:14:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCIT9-00010c-JH; Thu, 01 Oct 2026 11:13:11 -0400 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 1xCISz-0000yz-EG for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:13:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xCISx-0000xb-8F for qemu-devel@nongnu.org; Thu, 01 Oct 2026 11:13:01 -0400 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-272-Gvm_nczrN9yEA49PMNrHUA-1; Thu, 01 Oct 2026 11:12:57 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 447DF195E92C for ; Thu, 1 Oct 2026 15:12:56 +0000 (UTC) Received: from berrange.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 443D71956042; Thu, 1 Oct 2026 15:12:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790867578; 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=eq6ZOcez9dknKy1iaNlIuqdUh9gjVW+5YKgWKiIzfhI=; b=Lf1mYiPW8Jgj7AHwcIUfHEkFYiG+gcmci1Bar8njgorGghYO3xBd+DcVkWFrzMyCzx5H1r UAvM9Ctmedq/DK7VxsJJES819+wCX67Udf5MiNIzJ2TAADTlRiTSbq/kz/Da+FpV8PBoVg Q5e6yxntINGFmoGOMRw6QvQ4ViGO8NI= X-MC-Unique: Gvm_nczrN9yEA49PMNrHUA-1 X-Mimecast-MFC-AGG-ID: Gvm_nczrN9yEA49PMNrHUA_1790867576 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 20/20] trace: remove 'trace_event_get_state' wrapper Date: Thu, 1 Oct 2026 16:12:28 +0100 Message-ID: <20261001151228.3373747-21-berrange@redhat.com> In-Reply-To: <20261001151228.3373747-1-berrange@redhat.com> References: <20261001151228.3373747-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.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.331, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_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: 1790867643414158500 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. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- monitor/qmp.c | 4 ++-- scripts/tracetool/backend/__init__.py | 3 ++- scripts/tracetool/format/h.py | 2 +- tests/tracetool/all.h | 4 ++-- tests/tracetool/ftrace.h | 4 ++-- tests/tracetool/log.h | 4 ++-- tests/tracetool/simple.h | 4 ++-- tests/tracetool/syslog.h | 4 ++-- trace/control.h | 12 ------------ 9 files changed, 15 insertions(+), 26 deletions(-) diff --git a/monitor/qmp.c b/monitor/qmp.c index aec03157750..b5cc3ee1973 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 diff --git a/scripts/tracetool/backend/__init__.py b/scripts/tracetool/back= end/__init__.py index 9109a783c72..12bb91f5347 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/format/h.py b/scripts/tracetool/format/h.py index af1482f6238..822740a3140 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -60,7 +60,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 6eed86edb4d..513f59d6ffb 100644 --- a/tests/tracetool/all.h +++ b/tests/tracetool/all.h @@ -54,7 +54,7 @@ static inline void trace_test_blah(void *context, const c= har *filename) { QEMU_TEST_BLAH(context, filename); 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 60 "all.h" @@ -84,7 +84,7 @@ static inline void trace_test_wibble(void *context, int v= alue) { QEMU_TEST_WIBBLE(context, value); 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 89 "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 cf37ed3ce26..973b72ff87f 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)) { if (qemu_loglevel_mask(LOG_TRACE)) { #line 4 "trace-events" qemu_log("test_blah " "Blah context=3D%p filename=3D%s" "\n", = context, filename); @@ -36,7 +36,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)) { if (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 80eb2bd14e6..0bcb34a6393 100644 --- a/trace/control.h +++ b/trace/control.h @@ -97,18 +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. - * - * If the event has the disabled property, the check will have no performa= nce - * impact. - */ -#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.55.0