From nobody Sat Oct 24 00:32:21 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=1790934781; cv=none; d=zohomail.com; s=zohoarc; b=UxdlzxM9fmK5PMy6ncuP+/++anM+bbRg3hjWc4q2Y2Oh/QiQ4821ktdiQJPe302nUpnhHmfjInjIUTubR54l+2m0pneMPQng4/iN5FVCFW+EkJQY8PnZYC2ME1K1klPGhv4QPABX92Fcrjr4ITbix73vKSBp8HPRdJmOkEAEjpc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790934781; 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=+EzJ63IWCEjUDJJ0JofGxaKMn0NKslhNMwRNUD9khjU=; b=nsYXgWlJKzXruSnKOEg68U+SFd9PJ7BeH4499uT8f4VMxSwQUvp9bWP4RyBc6uArMER1ggl6BvlVZnvOJQT4iCZb9Q9uB695UAFLyWjAg33SSYUweR3kYKa6//IiF+MbpjzJax13SbZjqQ1Qv8Cj4WUGAFtr0d3UZEyXeJYS7YI= 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 1790934781752761.8657655021625; Fri, 2 Oct 2026 02:53:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCZwc-0003Mc-Af; Fri, 02 Oct 2026 05:52:46 -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 1xCZwa-0003Lm-IR for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:52: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 1xCZwY-0000t5-L0 for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:52:44 -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-141-fJrX_JuEOQOfCa3p7ugNSg-1; Fri, 02 Oct 2026 05:52:38 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6819B1955DE0; Fri, 2 Oct 2026 09:52:37 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2A2B4180049F; Fri, 2 Oct 2026 09:52:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790934761; 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=+EzJ63IWCEjUDJJ0JofGxaKMn0NKslhNMwRNUD9khjU=; b=b5R7FcbOi4x1ZHcgz+hRa+oC1N+CJKXT696GaGj3uE/V2WtNvyv+GNRoBcZHrymZ/dTRJV 9yRsiAmWyGKw/Z/A1ssaQA70iE2uwpaFuOCbdzXs+lZkgS1RI9qCFD6IBD0i2JjDkNlWqC R/qiD/igHPcFPmNp+TsFNR1fSlCAp7A= X-MC-Unique: fJrX_JuEOQOfCa3p7ugNSg-1 X-Mimecast-MFC-AGG-ID: fJrX_JuEOQOfCa3p7ugNSg_1790934757 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 01/20] osdep: add 'ignore_value(x)' macro Date: Fri, 2 Oct 2026 10:52:13 +0100 Message-ID: <20261002095232.3605567-2-berrange@redhat.com> In-Reply-To: <20261002095232.3605567-1-berrange@redhat.com> References: <20261002095232.3605567-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 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: 1790934783585158500 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. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 --- include/qemu/osdep.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 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:21 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=1790934894; cv=none; d=zohomail.com; s=zohoarc; b=dX6AXvEZpV8Wzglm6eZeykttJVxShFcCJJA4fUsbZSZTevh0t7cukntVx/TFmS/AZgruN4Lwvp9aAxoeHuQ3kBc03l8zEtsQx0pPMLvwEvUsho1lMo121Lbpyxy/9zN495w1keay/VNDp2/fnvE1z12Yuk9uF6U5MGtV6iSPAWA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790934894; 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=ABBB+x2ltO7IJva4AI5UdLqxh0yAUvl3D+5qFIotCwE=; b=G3i6YPuwpcoC7/+g/0wEboiABWXpYTIeDgdlY/9dfKny+lzkzSimhWkxq8OB6+VKuGF+UpJKKFfWvZukqmncEVhumWukEm0oCNy4+8UmSCR0Jjxvr3qY0c9O5RAHGLUro3adq2F8ygm3dNkOXuGi2CdjaRzKVox0YZEE29r4z+E= 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 179093489442238.43039295350434; Fri, 2 Oct 2026 02:54:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCZwd-0003Mt-Kw; Fri, 02 Oct 2026 05:52: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 1xCZwb-0003M8-Mn for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:52: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 1xCZwZ-0000t9-1n for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:52: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-128-DawsJabkO4y4h46sPZsbDA-1; Fri, 02 Oct 2026 05:52:40 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C0A1E1977039; Fri, 2 Oct 2026 09:52:39 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B8802180049F; Fri, 2 Oct 2026 09:52:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790934762; 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=ABBB+x2ltO7IJva4AI5UdLqxh0yAUvl3D+5qFIotCwE=; b=GHX5ByQwy8p7ly3vAe7ZWA3uGzl+j8jxbAzs2joRCuybTFPsrHNGiTTo3rEUFNLcGGOxIu EtDVyt9r2b4EyQlFyOPGum2g9/k4amGUlTivfECLKrB0JUV23yh7NoVB7ZUmHhKcU++x3n BQRavgL8q27q+PiIDkwurFZM1DxM6k4= X-MC-Unique: DawsJabkO4y4h46sPZsbDA-1 X-Mimecast-MFC-AGG-ID: DawsJabkO4y4h46sPZsbDA_1790934759 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 02/20] trace: use 'ignore_value()' instead of a dummy variable Date: Fri, 2 Oct 2026 10:52:14 +0100 Message-ID: <20261002095232.3605567-3-berrange@redhat.com> In-Reply-To: <20261002095232.3605567-1-berrange@redhat.com> References: <20261002095232.3605567-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 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: 1790934896062158500 This pattern is more concise than using a dummy variable which in turn needs annotating as unused. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 --- trace/ftrace.c | 3 +-- trace/simple.c | 9 ++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/trace/ftrace.c b/trace/ftrace.c index 6875faedb9c..c1ed6ad4454 100644 --- a/trace/ftrace.c +++ b/trace/ftrace.c @@ -41,7 +41,6 @@ static int find_mount(char *mount_point, const char *fsty= pe) void ftrace_write(const char *fmt, ...) { char ftrace_buf[MAX_TRACE_STRLEN]; - int unused __attribute__ ((unused)); int trlen; va_list ap; =20 @@ -50,7 +49,7 @@ void ftrace_write(const char *fmt, ...) va_end(ap); =20 trlen =3D MIN(trlen, MAX_TRACE_STRLEN - 1); - unused =3D write(trace_marker_fd, ftrace_buf, trlen); + ignore_value(write(trace_marker_fd, ftrace_buf, trlen)); } =20 bool ftrace_init(void) diff --git a/trace/simple.c b/trace/simple.c index c0aba00cb7f..e148ca44530 100644 --- a/trace/simple.c +++ b/trace/simple.c @@ -163,7 +163,6 @@ static gpointer writeout_thread(gpointer opaque) } dropped; unsigned int idx =3D 0; int dropped_count; - size_t unused __attribute__ ((unused)); uint64_t type =3D TRACE_RECORD_TYPE_EVENT; =20 for (;;) { @@ -179,13 +178,13 @@ static gpointer writeout_thread(gpointer opaque) } while (!g_atomic_int_compare_and_exchange(&dropped_events, dropped_count, 0)); dropped.rec.arguments[0] =3D dropped_count; - unused =3D fwrite(&type, sizeof(type), 1, trace_fp); - unused =3D fwrite(&dropped.rec, dropped.rec.length, 1, trace_f= p); + ignore_value(fwrite(&type, sizeof(type), 1, trace_fp)); + ignore_value(fwrite(&dropped.rec, dropped.rec.length, 1, trace= _fp)); } =20 while (get_trace_record(idx, &recordptr)) { - unused =3D fwrite(&type, sizeof(type), 1, trace_fp); - unused =3D fwrite(recordptr, recordptr->length, 1, trace_fp); + ignore_value(fwrite(&type, sizeof(type), 1, trace_fp)); + ignore_value(fwrite(recordptr, recordptr->length, 1, trace_fp)= ); writeout_idx +=3D recordptr->length; free(recordptr); /* don't use g_free, can deadlock when traced= */ idx =3D writeout_idx % TRACE_BUF_LEN; --=20 2.55.0 From nobody Sat Oct 24 00:32:21 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=1790934805; cv=none; d=zohomail.com; s=zohoarc; b=RHKtsWfmi711jxKHZxixYvU8zU0o24I1Eq37ElLjVDytWE4m3ZV1feKZ6XGxBtWIBfhG4Nfhzsb4rluijqD7zh6CH+Xa2ugcvv0Lp22WsZq8mCFlJsw3kBQgAooj/EfLLIk2i1KDhSUVuVKTaAJSF5wUV086X4/FJD4AKZH6KfY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790934805; 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=Cs2cewHOZWzfG6h7klIN4A2WI1O+O6VBZh5Hk/by5LE=; b=C37XrZ3t7F2MLT9odtgmsZsDo+MiRwojgiW/DwvV5PRt6vnVujny4W8cLRBHZ/B0PoCOcTOPz6TMsyl+ihEljNONwBwQq1a3W3wCEeuejNGmiMiLhMpJ4Y+lonSrRyTunp1nWD5Rk3sOA2DWF4V7jSL5q+eKnLwlwCFlZHEDL7w= 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 1790934805960625.7403173982635; Fri, 2 Oct 2026 02:53:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCZwf-0003Nc-2i; Fri, 02 Oct 2026 05:52: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 1xCZwb-0003M9-Pg for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:52: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 1xCZwa-0000tJ-53 for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:52:45 -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-148-RVtzwr6XO_u9R9Xuu4I3Jw-1; Fri, 02 Oct 2026 05:52:42 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 584931955D62; Fri, 2 Oct 2026 09:52:41 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1D172180049F; Fri, 2 Oct 2026 09:52:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790934763; 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=Cs2cewHOZWzfG6h7klIN4A2WI1O+O6VBZh5Hk/by5LE=; b=C8dN4MoHgiodh74x/E5Zd9ld1nZjkTSdgqk0+jmoPp5vgC+xpmPic09HO6gEalMJryHupF Bkv94p/QK0cPKz29yNonncDvXn4Z2KAVgRffS1DShIpj4ZtUqbffWNc4fvTFduZIb3sVek w/WpxWrMO/zdfnRaEfz717IVzZNPoJ0= X-MC-Unique: RVtzwr6XO_u9R9Xuu4I3Jw-1 X-Mimecast-MFC-AGG-ID: RVtzwr6XO_u9R9Xuu4I3Jw_1790934761 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 03/20] trace: fix handling of char** in UST backend Date: Fri, 2 Oct 2026 10:52:15 +0100 Message-ID: <20261002095232.3605567-4-berrange@redhat.com> In-Reply-To: <20261002095232.3605567-1-berrange@redhat.com> References: <20261002095232.3605567-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 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: 1790934807687158500 The UST trace backend fails to compile on version 2.14.0, as we pass a "char **" arg as to ctf_string(), which only expects 'char *'. It should instead be treated the same way as generic pointers, and emitted as hex. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 --- scripts/tracetool/format/ust_events_h.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/tracetool/format/ust_events_h.py b/scripts/tracetool/f= ormat/ust_events_h.py index cee7970a403..76c883bc5c0 100644 --- a/scripts/tracetool/format/ust_events_h.py +++ b/scripts/tracetool/format/ust_events_h.py @@ -72,7 +72,9 @@ def generate(events, backend, group): names =3D e.args.names() fmts =3D e.formats() for t,n,f in zip(types, names, fmts): - if ('char *' in t) or ('char*' in t): + if ('char **' in t) or ('char**' in t): + out(' ctf_integer_hex(' + t + ', ' + n + ', ' + = n + ')') + elif ('char *' in t) or ('char*' in t): out(' ctf_string(' + n + ', ' + n + ')') elif ("%p" in f) or ("x" in f) or ("PRIx" in f): out(' ctf_integer_hex('+ t + ', ' + n + ', ' + n= + ')') --=20 2.55.0 From nobody Sat Oct 24 00:32:21 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=1790934876; cv=none; d=zohomail.com; s=zohoarc; b=HiEmb3pk2XHf6/h8LEXwFNWbcQdrrzS950i/TqeoRPM5Z5CtHpcBgw+Mi3JNkgsxlrtAUPOBcfvw5CZ22KzBZyQyN8OuajrH8CdlhR4ZbCOsD3Tx/J23ue96ktqhdwRK4quyvJbhOl1JGPvFIpr8R2qXWSYggNYux9yxPAXTsVw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790934876; 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=Vyu3AFg/uvFZq9zBba9+zCX/AMwxMobcoxANLVof+PQ=; b=glcluu1uaGeuj7J1S54UvBm45zozb6tAXPi6bK2I64zqGT5ugzi0bALGcL6wCT+g6XTgCW5Rp+H9UBAbnRCrYKwucMKkb4IDeujH31U05YN8WOblLoqKcHhGf4YT3kk8R5AfmjAu4WH/zzCl0sGb3Efn6LFvFtGAf3kv9KKV5zo= 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 1790934876118904.796178127404; Fri, 2 Oct 2026 02:54:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCZwf-0003O6-Fz; Fri, 02 Oct 2026 05:52: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 1xCZwd-0003N1-IZ for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:52:47 -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 1xCZwb-0000td-RS for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:52:47 -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-680-r-9O6CBtNcu3Omd4h_quCg-1; Fri, 02 Oct 2026 05:52:43 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E5894180131B; Fri, 2 Oct 2026 09:52:42 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A854C1800348; Fri, 2 Oct 2026 09:52:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790934765; 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=Vyu3AFg/uvFZq9zBba9+zCX/AMwxMobcoxANLVof+PQ=; b=KwVOs5qmClm33H7HwpehaQtGsbAvJOyESFZLKz4rjCk3lYAGPfghlN+n+psMI4JHYGmxOz liH4a4YNvV52rLDSob9gZrv1BJ84l++m4z5XN4iqgWhaxDLZh88iWAavEwagB5yLiARMkv 2MDt6Tt4SxeFFBceF/zQYdkQUQmhGT4= X-MC-Unique: r-9O6CBtNcu3Omd4h_quCg-1 X-Mimecast-MFC-AGG-ID: r-9O6CBtNcu3Omd4h_quCg_1790934763 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 04/20] hw/xen: replace "long unsigned int" with "unsigned long " for dtrace Date: Fri, 2 Oct 2026 10:52:16 +0100 Message-ID: <20261002095232.3605567-5-berrange@redhat.com> In-Reply-To: <20261002095232.3605567-1-berrange@redhat.com> References: <20261002095232.3605567-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -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: 1790934877962158500 dtrace (or at least systemtap's fake "dtrace" binary) doesn't like to see "int" and "long" together in the typename, it just wants the bare "long". Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 --- hw/xen/trace-events | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xen/trace-events b/hw/xen/trace-events index b67942d07b4..a31983ce1d3 100644 --- a/hw/xen/trace-events +++ b/hw/xen/trace-events @@ -57,8 +57,8 @@ cpu_ioreq_config_read(void *req, uint32_t sbdf, uint32_t = reg, uint32_t size, uin cpu_ioreq_config_write(void *req, uint32_t sbdf, uint32_t reg, uint32_t si= ze, uint32_t data) "I/O=3D%p sbdf=3D0x%x reg=3D%u size=3D%u data=3D0x%x" cpu_get_ioreq_from_shared_memory_req_not_ready(int state, int data_is_ptr,= uint64_t addr, uint64_t data, uint32_t count, uint32_t size) "I/O request = not ready: 0x%x, ptr: 0x%x, port: 0x%"PRIx64", data: 0x%"PRIx64", count: %u= , size: %u" xen_main_loop_prepare_init_cpu(int id, void *cpu) "cpu_by_vcpu_id[%d]=3D%p" -xen_map_ioreq_server_shared_page(long unsigned int ioreq_pfn) "shared page= at pfn 0x%lx" -xen_map_ioreq_server_buffered_io_page(long unsigned int ioreq_pfn) "buffer= ed io page at pfn 0x%lx" +xen_map_ioreq_server_shared_page(unsigned long ioreq_pfn) "shared page at = pfn 0x%lx" +xen_map_ioreq_server_buffered_io_page(unsigned long ioreq_pfn) "buffered i= o page at pfn 0x%lx" xen_map_ioreq_server_buffered_io_evtchn(int bufioreq_evtchn) "buffered io = evtchn is 0x%x" destroy_hvm_domain_cannot_acquire_handle(void) "Cannot acquire xenctrl han= dle" destroy_hvm_domain_failed_action(const char *action, int sts, char *errno_= s) "xc_domain_shutdown failed to issue %s, sts %d, %s" --=20 2.55.0 From nobody Sat Oct 24 00:32:21 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=1790934873; cv=none; d=zohomail.com; s=zohoarc; b=Pqkb9gbd55fYrH07WwYZSvm6gI/xy4IZXoHKgibADYKFjSUulT8H5E8csXxI77y1fPmbUrR5Nvwk24UW6Lcd+KVKx6T28cV9H0NkFfEt0M6HADcanonWFJpgQ8DZpIFRZCbS0M3lDYizg81hPuDfMTGgI6f1sS6q6/MjvRkBrlg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790934873; 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=zxXtoYI40kRdSGMzW77Gumu9PA/Y46mILrQ76HQEs9Y=; b=W0nuydWs7eaVY8gWZPCx1+wYlSlpeN/KeHY27YAVcgLKAB+Jmir6e3xC5tff7S6uYo0TQxZh3q/CDVOlD/P6kwv6hLEE/L9tGUhCBwtQEBRn31pWz3wRzLS0ElbO4gRleZ/Rt4dpP9cGkVqPj2HOB53UqV+gcW/xPcZTBNM8lTw= 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 1790934873320149.7900208061502; Fri, 2 Oct 2026 02:54:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCZwg-0003OL-NY; Fri, 02 Oct 2026 05:52:50 -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 1xCZwf-0003Nd-2D for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:52:49 -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 1xCZwd-0000tt-MK for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:52: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-688--wXOMSy9OFuCEg9q-FHeYA-1; Fri, 02 Oct 2026 05:52:45 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B3D1E1865D8D; Fri, 2 Oct 2026 09:52:44 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 423A6180049F; Fri, 2 Oct 2026 09:52:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790934767; 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=zxXtoYI40kRdSGMzW77Gumu9PA/Y46mILrQ76HQEs9Y=; b=JdFhzidsE1BNBPeZUWH2vmHPzd7oLL24WR0Bf9aNB/T2i0xJviIAqknhY/hJrpwfW7hvIL iCC8sseSjGoISXTvYgfo6gNKrJ6BGhyyfyRLyuWYGnCw350e57ol7dudb7ar7ejDYSSrFa W5cjIw8IazX1alj7C4Dw2v1fqTLGroc= X-MC-Unique: -wXOMSy9OFuCEg9q-FHeYA-1 X-Mimecast-MFC-AGG-ID: -wXOMSy9OFuCEg9q-FHeYA_1790934764 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 05/20] trace: block use of "long int" for dtrace Date: Fri, 2 Oct 2026 10:52:17 +0100 Message-ID: <20261002095232.3605567-6-berrange@redhat.com> In-Reply-To: <20261002095232.3605567-1-berrange@redhat.com> References: <20261002095232.3605567-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -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: 1790934874149158500 dtrace (or at least systemtap's fake "dtrace" binary) complains about a syntax error due to use of "long int", as it wants a bare "long" type Enforce this when parsing the trace-events files. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 --- scripts/tracetool/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py index 61ba6f1ba8c..6ed7cdd6ce4 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -177,6 +177,11 @@ def out(*lines, **kwargs): =20 def validate_type(name): bits =3D name.split(" ") + + if "long" in bits and "int" in bits: + raise ValueError("Invalid use of 'int' typename in %s, " + "use 'long' alone" % name) + for bit in bits: bit =3D re.sub(r"\*", "", bit) if bit =3D=3D "": --=20 2.55.0 From nobody Sat Oct 24 00:32:21 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=1790934797; cv=none; d=zohomail.com; s=zohoarc; b=K0lBr+lctlENPScE016BmJrJz8OvZyg6jDqWGYv2teJHk/FvpLDzck6EUiJwyytm5ecOa4Se/sQPyDSNmwHf+PL/S258mErjAPL0vJUBb6nflgKvQcOrWLe56715Xp/qpRcl/eJr5b23Jo7QqEVretayCwYsEMRFqVv3mZPb/BM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790934797; 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=lAOh1/B1/tdEaQvr+uMoadWgWliSLwqcPrKUviE2qZE=; b=lkcJYjg/Mxj1bTJZkHFgwZzOt/1tmPT3YISx+JiMpA6v0eo2JalF2s3uey7YzT9ZfAtHMGh6QbFjCki64AVLYJfifrZUUfuGVJ5ikX/0EkZ3McHWrLc0L8DzHH12wj95Ieu33eR8d49rFKoKa2M9CGtC9uMIDJqjgCOAwzzl+ac= 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 1790934797279208.42672995517057; Fri, 2 Oct 2026 02:53:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCZwk-0003PW-Eg; Fri, 02 Oct 2026 05:52: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 1xCZwi-0003Oq-Gw for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:52:52 -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 1xCZwg-0000uD-6J for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:52:52 -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-371-UNDxrdwcOSad3H0MsqW4bw-1; Fri, 02 Oct 2026 05:52:47 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F3ED31802173; Fri, 2 Oct 2026 09:52:46 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 498DA1800348; Fri, 2 Oct 2026 09:52:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790934769; 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=lAOh1/B1/tdEaQvr+uMoadWgWliSLwqcPrKUviE2qZE=; b=gMgQTZwoMNFDzmIfLTdYTQC7hVjj1XmnBckQsduK9mG8XM789yxRS3u5IB+ssMLLqEoHoy s055P/rmqrZonNXNnlVkEds6FLmfUhaRhMvwClC56kR6n3vzzWBaFmYkzmLI9BKl+AWBO/ uK8Iw8ov/vJTmyvVzGx0XH84qWqz0ck= X-MC-Unique: UNDxrdwcOSad3H0MsqW4bw-1 X-Mimecast-MFC-AGG-ID: UNDxrdwcOSad3H0MsqW4bw_1790934767 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 06/20] trace: drop unused trace_event_set_state_dynamic_init() Date: Fri, 2 Oct 2026 10:52:18 +0100 Message-ID: <20261002095232.3605567-7-berrange@redhat.com> In-Reply-To: <20261002095232.3605567-1-berrange@redhat.com> References: <20261002095232.3605567-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -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: 1790934799575158500 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 Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 --- stubs/trace-control.c | 5 ----- trace/control-target.c | 21 --------------------- trace/event-internal.h | 2 -- 3 files changed, 28 deletions(-) diff --git a/stubs/trace-control.c b/stubs/trace-control.c index b428f34c878..3f196835db0 100644 --- a/stubs/trace-control.c +++ b/stubs/trace-control.c @@ -11,11 +11,6 @@ #include "trace/control.h" =20 =20 -void trace_event_set_state_dynamic_init(TraceEvent *ev, bool state) -{ - trace_event_set_state_dynamic(ev, state); -} - void trace_event_set_state_dynamic(TraceEvent *ev, bool state) { bool state_pre; diff --git a/trace/control-target.c b/trace/control-target.c index 57ceac21084..24d9b7abbde 100644 --- a/trace/control-target.c +++ b/trace/control-target.c @@ -10,27 +10,6 @@ #include "qemu/osdep.h" #include "trace/control.h" =20 - -void trace_event_set_state_dynamic_init(TraceEvent *ev, bool state) -{ - bool state_pre; - assert(trace_event_get_state_static(ev)); - /* - * We ignore the "vcpu" property here, since no vCPUs have been created - * yet. Then dstate can only be 1 or 0. - */ - state_pre =3D *ev->dstate; - if (state_pre !=3D state) { - if (state) { - trace_events_enabled_count++; - *ev->dstate =3D 1; - } else { - trace_events_enabled_count--; - *ev->dstate =3D 0; - } - } -} - void trace_event_set_state_dynamic(TraceEvent *ev, bool state) { assert(trace_event_get_state_static(ev)); diff --git a/trace/event-internal.h b/trace/event-internal.h index 0c24e01b521..1d57b0ff1b5 100644 --- a/trace/event-internal.h +++ b/trace/event-internal.h @@ -37,6 +37,4 @@ typedef struct TraceEvent { uint16_t *dstate; } TraceEvent; =20 -void trace_event_set_state_dynamic_init(TraceEvent *ev, bool state); - #endif /* TRACE__EVENT_INTERNAL_H */ --=20 2.55.0 From nobody Sat Oct 24 00:32:21 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=1790934785; cv=none; d=zohomail.com; s=zohoarc; b=JJ2WGfddJyofUs5N0puekzwgVrwFpQZV24K5huFyT1Hsw94zfDqCi4PQ+iuVPUNRPRmnaZOYsb4uKdneK8/6WM5TyL0j23gnFmTXpqDMni40GOUNKmfU4iAhbG+DWMAHXbhqIVCDvbPu5ZhivmIHb1SK9YZBzrj4ELYTPIpWc6g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790934785; 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=vYK8uyoSgHR5oFrvRW3UePwVftb7R2+FEmXyIxd1LQ4=; b=gFWIYtQGppjZEEMMfZt8xAPQjF60v53PeIWRm3Jk5wfB7ruLQa6NrUUT5udNo7IXj+Nc4oNm0PV9R7UAqQGKNH6ZO8EROp0Uz6lRvdz2uB0yl42tY1hSd7Zrt77mJMOgYahMsWxo8XNbsSiyDyeuVLafoGixAL393svYIQPgpyk= 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 1790934785467110.75531820184847; Fri, 2 Oct 2026 02:53:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCZwl-0003Pm-5Y; Fri, 02 Oct 2026 05:52:55 -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 1xCZwi-0003Oy-Up for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:52: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 1xCZwh-0000uJ-8u for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:52:52 -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-31-tqMP6WWWPxWByzclegA7gQ-1; Fri, 02 Oct 2026 05:52:49 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8B72A1955BD9; Fri, 2 Oct 2026 09:52:48 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 50B381800348; Fri, 2 Oct 2026 09:52:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790934770; 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=vYK8uyoSgHR5oFrvRW3UePwVftb7R2+FEmXyIxd1LQ4=; b=R/avJFGSCmKbL0dwAaFVJTXWm6W9QTT4Nngb5zGQxaIoGcxfmVVEpKMVRDjTY79Hgvyjyq WewJ8p0lgLI2BaFmfdsbhmnsaEEzSAm46KWlV2nqsYxvFuQVmqsyrDkEUaTFpbbfMVv5i6 sN0kza7sV0R7bOz9x2p0L3ovQE2UIv4= X-MC-Unique: tqMP6WWWPxWByzclegA7gQ-1 X-Mimecast-MFC-AGG-ID: tqMP6WWWPxWByzclegA7gQ_1790934768 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 07/20] trace: remove obsolete references to vcpu property Date: Fri, 2 Oct 2026 10:52:19 +0100 Message-ID: <20261002095232.3605567-8-berrange@redhat.com> In-Reply-To: <20261002095232.3605567-1-berrange@redhat.com> References: <20261002095232.3605567-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 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: 1790934787528158500 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) Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 --- trace/control-target.c | 6 ------ trace/control.c | 6 ------ trace/control.h | 12 ------------ trace/event-internal.h | 11 ----------- 4 files changed, 35 deletions(-) diff --git a/trace/control-target.c b/trace/control-target.c index 24d9b7abbde..87b0f5037df 100644 --- a/trace/control-target.c +++ b/trace/control-target.c @@ -14,12 +14,6 @@ void trace_event_set_state_dynamic(TraceEvent *ev, bool = state) { assert(trace_event_get_state_static(ev)); =20 - /* - * There is no longer a "vcpu" property, dstate can only be 1 or - * 0. With it, we haven't instantiated any vCPU yet, so we will - * set a global state instead, and trace_init_vcpu will reconcile - * it afterwards. - */ bool state_pre =3D *ev->dstate; if (state_pre !=3D state) { if (state) { diff --git a/trace/control.c b/trace/control.c index 49f0a4c5cda..6971157cbe7 100644 --- a/trace/control.c +++ b/trace/control.c @@ -37,7 +37,6 @@ typedef struct TraceEventGroup { static TraceEventGroup *event_groups; static size_t nevent_groups; static uint32_t next_id; -static uint32_t next_vcpu_id; #ifdef CONFIG_TRACE_SIMPLE static bool init_trace_on_startup; #endif @@ -304,8 +303,3 @@ void trace_opt_parse(const char *optstr) trace_opts_file =3D g_strdup(qemu_opt_get(opts, "file")); qemu_opts_del(opts); } - -uint32_t trace_get_vcpu_event_count(void) -{ - return next_vcpu_id; -} diff --git a/trace/control.h b/trace/control.h index 6754bfe052b..20033fb6669 100644 --- a/trace/control.h +++ b/trace/control.h @@ -139,8 +139,6 @@ static bool trace_event_get_state_static(TraceEvent *ev= ); * trace_event_get_state_dynamic: * * Get the dynamic tracing state of an event. - * - * If the event has the 'vcpu' property, gets the OR'ed state of all vCPUs. */ static bool trace_event_get_state_dynamic(TraceEvent *ev); =20 @@ -149,8 +147,6 @@ static bool trace_event_get_state_dynamic(TraceEvent *e= v); * * Set the dynamic tracing state of an event. * - * If the event has the 'vcpu' property, sets the state on all vCPUs. - * * Pre-condition: trace_event_get_state_static(ev) =3D=3D true */ void trace_event_set_state_dynamic(TraceEvent *ev, bool state); @@ -203,14 +199,6 @@ extern QemuOptsList qemu_trace_opts; */ void trace_opt_parse(const char *optstr); =20 -/** - * trace_get_vcpu_event_count: - * - * Return the number of known vcpu-specific events - */ -uint32_t trace_get_vcpu_event_count(void); - - #include "control-internal.h" =20 #endif /* TRACE__CONTROL_H */ diff --git a/trace/event-internal.h b/trace/event-internal.h index 1d57b0ff1b5..cc095a6ad54 100644 --- a/trace/event-internal.h +++ b/trace/event-internal.h @@ -10,12 +10,6 @@ #ifndef TRACE__EVENT_INTERNAL_H #define TRACE__EVENT_INTERNAL_H =20 -/* - * Special value for TraceEvent.vcpu_id field to indicate - * that the event is not VCPU specific - */ -#define TRACE_VCPU_EVENT_NONE ((uint32_t)-1) - /** * TraceEvent: * @id: Unique event identifier. @@ -23,11 +17,6 @@ * @sstate: Static tracing state. * @dstate: Dynamic tracing state * - * Interpretation of @dstate depends on whether the event has the 'vcpu' - * property: - * - false: Boolean value indicating whether the event is active. - * - true : Integral counting the number of vCPUs that have this event ena= bled. - * * Opaque generic description of a tracing event. */ typedef struct TraceEvent { --=20 2.55.0 From nobody Sat Oct 24 00:32:21 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=1790934875; cv=none; d=zohomail.com; s=zohoarc; b=iEg23jDd/kcTTnjUIZGOgfweBrI0VpPEwy/mBwTB56HFaDfRZmfgTbOWNZqqnzENgvRmvOeSzy8LBCZmiO/pSx5ahEqgnHUmZs6STNaJHqra8dvjhoeNUuXCEdSlg3AZg4WIdKDx41LkralHYqlI5oofwy57tKJJRZoDA3yrvik= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790934875; 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=pUAN0iigguxmiyESqlZIKTQGLBoKjRijLiWC4VMtCJQ=; b=F0jrkrZpU58AlFgUzdI3smtnISNJfrF9OSa2LvFV8BY9IAyIs6bUduz1y31LHVnvo0TVlPTahVixwlXyu2VNwZ5q8zIP3+5SD9oTmH2f+4n+S9XCeBzUTM9cPbw/SfG3eS5pYFzLAIvGWTcMmWUHNAl+DjqG3Cvb9PJJ3Zp605M= 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 1790934875127680.803804788517; Fri, 2 Oct 2026 02:54:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCZwo-0003QJ-KY; Fri, 02 Oct 2026 05:52:58 -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 1xCZwm-0003Q5-Ns for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:52:56 -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 1xCZwk-0000uh-Vu for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:52:56 -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-136-N1qbicVNNj2oL2Xf2pBzxw-1; Fri, 02 Oct 2026 05:52:51 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 24334180AEFB; Fri, 2 Oct 2026 09:52:50 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DC42C180049F; Fri, 2 Oct 2026 09:52:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790934774; 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=pUAN0iigguxmiyESqlZIKTQGLBoKjRijLiWC4VMtCJQ=; b=hzqjdS0RQ5RVhMea6dfK7fYL2LSQ6wGK4gCU2PMTf/sNvwWqAMEdbOd0ha09ZSmCA/h7ZB ZnbyA6oI3+fp8J8S9Kb2oZWnhmQiTWHcK0RqD4k+OynrhuaR76D85xTYOO2T2eqy1q8L+H K3cp6EDTc4vT1rHk+yKul8W9YYY70Jk= X-MC-Unique: N1qbicVNNj2oL2Xf2pBzxw-1 X-Mimecast-MFC-AGG-ID: N1qbicVNNj2oL2Xf2pBzxw_1790934770 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 08/20] trace: drop 'id' from TraceEvent struct when not required Date: Fri, 2 Oct 2026 10:52:20 +0100 Message-ID: <20261002095232.3605567-9-berrange@redhat.com> In-Reply-To: <20261002095232.3605567-1-berrange@redhat.com> References: <20261002095232.3605567-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -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: 1790934876005158500 Only "simpletrace" uses the "id" field from the TraceEvent struct. Omit it when this backend is not enabled to save memory. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 --- scripts/tracetool/format/c.py | 2 ++ tests/tracetool/dtrace.c | 4 ++++ tests/tracetool/ftrace.c | 4 ++++ tests/tracetool/log.c | 4 ++++ tests/tracetool/simple.c | 4 ++++ tests/tracetool/syslog.c | 4 ++++ tests/tracetool/ust.c | 4 ++++ trace/control-internal.h | 2 ++ trace/control.c | 4 +++- trace/control.h | 3 ++- trace/event-internal.h | 2 ++ 11 files changed, 35 insertions(+), 2 deletions(-) diff --git a/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py index 50e03313cbf..abe738ac423 100644 --- a/scripts/tracetool/format/c.py +++ b/scripts/tracetool/format/c.py @@ -34,7 +34,9 @@ def generate(events, backend, group): =20 for e in events: out('TraceEvent %(event)s =3D {', + '#ifdef CONFIG_TRACE_SIMPLE', ' .id =3D 0,', + '#endif', ' .name =3D \"%(name)s\",', ' .sstate =3D %(sstate)s,', ' .dstate =3D &%(dstate)s', diff --git a/tests/tracetool/dtrace.c b/tests/tracetool/dtrace.c index 9f862fa14d2..05a93918240 100644 --- a/tests/tracetool/dtrace.c +++ b/tests/tracetool/dtrace.c @@ -8,13 +8,17 @@ uint16_t _TRACE_TEST_BLAH_DSTATE; uint16_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_blah", .sstate =3D TRACE_TEST_BLAH_ENABLED, .dstate =3D &_TRACE_TEST_BLAH_DSTATE }; TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_wibble", .sstate =3D TRACE_TEST_WIBBLE_ENABLED, .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE diff --git a/tests/tracetool/ftrace.c b/tests/tracetool/ftrace.c index 9f862fa14d2..05a93918240 100644 --- a/tests/tracetool/ftrace.c +++ b/tests/tracetool/ftrace.c @@ -8,13 +8,17 @@ uint16_t _TRACE_TEST_BLAH_DSTATE; uint16_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_blah", .sstate =3D TRACE_TEST_BLAH_ENABLED, .dstate =3D &_TRACE_TEST_BLAH_DSTATE }; TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_wibble", .sstate =3D TRACE_TEST_WIBBLE_ENABLED, .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE diff --git a/tests/tracetool/log.c b/tests/tracetool/log.c index 9f862fa14d2..05a93918240 100644 --- a/tests/tracetool/log.c +++ b/tests/tracetool/log.c @@ -8,13 +8,17 @@ uint16_t _TRACE_TEST_BLAH_DSTATE; uint16_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_blah", .sstate =3D TRACE_TEST_BLAH_ENABLED, .dstate =3D &_TRACE_TEST_BLAH_DSTATE }; TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_wibble", .sstate =3D TRACE_TEST_WIBBLE_ENABLED, .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE diff --git a/tests/tracetool/simple.c b/tests/tracetool/simple.c index 0484177481c..490d6f379a5 100644 --- a/tests/tracetool/simple.c +++ b/tests/tracetool/simple.c @@ -8,13 +8,17 @@ uint16_t _TRACE_TEST_BLAH_DSTATE; uint16_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_blah", .sstate =3D TRACE_TEST_BLAH_ENABLED, .dstate =3D &_TRACE_TEST_BLAH_DSTATE }; TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_wibble", .sstate =3D TRACE_TEST_WIBBLE_ENABLED, .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE diff --git a/tests/tracetool/syslog.c b/tests/tracetool/syslog.c index 9f862fa14d2..05a93918240 100644 --- a/tests/tracetool/syslog.c +++ b/tests/tracetool/syslog.c @@ -8,13 +8,17 @@ uint16_t _TRACE_TEST_BLAH_DSTATE; uint16_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_blah", .sstate =3D TRACE_TEST_BLAH_ENABLED, .dstate =3D &_TRACE_TEST_BLAH_DSTATE }; TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_wibble", .sstate =3D TRACE_TEST_WIBBLE_ENABLED, .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE diff --git a/tests/tracetool/ust.c b/tests/tracetool/ust.c index 9f862fa14d2..05a93918240 100644 --- a/tests/tracetool/ust.c +++ b/tests/tracetool/ust.c @@ -8,13 +8,17 @@ uint16_t _TRACE_TEST_BLAH_DSTATE; uint16_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_blah", .sstate =3D TRACE_TEST_BLAH_ENABLED, .dstate =3D &_TRACE_TEST_BLAH_DSTATE }; TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE .id =3D 0, +#endif .name =3D "test_wibble", .sstate =3D TRACE_TEST_WIBBLE_ENABLED, .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE diff --git a/trace/control-internal.h b/trace/control-internal.h index 8d818d359be..f626b047264 100644 --- a/trace/control-internal.h +++ b/trace/control-internal.h @@ -19,11 +19,13 @@ static inline bool trace_event_is_pattern(const char *s= tr) return strchr(str, '*') !=3D NULL; } =20 +#ifdef CONFIG_TRACE_SIMPLE static inline uint32_t trace_event_get_id(TraceEvent *ev) { assert(ev !=3D NULL); return ev->id; } +#endif =20 static inline const char * trace_event_get_name(TraceEvent *ev) { diff --git a/trace/control.c b/trace/control.c index 6971157cbe7..947b220056a 100644 --- a/trace/control.c +++ b/trace/control.c @@ -36,8 +36,8 @@ typedef struct TraceEventGroup { =20 static TraceEventGroup *event_groups; static size_t nevent_groups; -static uint32_t next_id; #ifdef CONFIG_TRACE_SIMPLE +static uint32_t next_id; static bool init_trace_on_startup; #endif static char *trace_opts_file; @@ -65,10 +65,12 @@ QemuOptsList qemu_trace_opts =3D { =20 void trace_event_register_group(TraceEvent **events) { +#ifdef CONFIG_TRACE_SIMPLE size_t i; for (i =3D 0; events[i] !=3D NULL; i++) { events[i]->id =3D next_id++; } +#endif event_groups =3D g_renew(TraceEventGroup, event_groups, nevent_groups = + 1); event_groups[nevent_groups].events =3D events; nevent_groups++; diff --git a/trace/control.h b/trace/control.h index 20033fb6669..e77c07a8e68 100644 --- a/trace/control.h +++ b/trace/control.h @@ -81,13 +81,14 @@ TraceEvent *trace_event_name(const char *name); */ static bool trace_event_is_pattern(const char *str); =20 - +#ifdef CONFIG_TRACE_SIMPLE /** * trace_event_get_id: * * Get the identifier of an event. */ static uint32_t trace_event_get_id(TraceEvent *ev); +#endif =20 /** * trace_event_get_name: diff --git a/trace/event-internal.h b/trace/event-internal.h index cc095a6ad54..ecf2caabd03 100644 --- a/trace/event-internal.h +++ b/trace/event-internal.h @@ -20,7 +20,9 @@ * Opaque generic description of a tracing event. */ typedef struct TraceEvent { +#ifdef CONFIG_TRACE_SIMPLE uint32_t id; +#endif const char * name; const bool sstate; uint16_t *dstate; --=20 2.55.0 From nobody Sat Oct 24 00:32:21 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=1790934850; cv=none; d=zohomail.com; s=zohoarc; b=VwUiDlTKWvkOp8bl1MnL09MCmRJ7rMUbH/xGoM5kKiMX2JuNTUqKon6Dp3i9ail+3oZHVEwLjL0GaiZybmmHqgyH9SIw13WUkSQrxxPI+Df7JulcQ692T8J33J47gZwH3EvG3yNrLoIxlkE+CO6eTkI9mttF61HZvd8GtDiKBA8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790934850; 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=zmYel1/eflsvRYajw35HaaQe4jA/LTj2KXwNJyiHD1s=; b=hbGdnCVyM8mBdx2ohZtWgU3IjIfeA8/4Khg0ysAeuxEFp9pKfM7VafBo4jYgD4/cR0E35JR5qSXB1AadmKTIswu9jB00vZA1vTwHK3tE5zIk8iUY73NPWK+eRLnL0eukBbjRN1enDSdjhVdJXN1vp4lFRpxrnEVrkPtAXGo1Uhw= 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 17909348509730.10661607406234452; Fri, 2 Oct 2026 02:54:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCZwq-0003UU-VK; Fri, 02 Oct 2026 05:53:00 -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 1xCZwp-0003Qc-Mr for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:52:59 -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 1xCZwn-0000ur-C9 for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:52:59 -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-547-NQShappYNQGyl5KfLrVSMg-1; Fri, 02 Oct 2026 05:52:53 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6EFCE1955F3C; Fri, 2 Oct 2026 09:52:52 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8C9541800348; Fri, 2 Oct 2026 09:52:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790934776; 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=zmYel1/eflsvRYajw35HaaQe4jA/LTj2KXwNJyiHD1s=; b=X9Vi7uSemcHUY1rJ+EgALHtA9yiyQosi1jEJzCKpxiO3gsKPNQXPKVO+VVBiMGhqLfLnlk 2lF0aUUD0GLgA3Fhii4uhZiPp6hJ1Hbl123etM9NlXHsSW3dcBvMqXLIrWf4Itg11mEQFT kLv9slnUGFf3zXsWtmv/lKzdvRGGFUo= X-MC-Unique: NQShappYNQGyl5KfLrVSMg-1 X-Mimecast-MFC-AGG-ID: NQShappYNQGyl5KfLrVSMg_1790934772 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 09/20] trace: change "DSTATE" variables from uint16_t to uint8_t Date: Fri, 2 Oct 2026 10:52:21 +0100 Message-ID: <20261002095232.3605567-10-berrange@redhat.com> In-Reply-To: <20261002095232.3605567-1-berrange@redhat.com> References: <20261002095232.3605567-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 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: 1790934852089158500 Previously these variables had two distinct semantics. For most probes DSTATE was treated as a simple boolean, while for vcpu probes it was treated as a bitmask of vCPU indexes. With vcpu probes removed, it is now exclusively a boolean and thus using uint16_t is a waste of memory. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 --- scripts/tracetool/format/c.py | 2 +- scripts/tracetool/format/h.py | 2 +- scripts/tracetool/format/rs.py | 4 ++-- tests/tracetool/dtrace.c | 4 ++-- tests/tracetool/dtrace.h | 4 ++-- tests/tracetool/dtrace.rs | 6 +++--- tests/tracetool/ftrace.c | 4 ++-- tests/tracetool/ftrace.h | 4 ++-- tests/tracetool/ftrace.rs | 6 +++--- tests/tracetool/log.c | 4 ++-- tests/tracetool/log.h | 4 ++-- tests/tracetool/log.rs | 6 +++--- tests/tracetool/simple.c | 4 ++-- tests/tracetool/simple.h | 4 ++-- tests/tracetool/simple.rs | 6 +++--- tests/tracetool/syslog.c | 4 ++-- tests/tracetool/syslog.h | 4 ++-- tests/tracetool/syslog.rs | 6 +++--- tests/tracetool/ust.c | 4 ++-- tests/tracetool/ust.h | 4 ++-- trace/event-internal.h | 2 +- 21 files changed, 44 insertions(+), 44 deletions(-) diff --git a/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py index abe738ac423..de1c154a881 100644 --- a/scripts/tracetool/format/c.py +++ b/scripts/tracetool/format/c.py @@ -30,7 +30,7 @@ def generate(events, backend, group): '') =20 for e in events: - out('uint16_t %s;' % e.api(e.QEMU_DSTATE)) + out('uint8_t %s;' % e.api(e.QEMU_DSTATE)) =20 for e in events: out('TraceEvent %(event)s =3D {', diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index dd58713a158..4dc1ad7eb15 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -32,7 +32,7 @@ def generate(events, backend, group): event =3D e.api(e.QEMU_EVENT)) =20 for e in events: - out('extern uint16_t %s;' % e.api(e.QEMU_DSTATE)) + out('extern uint8_t %s;' % e.api(e.QEMU_DSTATE)) =20 # static state for e in events: diff --git a/scripts/tracetool/format/rs.py b/scripts/tracetool/format/rs.py index 7d9af7edfee..1fddcee1ad2 100644 --- a/scripts/tracetool/format/rs.py +++ b/scripts/tracetool/format/rs.py @@ -26,7 +26,7 @@ def generate(events, backend, group): '', '#[allow(dead_code)]', '#[inline(always)]', - 'fn trace_event_state_is_enabled(dstate: u16) -> bool {', + 'fn trace_event_state_is_enabled(dstate: u8) -> bool {', ' (unsafe { trace_events_enabled_count }) !=3D 0 && dstate !=3D= 0', '}', '', @@ -39,7 +39,7 @@ def generate(events, backend, group): =20 for e in events: out(' #[allow(dead_code)]', - ' static mut %s: u16;' % e.api(e.QEMU_DSTATE)) + ' static mut %s: u8;' % e.api(e.QEMU_DSTATE)) out('}', '') =20 diff --git a/tests/tracetool/dtrace.c b/tests/tracetool/dtrace.c index 05a93918240..f83d06252ea 100644 --- a/tests/tracetool/dtrace.c +++ b/tests/tracetool/dtrace.c @@ -5,8 +5,8 @@ #include "qemu/module.h" #include "trace-testsuite.h" =20 -uint16_t _TRACE_TEST_BLAH_DSTATE; -uint16_t _TRACE_TEST_WIBBLE_DSTATE; +uint8_t _TRACE_TEST_BLAH_DSTATE; +uint8_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { #ifdef CONFIG_TRACE_SIMPLE .id =3D 0, diff --git a/tests/tracetool/dtrace.h b/tests/tracetool/dtrace.h index c8931a8d7b3..0b5b47089e8 100644 --- a/tests/tracetool/dtrace.h +++ b/tests/tracetool/dtrace.h @@ -8,8 +8,8 @@ =20 extern TraceEvent _TRACE_TEST_BLAH_EVENT; extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; -extern uint16_t _TRACE_TEST_BLAH_DSTATE; -extern uint16_t _TRACE_TEST_WIBBLE_DSTATE; +extern uint8_t _TRACE_TEST_BLAH_DSTATE; +extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; #define TRACE_TEST_BLAH_ENABLED 1 #define TRACE_TEST_WIBBLE_ENABLED 1 #ifndef SDT_USE_VARIADIC diff --git a/tests/tracetool/dtrace.rs b/tests/tracetool/dtrace.rs index 3490fcb271a..07398f4731b 100644 --- a/tests/tracetool/dtrace.rs +++ b/tests/tracetool/dtrace.rs @@ -8,7 +8,7 @@ =20 #[allow(dead_code)] #[inline(always)] -fn trace_event_state_is_enabled(dstate: u16) -> bool { +fn trace_event_state_is_enabled(dstate: u8) -> bool { (unsafe { trace_events_enabled_count }) !=3D 0 && dstate !=3D 0 } =20 @@ -18,9 +18,9 @@ fn trace_event_state_is_enabled(dstate: u16) -> bool { } extern "C" { #[allow(dead_code)] - static mut _TRACE_TEST_BLAH_DSTATE: u16; + static mut _TRACE_TEST_BLAH_DSTATE: u8; #[allow(dead_code)] - static mut _TRACE_TEST_WIBBLE_DSTATE: u16; + static mut _TRACE_TEST_WIBBLE_DSTATE: u8; } =20 use std::cell::UnsafeCell; diff --git a/tests/tracetool/ftrace.c b/tests/tracetool/ftrace.c index 05a93918240..f83d06252ea 100644 --- a/tests/tracetool/ftrace.c +++ b/tests/tracetool/ftrace.c @@ -5,8 +5,8 @@ #include "qemu/module.h" #include "trace-testsuite.h" =20 -uint16_t _TRACE_TEST_BLAH_DSTATE; -uint16_t _TRACE_TEST_WIBBLE_DSTATE; +uint8_t _TRACE_TEST_BLAH_DSTATE; +uint8_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { #ifdef CONFIG_TRACE_SIMPLE .id =3D 0, diff --git a/tests/tracetool/ftrace.h b/tests/tracetool/ftrace.h index 1dfe4239413..b34eef17d10 100644 --- a/tests/tracetool/ftrace.h +++ b/tests/tracetool/ftrace.h @@ -8,8 +8,8 @@ =20 extern TraceEvent _TRACE_TEST_BLAH_EVENT; extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; -extern uint16_t _TRACE_TEST_BLAH_DSTATE; -extern uint16_t _TRACE_TEST_WIBBLE_DSTATE; +extern uint8_t _TRACE_TEST_BLAH_DSTATE; +extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; #define TRACE_TEST_BLAH_ENABLED 1 #define TRACE_TEST_WIBBLE_ENABLED 1 #include "trace/ftrace.h" diff --git a/tests/tracetool/ftrace.rs b/tests/tracetool/ftrace.rs index 34f66004902..ff0bcde4b8b 100644 --- a/tests/tracetool/ftrace.rs +++ b/tests/tracetool/ftrace.rs @@ -8,7 +8,7 @@ =20 #[allow(dead_code)] #[inline(always)] -fn trace_event_state_is_enabled(dstate: u16) -> bool { +fn trace_event_state_is_enabled(dstate: u8) -> bool { (unsafe { trace_events_enabled_count }) !=3D 0 && dstate !=3D 0 } =20 @@ -18,9 +18,9 @@ fn trace_event_state_is_enabled(dstate: u16) -> bool { } extern "C" { #[allow(dead_code)] - static mut _TRACE_TEST_BLAH_DSTATE: u16; + static mut _TRACE_TEST_BLAH_DSTATE: u8; #[allow(dead_code)] - static mut _TRACE_TEST_WIBBLE_DSTATE: u16; + static mut _TRACE_TEST_WIBBLE_DSTATE: u8; } =20 #[inline(always)] diff --git a/tests/tracetool/log.c b/tests/tracetool/log.c index 05a93918240..f83d06252ea 100644 --- a/tests/tracetool/log.c +++ b/tests/tracetool/log.c @@ -5,8 +5,8 @@ #include "qemu/module.h" #include "trace-testsuite.h" =20 -uint16_t _TRACE_TEST_BLAH_DSTATE; -uint16_t _TRACE_TEST_WIBBLE_DSTATE; +uint8_t _TRACE_TEST_BLAH_DSTATE; +uint8_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { #ifdef CONFIG_TRACE_SIMPLE .id =3D 0, diff --git a/tests/tracetool/log.h b/tests/tracetool/log.h index c7795871f85..ff510d54908 100644 --- a/tests/tracetool/log.h +++ b/tests/tracetool/log.h @@ -8,8 +8,8 @@ =20 extern TraceEvent _TRACE_TEST_BLAH_EVENT; extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; -extern uint16_t _TRACE_TEST_BLAH_DSTATE; -extern uint16_t _TRACE_TEST_WIBBLE_DSTATE; +extern uint8_t _TRACE_TEST_BLAH_DSTATE; +extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; #define TRACE_TEST_BLAH_ENABLED 1 #define TRACE_TEST_WIBBLE_ENABLED 1 #include "qemu/log-for-trace.h" diff --git a/tests/tracetool/log.rs b/tests/tracetool/log.rs index 770758611d1..0f052bb2c9c 100644 --- a/tests/tracetool/log.rs +++ b/tests/tracetool/log.rs @@ -8,7 +8,7 @@ =20 #[allow(dead_code)] #[inline(always)] -fn trace_event_state_is_enabled(dstate: u16) -> bool { +fn trace_event_state_is_enabled(dstate: u8) -> bool { (unsafe { trace_events_enabled_count }) !=3D 0 && dstate !=3D 0 } =20 @@ -18,9 +18,9 @@ fn trace_event_state_is_enabled(dstate: u16) -> bool { } extern "C" { #[allow(dead_code)] - static mut _TRACE_TEST_BLAH_DSTATE: u16; + static mut _TRACE_TEST_BLAH_DSTATE: u8; #[allow(dead_code)] - static mut _TRACE_TEST_WIBBLE_DSTATE: u16; + static mut _TRACE_TEST_WIBBLE_DSTATE: u8; } =20 #[inline(always)] diff --git a/tests/tracetool/simple.c b/tests/tracetool/simple.c index 490d6f379a5..820ddb575b0 100644 --- a/tests/tracetool/simple.c +++ b/tests/tracetool/simple.c @@ -5,8 +5,8 @@ #include "qemu/module.h" #include "trace-testsuite.h" =20 -uint16_t _TRACE_TEST_BLAH_DSTATE; -uint16_t _TRACE_TEST_WIBBLE_DSTATE; +uint8_t _TRACE_TEST_BLAH_DSTATE; +uint8_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { #ifdef CONFIG_TRACE_SIMPLE .id =3D 0, diff --git a/tests/tracetool/simple.h b/tests/tracetool/simple.h index ec6fcb22c3c..735cb21d911 100644 --- a/tests/tracetool/simple.h +++ b/tests/tracetool/simple.h @@ -8,8 +8,8 @@ =20 extern TraceEvent _TRACE_TEST_BLAH_EVENT; extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; -extern uint16_t _TRACE_TEST_BLAH_DSTATE; -extern uint16_t _TRACE_TEST_WIBBLE_DSTATE; +extern uint8_t _TRACE_TEST_BLAH_DSTATE; +extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; #define TRACE_TEST_BLAH_ENABLED 1 #define TRACE_TEST_WIBBLE_ENABLED 1 void _simple_trace_test_blah(void *context, const char *filename); diff --git a/tests/tracetool/simple.rs b/tests/tracetool/simple.rs index 92f896ef178..976feddde5b 100644 --- a/tests/tracetool/simple.rs +++ b/tests/tracetool/simple.rs @@ -8,7 +8,7 @@ =20 #[allow(dead_code)] #[inline(always)] -fn trace_event_state_is_enabled(dstate: u16) -> bool { +fn trace_event_state_is_enabled(dstate: u8) -> bool { (unsafe { trace_events_enabled_count }) !=3D 0 && dstate !=3D 0 } =20 @@ -18,9 +18,9 @@ fn trace_event_state_is_enabled(dstate: u16) -> bool { } extern "C" { #[allow(dead_code)] - static mut _TRACE_TEST_BLAH_DSTATE: u16; + static mut _TRACE_TEST_BLAH_DSTATE: u8; #[allow(dead_code)] - static mut _TRACE_TEST_WIBBLE_DSTATE: u16; + static mut _TRACE_TEST_WIBBLE_DSTATE: u8; } =20 #[inline(always)] diff --git a/tests/tracetool/syslog.c b/tests/tracetool/syslog.c index 05a93918240..f83d06252ea 100644 --- a/tests/tracetool/syslog.c +++ b/tests/tracetool/syslog.c @@ -5,8 +5,8 @@ #include "qemu/module.h" #include "trace-testsuite.h" =20 -uint16_t _TRACE_TEST_BLAH_DSTATE; -uint16_t _TRACE_TEST_WIBBLE_DSTATE; +uint8_t _TRACE_TEST_BLAH_DSTATE; +uint8_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { #ifdef CONFIG_TRACE_SIMPLE .id =3D 0, diff --git a/tests/tracetool/syslog.h b/tests/tracetool/syslog.h index ed4305554c1..4203b8b37dc 100644 --- a/tests/tracetool/syslog.h +++ b/tests/tracetool/syslog.h @@ -8,8 +8,8 @@ =20 extern TraceEvent _TRACE_TEST_BLAH_EVENT; extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; -extern uint16_t _TRACE_TEST_BLAH_DSTATE; -extern uint16_t _TRACE_TEST_WIBBLE_DSTATE; +extern uint8_t _TRACE_TEST_BLAH_DSTATE; +extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; #define TRACE_TEST_BLAH_ENABLED 1 #define TRACE_TEST_WIBBLE_ENABLED 1 #include diff --git a/tests/tracetool/syslog.rs b/tests/tracetool/syslog.rs index 378d03d34b2..9688dac84a5 100644 --- a/tests/tracetool/syslog.rs +++ b/tests/tracetool/syslog.rs @@ -8,7 +8,7 @@ =20 #[allow(dead_code)] #[inline(always)] -fn trace_event_state_is_enabled(dstate: u16) -> bool { +fn trace_event_state_is_enabled(dstate: u8) -> bool { (unsafe { trace_events_enabled_count }) !=3D 0 && dstate !=3D 0 } =20 @@ -18,9 +18,9 @@ fn trace_event_state_is_enabled(dstate: u16) -> bool { } extern "C" { #[allow(dead_code)] - static mut _TRACE_TEST_BLAH_DSTATE: u16; + static mut _TRACE_TEST_BLAH_DSTATE: u8; #[allow(dead_code)] - static mut _TRACE_TEST_WIBBLE_DSTATE: u16; + static mut _TRACE_TEST_WIBBLE_DSTATE: u8; } =20 #[inline(always)] diff --git a/tests/tracetool/ust.c b/tests/tracetool/ust.c index 05a93918240..f83d06252ea 100644 --- a/tests/tracetool/ust.c +++ b/tests/tracetool/ust.c @@ -5,8 +5,8 @@ #include "qemu/module.h" #include "trace-testsuite.h" =20 -uint16_t _TRACE_TEST_BLAH_DSTATE; -uint16_t _TRACE_TEST_WIBBLE_DSTATE; +uint8_t _TRACE_TEST_BLAH_DSTATE; +uint8_t _TRACE_TEST_WIBBLE_DSTATE; TraceEvent _TRACE_TEST_BLAH_EVENT =3D { #ifdef CONFIG_TRACE_SIMPLE .id =3D 0, diff --git a/tests/tracetool/ust.h b/tests/tracetool/ust.h index b7acd0c39b1..079b2c74491 100644 --- a/tests/tracetool/ust.h +++ b/tests/tracetool/ust.h @@ -8,8 +8,8 @@ =20 extern TraceEvent _TRACE_TEST_BLAH_EVENT; extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; -extern uint16_t _TRACE_TEST_BLAH_DSTATE; -extern uint16_t _TRACE_TEST_WIBBLE_DSTATE; +extern uint8_t _TRACE_TEST_BLAH_DSTATE; +extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; #define TRACE_TEST_BLAH_ENABLED 1 #define TRACE_TEST_WIBBLE_ENABLED 1 #include diff --git a/trace/event-internal.h b/trace/event-internal.h index ecf2caabd03..ad1578aa2c5 100644 --- a/trace/event-internal.h +++ b/trace/event-internal.h @@ -25,7 +25,7 @@ typedef struct TraceEvent { #endif const char * name; const bool sstate; - uint16_t *dstate; + uint8_t *dstate; } TraceEvent; =20 #endif /* TRACE__EVENT_INTERNAL_H */ --=20 2.55.0 From nobody Sat Oct 24 00:32:21 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=1790934874; cv=none; d=zohomail.com; s=zohoarc; b=XNPpS8Ub+6lxQBJFrArn1jnysNxKay2PPJDlB36ybM3/gWybU3ucCANj5JABgStwVHnwO2chIQiJSwavTmG+YB8anLp8UpMW7YsN2cOimb7lgw0iZRDrE9YRmUz4f15rkeVi1JjSW1fqIYP4EAf0pnx4YknzG7Ww7hEdov6PBVw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790934874; 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=CRQXWrCYRaS3NChAlbFqukq9PzI6r/TPGsj/tz+JpZg=; b=MUnYSQsYrwORVfO2ng7ME6i8iOyXAMgsVAZ6ZLtV7XfOU6/i5ge7c5/fyjJ+V5EBv086eFgYmjfET5YpbCLiLCCtQg7ypgVeiynx7VWAeOIczb183Qc9LW/UW8v/8Kt5NKs8VOwm7XbcRRv4O7yo2Zx4PYsbzFYlv35iyalN0UY= 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 17909348741180.294145732643301; Fri, 2 Oct 2026 02:54:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCZwv-0003aD-VI; Fri, 02 Oct 2026 05:53: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 1xCZwr-0003UY-1E for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53: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 1xCZwp-0000uz-BX for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53:00 -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-126-f0qWDiDsONWWYkRcYyQqQA-1; Fri, 02 Oct 2026 05:52:55 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 32DAA19540C5; Fri, 2 Oct 2026 09:52:54 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C050A1800348; Fri, 2 Oct 2026 09:52:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790934778; 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=CRQXWrCYRaS3NChAlbFqukq9PzI6r/TPGsj/tz+JpZg=; b=arhnFlkB3Zu1tp15yhY75r40OUYi7lHG/FdpalIpeV1MGcr8z0qi6zg1yIGul8FN/ouDBi y2WEGcyCJFoij1Sj63oS1NVSniopDBii65WopPDQi26hDAXRjwuLvw9feXX+OaphuPR1hO 11Ibg8uCccJocc4KGSQ1rHAqgfUvxAs= X-MC-Unique: f0qWDiDsONWWYkRcYyQqQA-1 X-Mimecast-MFC-AGG-ID: f0qWDiDsONWWYkRcYyQqQA_1790934774 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 10/20] trace: add testing of 'nop' trace backend Date: Fri, 2 Oct 2026 10:52:22 +0100 Message-ID: <20261002095232.3605567-11-berrange@redhat.com> In-Reply-To: <20261002095232.3605567-1-berrange@redhat.com> References: <20261002095232.3605567-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 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: 1790934875982158500 This will be used to demonstrate that tracetool outputs the bare minimum of code when tracing is disabled. Currently, as of this initial commit of reference output, too much code is generated. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 --- tests/tracetool/meson.build | 1 + tests/tracetool/nop.c | 36 ++++++++++++++++++++++ tests/tracetool/nop.h | 29 ++++++++++++++++++ tests/tracetool/nop.rs | 51 +++++++++++++++++++++++++++++++ tests/tracetool/tracetool-test.py | 2 +- 5 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 tests/tracetool/nop.c create mode 100644 tests/tracetool/nop.h create mode 100644 tests/tracetool/nop.rs diff --git a/tests/tracetool/meson.build b/tests/tracetool/meson.build index 09bbaaa86bf..f4f583e6224 100644 --- a/tests/tracetool/meson.build +++ b/tests/tracetool/meson.build @@ -5,6 +5,7 @@ test_env.set('PYTHONPATH', meson.project_source_root() / 's= cripts') test_env.set('PYTHONIOENCODING', 'utf-8') =20 backends =3D [ + 'nop', 'dtrace', 'ftrace', 'log', diff --git a/tests/tracetool/nop.c b/tests/tracetool/nop.c new file mode 100644 index 00000000000..f83d06252ea --- /dev/null +++ b/tests/tracetool/nop.c @@ -0,0 +1,36 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "qemu/osdep.h" +#include "qemu/module.h" +#include "trace-testsuite.h" + +uint8_t _TRACE_TEST_BLAH_DSTATE; +uint8_t _TRACE_TEST_WIBBLE_DSTATE; +TraceEvent _TRACE_TEST_BLAH_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE + .id =3D 0, +#endif + .name =3D "test_blah", + .sstate =3D TRACE_TEST_BLAH_ENABLED, + .dstate =3D &_TRACE_TEST_BLAH_DSTATE +}; +TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE + .id =3D 0, +#endif + .name =3D "test_wibble", + .sstate =3D TRACE_TEST_WIBBLE_ENABLED, + .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE +}; +TraceEvent *testsuite_trace_events[] =3D { + &_TRACE_TEST_BLAH_EVENT, + &_TRACE_TEST_WIBBLE_EVENT, + NULL, +}; + +static void trace_testsuite_register_events(void) +{ + trace_event_register_group(testsuite_trace_events); +} +trace_init(trace_testsuite_register_events) diff --git a/tests/tracetool/nop.h b/tests/tracetool/nop.h new file mode 100644 index 00000000000..443f5e0cf6e --- /dev/null +++ b/tests/tracetool/nop.h @@ -0,0 +1,29 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef TRACE_TESTSUITE_GENERATED_TRACERS_H +#define TRACE_TESTSUITE_GENERATED_TRACERS_H + +#include "trace/control.h" + +extern TraceEvent _TRACE_TEST_BLAH_EVENT; +extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; +extern uint8_t _TRACE_TEST_BLAH_DSTATE; +extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; +#define TRACE_TEST_BLAH_ENABLED 1 +#define TRACE_TEST_WIBBLE_ENABLED 1 + +#define TRACE_TEST_BLAH_BACKEND_DSTATE() ( \ + false) + +static inline void trace_test_blah(void *context, const char *filename) +{ +} + +#define TRACE_TEST_WIBBLE_BACKEND_DSTATE() ( \ + false) + +static inline void trace_test_wibble(void *context, int value) +{ +} +#endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/tests/tracetool/nop.rs b/tests/tracetool/nop.rs new file mode 100644 index 00000000000..5f007cecd04 --- /dev/null +++ b/tests/tracetool/nop.rs @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +// This file is @generated by tracetool, do not edit. + +#[allow(unused_imports)] +use std::ffi::c_char; +#[allow(unused_imports)] +use util::bindings; + +#[allow(dead_code)] +#[inline(always)] +fn trace_event_state_is_enabled(dstate: u8) -> bool { + (unsafe { trace_events_enabled_count }) !=3D 0 && dstate !=3D 0 +} + +extern "C" { + #[allow(dead_code)] + static mut trace_events_enabled_count: u32; +} +extern "C" { + #[allow(dead_code)] + static mut _TRACE_TEST_BLAH_DSTATE: u8; + #[allow(dead_code)] + static mut _TRACE_TEST_WIBBLE_DSTATE: u8; +} + +#[inline(always)] +#[allow(dead_code)] +pub fn trace_test_blah_enabled() -> bool +{ + false +} + +#[inline(always)] +#[allow(dead_code)] +pub fn trace_test_blah(_context: *mut (), _filename: &std::ffi::CStr) +{ +} + +#[inline(always)] +#[allow(dead_code)] +pub fn trace_test_wibble_enabled() -> bool +{ + false +} + +#[inline(always)] +#[allow(dead_code)] +pub fn trace_test_wibble(_context: *mut (), _value: std::ffi::c_int) +{ +} + diff --git a/tests/tracetool/tracetool-test.py b/tests/tracetool/tracetool-= test.py index 59e9ab3d6ef..74f315a4629 100755 --- a/tests/tracetool/tracetool-test.py +++ b/tests/tracetool/tracetool-test.py @@ -14,7 +14,7 @@ def get_formats(backend): "c", "h", ] - if backend in {"dtrace", "ftrace", "log", "simple", "syslog"}: + if backend in {"nop", "dtrace", "ftrace", "log", "simple", "syslog"}: formats +=3D ["rs"] if backend =3D=3D "dtrace": formats +=3D [ --=20 2.55.0 From nobody Sat Oct 24 00:32:21 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=1790934867; cv=none; d=zohomail.com; s=zohoarc; b=VfOfLFQo/qZVmCmphIRv5ECOPF3ccIpZ8U5vavuAhnqs8ccoQz1JWI0Tqb9jgKRH90kdnKh7yIjxx6TW8zJquN87SzP2JOJLhBlbAnjHTeJiHiJstovLkTAuHB7gcG5DgKg/x7ujwewGGoK8DV1ofaG/UaH0K9Kuzi6PSb6Tqkw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790934867; 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=F/5vzHLAuY1lKntem60+2Z7FH4KI38ZA8YD2QRNc65A=; b=ElFvLGZlJD/3wNB3OZYY1AIto+UO/NRICCVEDY6MJODaikOYMmbGAvYZdKAJaig0BtBw0lwpw4cDb555gFSSxkXB4VkGVK5U/qVPPJHhpbASYdq/M7nMBQ/U/WYy8d8sHfY9GE/6+OZiKo7cMXseGztMNFQdAL4PfzDOPkSsbLs= 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 1790934867550417.81416861955574; Fri, 2 Oct 2026 02:54:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCZws-0003Vw-A6; Fri, 02 Oct 2026 05:53: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 1xCZwq-0003Sa-JF for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53:00 -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 1xCZwo-0000uv-Id for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53:00 -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-557-azEM0eZUPgadsVkQdddz6Q-1; Fri, 02 Oct 2026 05:52:56 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 92492193617F; Fri, 2 Oct 2026 09:52:55 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 57A121800348; Fri, 2 Oct 2026 09:52:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790934777; 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=F/5vzHLAuY1lKntem60+2Z7FH4KI38ZA8YD2QRNc65A=; b=iyneJeyfGq1Dmt5GzofkmXoPkTOLuLQT0hqhqHWVfg18WMIK0SYnwuUFmyIn/1R5Ubtjc0 6/t+xEKkwoAbvWNPCdYIcivRVUGBHaA23QIcoTKwbEGjRRLi2agCfbjG5m8h2XzPdZajs+ fZjG3iCMCjfO31anOtnT+cssTYGBQ9Q= X-MC-Unique: azEM0eZUPgadsVkQdddz6Q-1 X-Mimecast-MFC-AGG-ID: azEM0eZUPgadsVkQdddz6Q_1790934775 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 11/20] trace: don't emit TraceEvent structs when 'nop' backend is used Date: Fri, 2 Oct 2026 10:52:23 +0100 Message-ID: <20261002095232.3605567-12-berrange@redhat.com> In-Reply-To: <20261002095232.3605567-1-berrange@redhat.com> References: <20261002095232.3605567-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 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: 1790934867938158500 The 'nop' backend is a short-hand for no trace probe usage at all. The emitted functions become a no-op, and as such there is no need to emit the TraceEvent structs, nor the DSTATE variables they reference. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 --- scripts/tracetool/format/c.py | 75 ++++++++++++++++++----------------- scripts/tracetool/format/h.py | 16 +++++--- tests/tracetool/nop.c | 29 -------------- tests/tracetool/nop.h | 6 +-- 4 files changed, 50 insertions(+), 76 deletions(-) diff --git a/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py index de1c154a881..5f6669c917c 100644 --- a/scripts/tracetool/format/c.py +++ b/scripts/tracetool/format/c.py @@ -29,41 +29,42 @@ def generate(events, backend, group): '#include "%s"' % header, '') =20 - for e in events: - out('uint8_t %s;' % e.api(e.QEMU_DSTATE)) - - for e in events: - out('TraceEvent %(event)s =3D {', - '#ifdef CONFIG_TRACE_SIMPLE', - ' .id =3D 0,', - '#endif', - ' .name =3D \"%(name)s\",', - ' .sstate =3D %(sstate)s,', - ' .dstate =3D &%(dstate)s', + if len(list(backend.backend_modules())): + for e in events: + out('uint8_t %s;' % e.api(e.QEMU_DSTATE)) + + for e in events: + out('TraceEvent %(event)s =3D {', + '#ifdef CONFIG_TRACE_SIMPLE', + ' .id =3D 0,', + '#endif', + ' .name =3D \"%(name)s\",', + ' .sstate =3D %(sstate)s,', + ' .dstate =3D &%(dstate)s', + '};', + event =3D e.api(e.QEMU_EVENT), + name =3D e.name, + sstate =3D "TRACE_%s_ENABLED" % e.name.upper(), + dstate =3D e.api(e.QEMU_DSTATE)) + + out('TraceEvent *%(group)s_trace_events[] =3D {', + group =3D group.lower()) + + for e in events: + out(' &%(event)s,', event =3D e.api(e.QEMU_EVENT)) + + out(' NULL,', '};', - event =3D e.api(e.QEMU_EVENT), - name =3D e.name, - sstate =3D "TRACE_%s_ENABLED" % e.name.upper(), - dstate =3D e.api(e.QEMU_DSTATE)) - - out('TraceEvent *%(group)s_trace_events[] =3D {', - group =3D group.lower()) - - for e in events: - out(' &%(event)s,', event =3D e.api(e.QEMU_EVENT)) - - out(' NULL,', - '};', - '') - - out('static void trace_%(group)s_register_events(void)', - '{', - ' trace_event_register_group(%(group)s_trace_events);', - '}', - 'trace_init(trace_%(group)s_register_events)', - group =3D group.lower()) - - backend.generate_begin(active_events, group) - for event in active_events: - backend.generate(event, group) - backend.generate_end(active_events, group) + '') + + out('static void trace_%(group)s_register_events(void)', + '{', + ' trace_event_register_group(%(group)s_trace_events);', + '}', + 'trace_init(trace_%(group)s_register_events)', + group =3D group.lower()) + + backend.generate_begin(active_events, group) + for event in active_events: + backend.generate(event, group) + backend.generate_end(active_events, group) diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index 4dc1ad7eb15..6ffb7256e31 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -27,12 +27,16 @@ def generate(events, backend, group): '#include "%s"' % header, '') =20 - for e in events: - out('extern TraceEvent %(event)s;', - event =3D e.api(e.QEMU_EVENT)) - - for e in events: - out('extern uint8_t %s;' % e.api(e.QEMU_DSTATE)) + if len(list(backend.backend_modules())): + for e in events: + out('extern TraceEvent %(event)s;', + event =3D e.api(e.QEMU_EVENT)) + + for e in events: + out('extern uint8_t %s;' % e.api(e.QEMU_DSTATE)) + else: + for e in events: + out('#define %s 0' % e.api(e.QEMU_DSTATE)) =20 # static state for e in events: diff --git a/tests/tracetool/nop.c b/tests/tracetool/nop.c index f83d06252ea..d34cc0ca742 100644 --- a/tests/tracetool/nop.c +++ b/tests/tracetool/nop.c @@ -5,32 +5,3 @@ #include "qemu/module.h" #include "trace-testsuite.h" =20 -uint8_t _TRACE_TEST_BLAH_DSTATE; -uint8_t _TRACE_TEST_WIBBLE_DSTATE; -TraceEvent _TRACE_TEST_BLAH_EVENT =3D { -#ifdef CONFIG_TRACE_SIMPLE - .id =3D 0, -#endif - .name =3D "test_blah", - .sstate =3D TRACE_TEST_BLAH_ENABLED, - .dstate =3D &_TRACE_TEST_BLAH_DSTATE -}; -TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { -#ifdef CONFIG_TRACE_SIMPLE - .id =3D 0, -#endif - .name =3D "test_wibble", - .sstate =3D TRACE_TEST_WIBBLE_ENABLED, - .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE -}; -TraceEvent *testsuite_trace_events[] =3D { - &_TRACE_TEST_BLAH_EVENT, - &_TRACE_TEST_WIBBLE_EVENT, - NULL, -}; - -static void trace_testsuite_register_events(void) -{ - trace_event_register_group(testsuite_trace_events); -} -trace_init(trace_testsuite_register_events) diff --git a/tests/tracetool/nop.h b/tests/tracetool/nop.h index 443f5e0cf6e..64b6b005684 100644 --- a/tests/tracetool/nop.h +++ b/tests/tracetool/nop.h @@ -6,10 +6,8 @@ =20 #include "trace/control.h" =20 -extern TraceEvent _TRACE_TEST_BLAH_EVENT; -extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; -extern uint8_t _TRACE_TEST_BLAH_DSTATE; -extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; +#define _TRACE_TEST_BLAH_DSTATE 0 +#define _TRACE_TEST_WIBBLE_DSTATE 0 #define TRACE_TEST_BLAH_ENABLED 1 #define TRACE_TEST_WIBBLE_ENABLED 1 =20 --=20 2.55.0 From nobody Sat Oct 24 00:32:21 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=1790934891; cv=none; d=zohomail.com; s=zohoarc; b=i2RrzRv1ddYNsP8scmFmLRPWwpgwVO5JZd7LyNJirAH0j8EhBWYS+3f8Gni0P5fmzUxEtrKofnVFMLj/Bol77+PYMosYr/oqterkczt6pypOwzG7c6Tk/RaAOlO5TE9bNPAuo1HT/LdWLbVFf25MBDUDKcWdSiYRfbRE8DlFVxk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790934891; 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=kRF9tkNVI0yG59wq72Jto91fFFWXOTUI7UYd2oJ+ujs=; b=ahVzeurz+QIPz2R6uHKXUd6r4VHg4tVYxTUK7bB3VLGoX9A5b9m5gwedREG88EbuAQ1cgLMT9QJDzPZm88QLgL+1vCBLJdJcO+zUHjkV1WpgEviwOBh7ImgTRetIoeb0QWksRG7y6zFoU7gqFIEDn9MpJB+aY4/ONn4Y3Fy5FAQ= 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 1790934891257287.1143121226946; Fri, 2 Oct 2026 02:54:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCZwu-0003Z8-TF; Fri, 02 Oct 2026 05:53: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 1xCZws-0003Ws-Vk for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53:03 -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 1xCZwq-0000vT-Eb for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53:02 -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-411-tGAUvAwOMOqfHZX06BCRRA-1; Fri, 02 Oct 2026 05:52:58 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 551E81955EA7; Fri, 2 Oct 2026 09:52:57 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E3FC3180049F; Fri, 2 Oct 2026 09:52:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790934779; 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=kRF9tkNVI0yG59wq72Jto91fFFWXOTUI7UYd2oJ+ujs=; b=Xrg4pdcl6RnEEQfRO+u1JtgUnbYgm2OYf0gw0Jz5pqTdDdGpFUS8TNh2XLKih0dwghcJEi 8dvWCkW9sRboy302xdYW1RB88NipA3KQBY0YAvl/Fw486Zkh0NHUbb0bF4dG5wonXDSpMz diNpXpLlpkcwC7gtPhql4Yudy+P18/k= X-MC-Unique: tGAUvAwOMOqfHZX06BCRRA-1 X-Mimecast-MFC-AGG-ID: tGAUvAwOMOqfHZX06BCRRA_1790934777 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 12/20] trace: add test of generation with all backends enabled Date: Fri, 2 Oct 2026 10:52:24 +0100 Message-ID: <20261002095232.3605567-13-berrange@redhat.com> In-Reply-To: <20261002095232.3605567-1-berrange@redhat.com> References: <20261002095232.3605567-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 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: 1790934892135158501 This reveals potentially interesting patterns in the generated code when multiple backends are present. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 --- tests/tracetool/all.c | 65 +++++++++++++++++ tests/tracetool/all.d | 10 +++ tests/tracetool/all.h | 102 +++++++++++++++++++++++++++ tests/tracetool/all.log-stap | 15 ++++ tests/tracetool/all.rs | 90 +++++++++++++++++++++++ tests/tracetool/all.simpletrace-stap | 16 +++++ tests/tracetool/all.stap | 14 ++++ tests/tracetool/all.ust-events-c | 14 ++++ tests/tracetool/all.ust-events-h | 56 +++++++++++++++ tests/tracetool/meson.build | 3 +- tests/tracetool/tracetool-test.py | 12 ++-- 11 files changed, 392 insertions(+), 5 deletions(-) create mode 100644 tests/tracetool/all.c create mode 100644 tests/tracetool/all.d create mode 100644 tests/tracetool/all.h create mode 100644 tests/tracetool/all.log-stap create mode 100644 tests/tracetool/all.rs create mode 100644 tests/tracetool/all.simpletrace-stap create mode 100644 tests/tracetool/all.stap create mode 100644 tests/tracetool/all.ust-events-c create mode 100644 tests/tracetool/all.ust-events-h diff --git a/tests/tracetool/all.c b/tests/tracetool/all.c new file mode 100644 index 00000000000..820ddb575b0 --- /dev/null +++ b/tests/tracetool/all.c @@ -0,0 +1,65 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "qemu/osdep.h" +#include "qemu/module.h" +#include "trace-testsuite.h" + +uint8_t _TRACE_TEST_BLAH_DSTATE; +uint8_t _TRACE_TEST_WIBBLE_DSTATE; +TraceEvent _TRACE_TEST_BLAH_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE + .id =3D 0, +#endif + .name =3D "test_blah", + .sstate =3D TRACE_TEST_BLAH_ENABLED, + .dstate =3D &_TRACE_TEST_BLAH_DSTATE +}; +TraceEvent _TRACE_TEST_WIBBLE_EVENT =3D { +#ifdef CONFIG_TRACE_SIMPLE + .id =3D 0, +#endif + .name =3D "test_wibble", + .sstate =3D TRACE_TEST_WIBBLE_ENABLED, + .dstate =3D &_TRACE_TEST_WIBBLE_DSTATE +}; +TraceEvent *testsuite_trace_events[] =3D { + &_TRACE_TEST_BLAH_EVENT, + &_TRACE_TEST_WIBBLE_EVENT, + NULL, +}; + +static void trace_testsuite_register_events(void) +{ + trace_event_register_group(testsuite_trace_events); +} +trace_init(trace_testsuite_register_events) +#include "qemu/osdep.h" +#include "trace/control.h" +#include "trace/simple.h" + +void _simple_trace_test_blah(void *context, const char *filename) +{ + TraceBufferRecord rec; + size_t argfilename_len =3D filename ? MIN(strlen(filename), MAX_TRACE_= STRLEN) : 0; + + if (trace_record_start(&rec, _TRACE_TEST_BLAH_EVENT.id, 8 + 4 + argfil= ename_len)) { + return; /* Trace Buffer Full, Event Dropped ! */ + } + trace_record_write_u64(&rec, (uintptr_t)(uint64_t *)context); + trace_record_write_str(&rec, filename, argfilename_len); + trace_record_finish(&rec); +} + +void _simple_trace_test_wibble(void *context, int value) +{ + TraceBufferRecord rec; + + if (trace_record_start(&rec, _TRACE_TEST_WIBBLE_EVENT.id, 8 + 8)) { + return; /* Trace Buffer Full, Event Dropped ! */ + } + trace_record_write_u64(&rec, (uintptr_t)(uint64_t *)context); + trace_record_write_u64(&rec, (uint64_t)value); + trace_record_finish(&rec); +} + diff --git a/tests/tracetool/all.d b/tests/tracetool/all.d new file mode 100644 index 00000000000..5cc06f9f4f5 --- /dev/null +++ b/tests/tracetool/all.d @@ -0,0 +1,10 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +provider qemu { + +probe test_blah(void * context,const char * filename); + +probe test_wibble(void * context,int value); + +}; diff --git a/tests/tracetool/all.h b/tests/tracetool/all.h new file mode 100644 index 00000000000..41fa4d0e8a2 --- /dev/null +++ b/tests/tracetool/all.h @@ -0,0 +1,102 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef TRACE_TESTSUITE_GENERATED_TRACERS_H +#define TRACE_TESTSUITE_GENERATED_TRACERS_H + +#include "trace/control.h" + +extern TraceEvent _TRACE_TEST_BLAH_EVENT; +extern TraceEvent _TRACE_TEST_WIBBLE_EVENT; +extern uint8_t _TRACE_TEST_BLAH_DSTATE; +extern uint8_t _TRACE_TEST_WIBBLE_DSTATE; +#define TRACE_TEST_BLAH_ENABLED 1 +#define TRACE_TEST_WIBBLE_ENABLED 1 +#ifndef SDT_USE_VARIADIC +#define SDT_USE_VARIADIC 1 +#endif +#include "trace-dtrace-testsuite.h" + +#undef SDT_USE_VARIADIC +#ifndef QEMU_TEST_BLAH_ENABLED +#define QEMU_TEST_BLAH_ENABLED() true +#endif +#ifndef QEMU_TEST_WIBBLE_ENABLED +#define QEMU_TEST_WIBBLE_ENABLED() true +#endif +#include "trace/ftrace.h" + +#include "qemu/log-for-trace.h" + +void _simple_trace_test_blah(void *context, const char *filename); +void _simple_trace_test_wibble(void *context, int value); + +#include + +#include +#include "trace-ust-testsuite.h" + +/* tracepoint_enabled() was introduced in LTTng UST 2.7 */ +#ifndef tracepoint_enabled +#define tracepoint_enabled(a, b) true +#endif + + +#define TRACE_TEST_BLAH_BACKEND_DSTATE() ( \ + QEMU_TEST_BLAH_ENABLED() || \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \ + tracepoint_enabled(qemu, test_blah) || \ + false) + +static inline void trace_test_blah(void *context, const char *filename) +{ + QEMU_TEST_BLAH(context, filename); + tracepoint(qemu, test_blah, context, filename); + if (trace_event_get_state(TRACE_TEST_BLAH)) { +#line 4 "trace-events" + ftrace_write("test_blah " "Blah context=3D%p filename=3D%s" "\n" ,= context, filename); +#line 62 "all.h" + if (qemu_loglevel_mask(LOG_TRACE)) { +#line 4 "trace-events" + qemu_log("test_blah " "Blah context=3D%p filename=3D%s" "\n", = context, filename); +#line 66 "all.h" + } + _simple_trace_test_blah(context, filename); +#line 4 "trace-events" + syslog(LOG_INFO, "test_blah " "Blah context=3D%p filename=3D%s" , = context, filename); +#line 71 "all.h" + } +} + +#define TRACE_TEST_WIBBLE_BACKEND_DSTATE() ( \ + QEMU_TEST_WIBBLE_ENABLED() || \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ + trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \ + tracepoint_enabled(qemu, test_wibble) || \ + false) + +static inline void trace_test_wibble(void *context, int value) +{ + QEMU_TEST_WIBBLE(context, value); + tracepoint(qemu, test_wibble, context, value); + if (trace_event_get_state(TRACE_TEST_WIBBLE)) { +#line 5 "trace-events" + ftrace_write("test_wibble " "Wibble context=3D%p value=3D%d" "\n" = , context, value); +#line 91 "all.h" + if (qemu_loglevel_mask(LOG_TRACE)) { +#line 5 "trace-events" + qemu_log("test_wibble " "Wibble context=3D%p value=3D%d" "\n",= context, value); +#line 95 "all.h" + } + _simple_trace_test_wibble(context, value); +#line 5 "trace-events" + syslog(LOG_INFO, "test_wibble " "Wibble context=3D%p value=3D%d" ,= context, value); +#line 100 "all.h" + } +} +#endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */ diff --git a/tests/tracetool/all.log-stap b/tests/tracetool/all.log-stap new file mode 100644 index 00000000000..092986e0b61 --- /dev/null +++ b/tests/tracetool/all.log-stap @@ -0,0 +1,15 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +probe qemu.log.test_blah =3D qemu.test_blah ? +{ + try { + argfilename_str =3D filename ? user_string_n(filename, 512) : "" + } catch {} + printf("%d@%d test_blah Blah context=3D%p filename=3D%s\n", pid(), get= timeofday_ns(), context, argfilename_str) +} +probe qemu.log.test_wibble =3D qemu.test_wibble ? +{ + printf("%d@%d test_wibble Wibble context=3D%p value=3D%d\n", pid(), ge= ttimeofday_ns(), context, value) +} + diff --git a/tests/tracetool/all.rs b/tests/tracetool/all.rs new file mode 100644 index 00000000000..c8c9d288366 --- /dev/null +++ b/tests/tracetool/all.rs @@ -0,0 +1,90 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +// This file is @generated by tracetool, do not edit. + +#[allow(unused_imports)] +use std::ffi::c_char; +#[allow(unused_imports)] +use util::bindings; + +#[allow(dead_code)] +#[inline(always)] +fn trace_event_state_is_enabled(dstate: u8) -> bool { + (unsafe { trace_events_enabled_count }) !=3D 0 && dstate !=3D 0 +} + +extern "C" { + #[allow(dead_code)] + static mut trace_events_enabled_count: u32; +} +extern "C" { + #[allow(dead_code)] + static mut _TRACE_TEST_BLAH_DSTATE: u8; + #[allow(dead_code)] + static mut _TRACE_TEST_WIBBLE_DSTATE: u8; +} + +use std::cell::UnsafeCell; + +extern "C" { + #[allow(dead_code)] + static qemu_test_blah_semaphore: UnsafeCell; + #[allow(dead_code)] + static qemu_test_wibble_semaphore: UnsafeCell; +} + +#[inline(always)] +#[allow(dead_code)] +pub fn trace_test_blah_enabled() -> bool +{ + (unsafe {qemu_test_blah_semaphore.get().read_volatile()}) !=3D 0 || + trace_event_state_is_enabled(unsafe { _TRACE_TEST_BLAH_DSTATE}) || + false +} + +#[inline(always)] +#[allow(dead_code)] +pub fn trace_test_blah(_context: *mut (), _filename: &std::ffi::CStr) +{ + ::trace::probe!(qemu, test_blah, _context, _filename.as_ptr()); + if trace_event_state_is_enabled(unsafe { _TRACE_TEST_BLAH_DSTATE}) { + let format_string =3D c"Blah context=3D%p filename=3D%s"; + unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_= char, _context /* as *mut () */, _filename.as_ptr());} + let format_string =3D c"test_blah Blah context=3D%p filename=3D%s\= n"; + if (unsafe { bindings::qemu_loglevel } & bindings::LOG_TRACE) !=3D= 0 { + unsafe { bindings::qemu_log(format_string.as_ptr() as *const c= _char, _context /* as *mut () */, _filename.as_ptr());} + } + extern "C" { fn _simple_trace_test_blah(_context: *mut (), _filena= me: *const std::ffi::c_char); } + unsafe { _simple_trace_test_blah(_context, _filename.as_ptr()); } + let format_string =3D c"Blah context=3D%p filename=3D%s"; + unsafe {::trace::syslog(::trace::LOG_INFO, format_string.as_ptr() = as *const c_char, _context /* as *mut () */, _filename.as_ptr());} + } +} + +#[inline(always)] +#[allow(dead_code)] +pub fn trace_test_wibble_enabled() -> bool +{ + (unsafe {qemu_test_wibble_semaphore.get().read_volatile()}) !=3D 0 || + trace_event_state_is_enabled(unsafe { _TRACE_TEST_WIBBLE_DSTATE}) || + false +} + +#[inline(always)] +#[allow(dead_code)] +pub fn trace_test_wibble(_context: *mut (), _value: std::ffi::c_int) +{ + ::trace::probe!(qemu, test_wibble, _context, _value); + if trace_event_state_is_enabled(unsafe { _TRACE_TEST_WIBBLE_DSTATE}) { + let format_string =3D c"Wibble context=3D%p value=3D%d"; + unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_= char, _context /* as *mut () */, _value /* as std::ffi::c_int */);} + let format_string =3D c"test_wibble Wibble context=3D%p value=3D%d= \n"; + if (unsafe { bindings::qemu_loglevel } & bindings::LOG_TRACE) !=3D= 0 { + unsafe { bindings::qemu_log(format_string.as_ptr() as *const c= _char, _context /* as *mut () */, _value /* as std::ffi::c_int */);} + } + extern "C" { fn _simple_trace_test_wibble(_context: *mut (), _valu= e: std::ffi::c_int); } + unsafe { _simple_trace_test_wibble(_context, _value); } + let format_string =3D c"Wibble context=3D%p value=3D%d"; + unsafe {::trace::syslog(::trace::LOG_INFO, format_string.as_ptr() = as *const c_char, _context /* as *mut () */, _value /* as std::ffi::c_int *= /);} + } +} + diff --git a/tests/tracetool/all.simpletrace-stap b/tests/tracetool/all.sim= pletrace-stap new file mode 100644 index 00000000000..d064e3e286a --- /dev/null +++ b/tests/tracetool/all.simpletrace-stap @@ -0,0 +1,16 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +probe qemu.simpletrace.test_blah =3D qemu.test_blah ? +{ + try { + argfilename_str =3D filename ? user_string_n(filename, 512) : "" + } catch {} + argfilename_len =3D strlen(argfilename_str) + printf("%8b%8b%8b%4b%4b%8b%4b%.*s", 1, 0, gettimeofday_ns(), 24 + 8 + = 4 + argfilename_len, pid(), context, argfilename_len, argfilename_len, argf= ilename_str) +} +probe qemu.simpletrace.test_wibble =3D qemu.test_wibble ? +{ + printf("%8b%8b%8b%4b%4b%8b%8b", 1, 1, gettimeofday_ns(), 24 + 8 + 8, p= id(), context, value) +} + diff --git a/tests/tracetool/all.stap b/tests/tracetool/all.stap new file mode 100644 index 00000000000..9c5d8a527ce --- /dev/null +++ b/tests/tracetool/all.stap @@ -0,0 +1,14 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +probe qemu.test_blah =3D process("qemu").mark("test_blah") +{ + context =3D $arg1; + filename =3D $arg2; +} +probe qemu.test_wibble =3D process("qemu").mark("test_wibble") +{ + context =3D $arg1; + value =3D $arg2; +} + diff --git a/tests/tracetool/all.ust-events-c b/tests/tracetool/all.ust-eve= nts-c new file mode 100644 index 00000000000..db232240568 --- /dev/null +++ b/tests/tracetool/all.ust-events-c @@ -0,0 +1,14 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "qemu/osdep.h" + +#define TRACEPOINT_DEFINE +#define TRACEPOINT_CREATE_PROBES + +/* If gcc version 4.7 or older is used, LTTng ust gives a warning when com= piling with + -Wredundant-decls. + */ +#pragma GCC diagnostic ignored "-Wredundant-decls" + +#include "trace-ust-all.h" diff --git a/tests/tracetool/all.ust-events-h b/tests/tracetool/all.ust-eve= nts-h new file mode 100644 index 00000000000..4621a995fc1 --- /dev/null +++ b/tests/tracetool/all.ust-events-h @@ -0,0 +1,56 @@ +/* This file is autogenerated by tracetool, do not edit. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#undef TRACEPOINT_PROVIDER +#define TRACEPOINT_PROVIDER qemu + +#undef TRACEPOINT_INCLUDE +#define TRACEPOINT_INCLUDE "./trace-ust.h" + +#if !defined (TRACE_TESTSUITE_GENERATED_UST_H) || \ + defined(TRACEPOINT_HEADER_MULTI_READ) +#define TRACE_TESTSUITE_GENERATED_UST_H + +#include + +/* + * LTTng ust 2.0 does not allow you to use TP_ARGS(void) for tracepoints + * requiring no arguments. We define these macros introduced in more recen= t * versions of LTTng ust as a workaround + */ +#ifndef _TP_EXPROTO1 +#define _TP_EXPROTO1(a) void +#endif +#ifndef _TP_EXDATA_PROTO1 +#define _TP_EXDATA_PROTO1(a) void *__tp_data +#endif +#ifndef _TP_EXDATA_VAR1 +#define _TP_EXDATA_VAR1(a) __tp_data +#endif +#ifndef _TP_EXVAR1 +#define _TP_EXVAR1(a) +#endif + +TRACEPOINT_EVENT( + qemu, + test_blah, + TP_ARGS(void *, context, const char *, filename), + TP_FIELDS( + ctf_integer_hex(void *, context, context) + ctf_string(filename, filename) + ) +) + +TRACEPOINT_EVENT( + qemu, + test_wibble, + TP_ARGS(void *, context, int, value), + TP_FIELDS( + ctf_integer_hex(void *, context, context) + ctf_integer(int, value, value) + ) +) + +#endif /* TRACE_TESTSUITE_GENERATED_UST_H */ + +/* This part must be outside ifdef protection */ +#include diff --git a/tests/tracetool/meson.build b/tests/tracetool/meson.build index f4f583e6224..b024dc6e405 100644 --- a/tests/tracetool/meson.build +++ b/tests/tracetool/meson.build @@ -11,7 +11,8 @@ backends =3D [ 'log', 'simple', 'syslog', - 'ust' + 'ust', + 'all' ] =20 # The tracetool-test.py program has portability problems on Windows. diff --git a/tests/tracetool/tracetool-test.py b/tests/tracetool/tracetool-= test.py index 74f315a4629..2f6328e68c3 100755 --- a/tests/tracetool/tracetool-test.py +++ b/tests/tracetool/tracetool-test.py @@ -14,16 +14,16 @@ def get_formats(backend): "c", "h", ] - if backend in {"nop", "dtrace", "ftrace", "log", "simple", "syslog"}: + if backend in {"nop", "dtrace", "ftrace", "log", "simple", "syslog", "= all"}: formats +=3D ["rs"] - if backend =3D=3D "dtrace": + if backend in {"dtrace", "all"}: formats +=3D [ "d", "log-stap", "simpletrace-stap", "stap", ] - if backend =3D=3D "ust": + if backend in {"ust", "all"}: formats +=3D [ "ust-events-c", "ust-events-h", @@ -36,8 +36,12 @@ def test_tracetool_one(tracetool, backend, fmt, src_dir,= build_dir): actual_file =3D Path(build_dir, rel_filename) expect_file =3D Path(src_dir, rel_filename) =20 + backends =3D backend + if backends =3D=3D "all": + backends =3D "dtrace,ftrace,log,simple,syslog,ust" + args =3D [sys.executable, tracetool, - f"--format=3D{fmt}", f"--backends=3D{backend}", "--group=3Dtes= tsuite"] + f"--format=3D{fmt}", f"--backends=3D{backends}", "--group=3Dte= stsuite"] =20 if fmt.find("stap") !=3D -1: args +=3D ["--binary=3Dqemu", "--probe-prefix=3Dqemu"] --=20 2.55.0 From nobody Sat Oct 24 00:32:21 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=1790934797; cv=none; d=zohomail.com; s=zohoarc; b=UIi4FUHwXunOZMOiKhNFgJstb031B2XftPNhwA8BIGtTJm+TEsxe5mj/WELXMQRfeXAbSygkHpsGmD1ktxcWt3xiabExvyb9YxoPcQznyQyLn2Fzjro+gtyaVD0/x1hKygBLIpux64+qY0fT1JNe/D/tymLd32WzXhcMrdARXrk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790934797; 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=8QAy4v1uDsaW1jXNef0N/kSUwVVGFwuEViT3sCjXjt0=; b=Qg27dhORI+fzOdYurH5A9dn5DwC4r2EW3Hoyelyx1eH14PNpCuXk2MRF3365qFb3bfNVTB5HGqNidjHJperQ77ZYzTPKn6wM0Bc7fyu5RN5EdmrHAKuHPtswQScNPBOOXavTDmda7XT7YGYrFfLMp8EvDQ20t1+m44ejMyrcFCs= 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 1790934797611282.8605478250133; Fri, 2 Oct 2026 02:53:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCZww-0003aU-Fb; Fri, 02 Oct 2026 05:53:06 -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 1xCZwv-0003ZP-5P for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53:05 -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 1xCZwt-0000wd-Nc for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53:04 -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-452-dxqk6l6-NGClH9dI5_q1jA-1; Fri, 02 Oct 2026 05:53:00 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DFBAA180AD43; Fri, 2 Oct 2026 09:52:58 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A6043180049F; Fri, 2 Oct 2026 09:52:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790934783; 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=8QAy4v1uDsaW1jXNef0N/kSUwVVGFwuEViT3sCjXjt0=; b=L/2KOGaUnNtTwMQ3Q1Xrm3HpCmFKBRYE3I1wYQ/KayML+OR4vQhDZGl6REDFSP8u6L5tOZ wkesHZQytF+jpVwI286HQhXykWT5LVL1ZIz/7bwecSMw63blvUz3SZFbI+Eox8pkGJwyfl sxncs7BmAGC4XW4RtlYnGxoug8K0Y+Q= X-MC-Unique: dxqk6l6-NGClH9dI5_q1jA-1 X-Mimecast-MFC-AGG-ID: dxqk6l6-NGClH9dI5_q1jA_1790934779 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 13/20] trace: remove redundant headers from simple trace backend code Date: Fri, 2 Oct 2026 10:52:25 +0100 Message-ID: <20261002095232.3605567-14-berrange@redhat.com> In-Reply-To: <20261002095232.3605567-1-berrange@redhat.com> References: <20261002095232.3605567-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -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: 1790934799570158500 The main formatter for .h/.c files for generated trace code already includes osdep.h and control.h, so it is redundant for the simple trace backend to add them too. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 --- scripts/tracetool/backend/simple.py | 4 +--- tests/tracetool/all.c | 2 -- tests/tracetool/simple.c | 2 -- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/backen= d/simple.py index b131e4fc194..e22683c7d2a 100644 --- a/scripts/tracetool/backend/simple.py +++ b/scripts/tracetool/backend/simple.py @@ -48,9 +48,7 @@ def generate_h_backend_dstate(event, group): =20 =20 def generate_c_begin(events, group): - out('#include "qemu/osdep.h"', - '#include "trace/control.h"', - '#include "trace/simple.h"', + out('#include "trace/simple.h"', '') =20 =20 diff --git a/tests/tracetool/all.c b/tests/tracetool/all.c index 820ddb575b0..3b8d4d32d17 100644 --- a/tests/tracetool/all.c +++ b/tests/tracetool/all.c @@ -34,8 +34,6 @@ static void trace_testsuite_register_events(void) trace_event_register_group(testsuite_trace_events); } trace_init(trace_testsuite_register_events) -#include "qemu/osdep.h" -#include "trace/control.h" #include "trace/simple.h" =20 void _simple_trace_test_blah(void *context, const char *filename) diff --git a/tests/tracetool/simple.c b/tests/tracetool/simple.c index 820ddb575b0..3b8d4d32d17 100644 --- a/tests/tracetool/simple.c +++ b/tests/tracetool/simple.c @@ -34,8 +34,6 @@ static void trace_testsuite_register_events(void) trace_event_register_group(testsuite_trace_events); } trace_init(trace_testsuite_register_events) -#include "qemu/osdep.h" -#include "trace/control.h" #include "trace/simple.h" =20 void _simple_trace_test_blah(void *context, const char *filename) --=20 2.55.0 From nobody Sat Oct 24 00:32:21 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=1790934831; cv=none; d=zohomail.com; s=zohoarc; b=WOca+uO/YtV4XmVDW/TdwrjKDJLpgfy4vMNik1+5Ls7Q3ocFdDVXD2Y7rCzFLTRh9sfePXxurNvvGv/k1NkFySj+DWOJyyjQYXbgFLroo5DC22n3gHVgIPx8cVoD/zm48TAw96kpodIwmvuQuMs4+ci6mNun6xIRmoVwfluu/kk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790934831; 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=WSXBxx1Sts1JIdodiO9Ml3alE3DaOZOYaQmlKn6VRvk=; b=FZ1RZtGk5K9/xx0xkpUqEG2Xi22TgoyKgtPs9JthdqR7xJSIivM9rpnSwGqJahmZlWXSyoa53PARwpY5OKl7i2Ikqu/lj0gPIxEVKE+JWhiE2KTrTPCXOGE8N+kAClU1qnvAatqUIT1d7L8TbRIVCVKwEiMHzH24720IqWuQQNQ= 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 1790934831149273.97450828084527; Fri, 2 Oct 2026 02:53:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCZx0-0003cu-RN; Fri, 02 Oct 2026 05:53: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 1xCZww-0003b6-WC for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53:07 -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 1xCZwv-0000yB-L3 for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53:06 -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-396-Sop0wuOyOkCypakoLV5ftA-1; Fri, 02 Oct 2026 05:53:01 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A16A01955EA7; Fri, 2 Oct 2026 09:53:00 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3D9AE1800348; Fri, 2 Oct 2026 09:52:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790934785; 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=WSXBxx1Sts1JIdodiO9Ml3alE3DaOZOYaQmlKn6VRvk=; b=FH1cOd0m+KYEWHsQIK4rUj6Vcx2nq5JtSsudoYCH8KrkSCUZ2esLevGQVUELtx+emWBgo3 vj4IQVgCs38s1VQnD4vG0w5bXc/6qbB1B1/gOXgeRKJgVoojKx4Lt7kb7VQ19mconeSbIY mT/PMBReHK4mGqspQi9Abclz4QrqQhw= X-MC-Unique: Sop0wuOyOkCypakoLV5ftA-1 X-Mimecast-MFC-AGG-ID: Sop0wuOyOkCypakoLV5ftA_1790934780 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 14/20] audio: remove mistaken use of trace_event_get_state() Date: Fri, 2 Oct 2026 10:52:26 +0100 Message-ID: <20261002095232.3605567-15-berrange@redhat.com> In-Reply-To: <20261002095232.3605567-1-berrange@redhat.com> References: <20261002095232.3605567-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 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: 1790934831893158501 Conditional checks must call trace_event_get_state_backends() which checks the state of all backends (dtrace, ftrace, log, syslog, simple & ust), while trace_event_get_state() only validates state for backends using QEMU's internal state tracking (ftrace, log, syslog, simple). Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 --- audio/audio-mixeng-be.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/audio-mixeng-be.c b/audio/audio-mixeng-be.c index 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:21 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=1790934796; cv=none; d=zohomail.com; s=zohoarc; b=QNNQRVdTRhTsKdhgf5C/ih9wZ5PtGmPB1fpnoZ2pVALi1tRtOc0G+jf410ZEVYT2zzzIup6P0HHMSC9SQUdq1VBC9dMRky4BfstjQjo8KUDofB++Mp1KfHomoww9BKTy39CRbUR3AdkvmdeCi9DTQyora0Tz/ZWLqLZshc+dDQg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790934796; 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=38McGp5Xm1dQXhbAUpMdkHym6qcL4iNQX0mqlyg4uho=; b=RPqiWjR73i7GbpYCkBQbj1eUPhCzaALtTCJCX7c9rnyErHTFXVtkeKa2jpBBx/RXHkAPeUt+9FSbaCg2xEqTBSuzkI8e/EdyFQ/XTBDAyOFF+sZZsWL89ReSXNy4sQg59ZCnw7qgFW97wt8DHpcnOVmMJ6QF3CyRGaEy7oUVqG0= 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 1790934796169722.7636330471622; Fri, 2 Oct 2026 02:53:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCZwz-0003c6-Be; Fri, 02 Oct 2026 05:53:09 -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 1xCZww-0003au-Qd for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53:07 -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 1xCZwv-0000xw-DM for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53:06 -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-294-xKNTSwyyNzWU9zc5ZmNaeQ-1; Fri, 02 Oct 2026 05:53:03 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 37D27180AEFB; Fri, 2 Oct 2026 09:53:02 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F1413180056E; Fri, 2 Oct 2026 09:53:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790934784; 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=38McGp5Xm1dQXhbAUpMdkHym6qcL4iNQX0mqlyg4uho=; b=Ru00ZtE8o/FM1BRiprbM6Giw3i4c44ucSfPmTMRznSeiSki0Wlkv9Gr3GNQ5sk3zZTPMuz Nsof78Cm7G7ZIrD83TqgTnDmGkNloB8cp6N3QlkRAHdGfWgHvv0E/R4u1FamPGzqyih3S9 fiy8DcFs6OpF1gSQrHy3KFRFI2HHS80= X-MC-Unique: xKNTSwyyNzWU9zc5ZmNaeQ-1 X-Mimecast-MFC-AGG-ID: xKNTSwyyNzWU9zc5ZmNaeQ_1790934782 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 15/20] hw/ppc: remove mistaken use of trace_event_get_state() Date: Fri, 2 Oct 2026 10:52:27 +0100 Message-ID: <20261002095232.3605567-16-berrange@redhat.com> In-Reply-To: <20261002095232.3605567-1-berrange@redhat.com> References: <20261002095232.3605567-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -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: 1790934797631158500 Conditional checks must call trace_event_get_state_backends() which checks the state of all backends (dtrace, ftrace, log, syslog, simple & ust), while trace_event_get_state() only validates state for backends using QEMU's internal state tracking (ftrace, log, syslog, simple). Furthermore, checking qemu_loglevel_mask() is inappropriate since there are many trace backends, of which 'log' is only one. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 --- hw/ppc/vof.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/hw/ppc/vof.c b/hw/ppc/vof.c index 873e967f1e4..e2ff9bf96a3 100644 --- a/hw/ppc/vof.c +++ b/hw/ppc/vof.c @@ -252,8 +252,7 @@ static uint32_t vof_getprop(const void *fdt, uint32_t n= odeph, uint32_t pname, */ ret =3D proplen; /* Do not format a value if tracepoint is silent, for performa= nce */ - if (trace_event_get_state(TRACE_VOF_GETPROP) && - qemu_loglevel_mask(LOG_TRACE)) { + if (trace_event_get_state_backends(TRACE_VOF_GETPROP)) { prop_format(trval, sizeof(trval), prop, ret); } } @@ -337,8 +336,7 @@ static uint32_t vof_setprop(MachineState *ms, void *fdt= , Vof *vof, goto trace_exit; } =20 - if (trace_event_get_state(TRACE_VOF_SETPROP) && - qemu_loglevel_mask(LOG_TRACE)) { + if (trace_event_get_state_backends(TRACE_VOF_SETPROP)) { prop_format(trval, sizeof(trval), val, vallen); } ret =3D vallen; @@ -584,8 +582,7 @@ static uint32_t vof_write(Vof *vof, uint32_t ihandle, u= int32_t buf, } =20 /* FIXME: there is no backend(s) yet so just call a trace */ - if (trace_event_get_state(TRACE_VOF_WRITE) && - qemu_loglevel_mask(LOG_TRACE)) { + if (trace_event_get_state_backends(TRACE_VOF_WRITE)) { tmp[cb] =3D '\0'; trace_vof_write(ihandle, cb, tmp); } @@ -599,9 +596,7 @@ static void vof_claimed_dump(GArray *claimed) int i; OfClaimed c; =20 - if (trace_event_get_state(TRACE_VOF_CLAIMED) && - qemu_loglevel_mask(LOG_TRACE)) { - + if (trace_event_get_state_backends(TRACE_VOF_CLAIMED)) { for (i =3D 0; i < claimed->len; ++i) { c =3D g_array_index(claimed, OfClaimed, i); trace_vof_claimed(c.start, c.start + c.size, c.size); --=20 2.55.0 From nobody Sat Oct 24 00:32:21 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=1790934850; cv=none; d=zohomail.com; s=zohoarc; b=Fo82Nqw3QGNuAAxexeYoed2WqHngrS2gFEzRTQAcZ5Z0lLr5ShrBnZrUoUqfoDi6jE7dQo4iGbxGlDw+vH8QXFlDQMk/uhrw4wOxey65oCEfFmtFN/RXRxfSn4vRXTXL3PWTlXIo9TpVJTFO8BDuH3QJeA7nDTIJen+XEhIv3F8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790934850; 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=X7YbMZC0kR2fPsuHwEbPKqUR/NsfnBQ2wcc8lWRPPNE=; b=d9uAUV/BKRswZEL4HHsayyE+hnrdlFVk6k75lZuNVAvHL0dRmN07s6HKlOwy71LssCjWPuXJuSr6bvCv5UCulEcCDIyE4VGvpANUVnmsZAvSItCKxhuYtIpue6OAaZRU8w0AyBw5p3+Halju21J/5sZTNAZDExI4RLwPAZoKnmw= 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 17909348508391019.9424213098606; Fri, 2 Oct 2026 02:54:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCZx2-0003hX-RS; Fri, 02 Oct 2026 05:53:12 -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 1xCZx0-0003cd-Hz for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53:10 -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 1xCZwy-0000za-To for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53:10 -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-145-dqZMp0AuPCuPawoIzXE1aQ-1; Fri, 02 Oct 2026 05:53:04 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C316D1800EEC; Fri, 2 Oct 2026 09:53:03 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 88B8B180049F; Fri, 2 Oct 2026 09:53:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790934788; 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=X7YbMZC0kR2fPsuHwEbPKqUR/NsfnBQ2wcc8lWRPPNE=; b=GNc5c7QK9RBTahH4pGRKj3nivYedKQAO8FvEzzoyeFoXaOyeYscJrweg92AKRc0XElDWdo LOBJPZky3WY5gMgXRYDsfwebWh/5FcPo/AWRgdVXk2O0wIQjVJIacFRcx4Vw11ngiIxxLu X7+fpbBM3eScjqknUy2fitQevPFdJ1I= X-MC-Unique: dqZMp0AuPCuPawoIzXE1aQ-1 X-Mimecast-MFC-AGG-ID: dqZMp0AuPCuPawoIzXE1aQ_1790934783 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 16/20] trace: include qemu_loglevel_mask(LOG_TRACE) in guard Date: Fri, 2 Oct 2026 10:52:28 +0100 Message-ID: <20261002095232.3605567-17-berrange@redhat.com> In-Reply-To: <20261002095232.3605567-1-berrange@redhat.com> References: <20261002095232.3605567-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -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: 1790934851925158500 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. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 --- 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:21 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=1790934821; cv=none; d=zohomail.com; s=zohoarc; b=IdgAAP/6b1hI2x8mmmh/JyJ+Zmaj0e3WNB0V7g3W5MpdODeLXwwx7CLYvXUgzgjHx173QgjPMEwLjTF13AuLrwDl0x+JW69IIX+1tDPFdgZd/2fLhErSrOHxWcBON0XRUDgmctVhuJvbZrugLBkvz2zkHgypjMT+IhdtgZyrdLc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790934821; 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=lyP3UQF2xWV/4IztDyEFIqZ2kWG1P/DRVkR4OcGm7lU=; b=MONVOg84v3ucP3Xj/xqW5QLN4z02ZoF0TlwGdHTXylaSUH9IbTdXPRUTEkcwkuTpedoUfKlagBvJe632/iGflIHSOhGF1ZR/9VMNapebi2y4mY9k9rPbCSCIteQUrNTRsQ1OSOaPmYtOQjmHIknQzUGXB69sW/ZfVdmgb5WUPtA= 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 1790934821286506.353446221019; Fri, 2 Oct 2026 02:53:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCZx2-0003fx-3w; Fri, 02 Oct 2026 05:53:12 -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 1xCZwz-0003cA-Q3 for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xCZwy-0000zJ-9F for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53:09 -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-247-q9T0xbROMZiBohuaWgq2og-1; Fri, 02 Oct 2026 05:53:06 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5B7151955BD9; Fri, 2 Oct 2026 09:53:05 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1FC98180049F; Fri, 2 Oct 2026 09:53:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790934787; 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=lyP3UQF2xWV/4IztDyEFIqZ2kWG1P/DRVkR4OcGm7lU=; b=JWPj6DR89Nm/6n6S5gBXLs7wZ4DTzuj0kBeVnAaL683mHcuZ3a1l/tyPNBRBxeH2bGodP9 jI+8GcPFaDPSZO8sfv25s8zH/CLkM9531Eduf3gDPp34W1LCdpqtFmCj6qBJ+xOfv7csaR EFbs02FxUF5ONz67zhi1ahQtdV8IEqg= X-MC-Unique: q9T0xbROMZiBohuaWgq2og-1 X-Mimecast-MFC-AGG-ID: q9T0xbROMZiBohuaWgq2og_1790934785 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 17/20] trace: remove "disable" property from trace files Date: Fri, 2 Oct 2026 10:52:29 +0100 Message-ID: <20261002095232.3605567-18-berrange@redhat.com> In-Reply-To: <20261002095232.3605567-1-berrange@redhat.com> References: <20261002095232.3605567-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 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: 1790934821692158500 The scenarios are not significant enough to justify its use Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 --- hw/display/trace-events | 2 +- target/hppa/trace-events | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/hw/display/trace-events b/hw/display/trace-events index c5e7e42af23..223a085922b 100644 --- a/hw/display/trace-events +++ b/hw/display/trace-events @@ -60,7 +60,7 @@ virtio_gpu_dec_inflight_fences(uint32_t inflight) "in-fli= ght- %u" virtio_gpu_cmd_suspended(uint32_t cmd) "cmd 0x%x" =20 # qxl.c -disable qxl_io_write_vga(int qid, const char *mode, uint32_t addr, uint32_= t val) "%d %s addr=3D%u val=3D%u" +qxl_io_write_vga(int qid, const char *mode, uint32_t addr, uint32_t val) "= %d %s addr=3D%u val=3D%u" qxl_create_guest_primary(int qid, uint32_t width, uint32_t height, uint64_= t mem, uint32_t format, uint32_t position) "%d %ux%u mem=3D0x%" PRIx64 " %u= ,%u" qxl_create_guest_primary_rest(int qid, int32_t stride, uint32_t type, uint= 32_t flags) "%d %d,%d,%d" qxl_destroy_primary(int qid) "%d" diff --git a/target/hppa/trace-events b/target/hppa/trace-events index 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:21 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=1790934861; cv=none; d=zohomail.com; s=zohoarc; b=Yp6eep/qP4b3A092KVm1tqyoYaVIVLq2llj/7t+30Ks1d4tAiiH2EYIQVO+MbgXyOgrOIIkvminrKa+VMziu5DeDWEQS4Bv2+lK+7Y4GmEaEijhYiGleB6VhpcLjbxliha28o6LeXs8OMaCUFAuPGVbLaPqyTMZiJfTIXiN0u4I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790934861; 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=o0MosPHLR+8uM7aAyWSadOR/5q/rmPoHQnEcRPXd5X4=; b=b/sEdBw1ezRBcEHKWLZUqZhGx/UhNRJuFvE5IDmMPgQodWBEvNYoiICcBF7mOGoftDY5DRcdZnh5I7svNmpfSMRFQ6GmYVJxaCvNBYBiTDOA8lU2zzU4YjZoj0PG0OSbTDwMkozGPELXAkfTYMgoMBxuo85CwoH1/kSwmZlLcqU= 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 1790934861832723.94228358359; Fri, 2 Oct 2026 02:54:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCZx4-0003nU-Iu; Fri, 02 Oct 2026 05:53:14 -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 1xCZx3-0003lD-6z for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53:13 -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 1xCZx0-0000zn-3l for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53:12 -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-471-3X_3oddTOTGImBH3zL8GIQ-1; Fri, 02 Oct 2026 05:53:07 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E7FF118007E9; Fri, 2 Oct 2026 09:53:06 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AC255180049F; Fri, 2 Oct 2026 09:53:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790934789; 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=o0MosPHLR+8uM7aAyWSadOR/5q/rmPoHQnEcRPXd5X4=; b=N/nM5YeyT0KMJfZMnboYi19B81J0CEFQh06QFx/BhLckNot+z48BYq+9OzCmplbCFpVSBl Yq6j7KQEGQnMHvQ9d3qjmz6bxAb0P0c1htfHUhOq85lT4ZC0Rs2YyJNruLP7KjM/mKVl+X 8N9BnjpDhVCQwMbBtf1ephjh/mv+sFs= X-MC-Unique: 3X_3oddTOTGImBH3zL8GIQ-1 X-Mimecast-MFC-AGG-ID: 3X_3oddTOTGImBH3zL8GIQ_1790934787 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 18/20] trace: stop tracking static disabled state Date: Fri, 2 Oct 2026 10:52:30 +0100 Message-ID: <20261002095232.3605567-19-berrange@redhat.com> In-Reply-To: <20261002095232.3605567-1-berrange@redhat.com> References: <20261002095232.3605567-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -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: 1790934863991158500 The TraceEvent struct contains a "bool sstate" field which track whether a trace event was disabled statically. i.e. at build time via the "disable" property annotation in trace-events. The only runtime use of this field is to let "trace-event-get-state" report that an event is "unavailable" instead of reporting an error for an unknown trace event. Trace events are not ABI so their names can change and the event can come and go at any time. Thus there is little utility in reporting the existence of a disabled event that cannot ever be used at runtime. Removing the "bool sstate" field from TraceEvent saves 8 bytes of space in the struct, adding up to approx 64 KB across all current events. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 --- qapi/trace.json | 5 ++-- scripts/tracetool/format/c.py | 2 -- scripts/tracetool/format/h.py | 8 ------ stubs/trace-control.c | 1 - tests/tracetool/all.c | 2 -- tests/tracetool/all.h | 14 +++++------ tests/tracetool/dtrace.c | 2 -- tests/tracetool/dtrace.h | 2 -- tests/tracetool/ftrace.c | 2 -- tests/tracetool/ftrace.h | 6 ++--- tests/tracetool/log.c | 2 -- tests/tracetool/log.h | 6 ++--- tests/tracetool/nop.h | 2 -- tests/tracetool/simple.c | 2 -- tests/tracetool/simple.h | 2 -- tests/tracetool/syslog.c | 2 -- tests/tracetool/syslog.h | 6 ++--- tests/tracetool/ust.c | 2 -- tests/tracetool/ust.h | 2 -- trace/control-internal.h | 6 ----- trace/control-target.c | 2 -- trace/control.c | 9 ------- trace/control.h | 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:21 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=1790934802; cv=none; d=zohomail.com; s=zohoarc; b=kVXLHe167Qk1VbIJEPum4d3Bh9BlD5jRCHwhRuTsAlUAGBR5Gu35smolK/gk3jR86Z8Qxr1zlHfkUWKu/anUI0mRjzlFXQDlkGhXVi2kdT+10ziCY643ApGka0NuJcpVYmis/uWRtyFU2HNxxc32NwPPCkZ2yaP8sKeTsyLMDBA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790934802; 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=EQr3JcUEyNF8ygGB3fw1BfAySkeGCyoQgLStfkWep8I=; b=I7y+Yo8+unEVZW83tX3VJ/Rh2+rt8UZT3VeMpshiqUL/rl9UCtAkUVx45NfVuuXN8wK9f6xQFT124WsUz9FJyC8HegimIcvFLhJwMVZJmdMrfg7otVN7YbB4PE9BKbm3uMfqbwh8Hi3sj0HgTVhtTVsF/1xr1Uw2STYqGszeQq0= 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 1790934802399921.5968676886077; Fri, 2 Oct 2026 02:53:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCZx7-0003xc-Dh; Fri, 02 Oct 2026 05:53:17 -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 1xCZx4-0003nT-Aq for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53:14 -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 1xCZx1-000108-Tu for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53:14 -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-574-pdt71w8OODm-eqNWYHMLlA-1; Fri, 02 Oct 2026 05:53:09 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D6B3A180AD63; Fri, 2 Oct 2026 09:53:08 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 448991800348; Fri, 2 Oct 2026 09:53:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790934791; 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=EQr3JcUEyNF8ygGB3fw1BfAySkeGCyoQgLStfkWep8I=; b=Ap8z9To5F0V4jNwiS+QSGegEC/qVX/JYB00B+/ptp/2Qx1Qo4Q70AgbJd0Wvj7zaXZy/jd 3uavfYGkoQ/oixx776NhZ1/gUq5vMJcZ6i3O2QL2gUUa6hvbL8SjnD3ybH0I40ZZdXxEwr edstIjZEIimJvwhMD/8nm+asd+AWYJM= X-MC-Unique: pdt71w8OODm-eqNWYHMLlA-1 X-Mimecast-MFC-AGG-ID: pdt71w8OODm-eqNWYHMLlA_1790934788 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 19/20] trace: remove parsing of "disable" event property Date: Fri, 2 Oct 2026 10:52:31 +0100 Message-ID: <20261002095232.3605567-20-berrange@redhat.com> In-Reply-To: <20261002095232.3605567-1-berrange@redhat.com> References: <20261002095232.3605567-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -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: 1790934803744158500 Finish the removal of the "disable" event property by removing code that parses properties and the backend code generators. This "fixes" a bug in the UST backends which looked for a property called "disabled" instead of "disable". Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 --- docs/devel/tracing.rst | 24 +++-------------- 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 --- 12 files changed, 34 insertions(+), 92 deletions(-) diff --git a/docs/devel/tracing.rst b/docs/devel/tracing.rst index f4557ee20e4..f94063587fa 100644 --- a/docs/devel/tracing.rst +++ b/docs/devel/tracing.rst @@ -366,30 +366,14 @@ To facilitate simple usage of systemtap where there m= erely needs to be printf logging of certain probes, a helper script "qemu-trace-stap" is provided. Consult its manual page for guidance on its usage. =20 -Trace event properties +Trace event conditions =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -Each event in the "trace-events-all" file can be prefixed with a space-sep= arated -list of zero or more of the following event properties. - -"disable" ---------- - -If a specific trace event is going to be invoked a huge number of times, t= his -might have a noticeable performance impact even when the event is -programmatically disabled. - -In this case you should declare such event with the "disable" property. Th= is -will effectively disable the event at compile time (by using the "nop" bac= kend), -thus having no performance impact at all on regular builds (i.e., unless y= ou -edit the "trace-events-all" file). - -In addition, there might be cases where relatively complex computations mu= st be +There might be cases where relatively complex computations must be performed to generate values that are only used as arguments for a trace function. In these cases you can use 'trace_event_get_state_backends()' to -guard such computations, so they are skipped if the event has been either -compile-time disabled or run-time disabled. If the event is compile-time -disabled, this check will have no performance impact. +guard such computations, so they are skipped if the event is not currently +enabled: =20 :: =20 diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py index 6ed7cdd6ce4..bdbb06b5205 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -362,8 +362,6 @@ class Event(object): The event name. fmt : str The event format string. - properties : set(str) - Properties of the event. args : Arguments The event arguments. lineno : int @@ -373,23 +371,18 @@ class Event(object): =20 """ =20 - _CRE =3D re.compile(r"((?P[\w\s]+)\s+)?" - r"(?P\w+)" + _CRE =3D re.compile(r"(?P\w+)" r"\((?P[^)]*)\)" r"\s*" r"(?P\".+)?" r"\s*") =20 - _VALID_PROPS =3D set(["disable"]) - - def __init__(self, name, props, fmt, args, lineno, filename): + def __init__(self, name, fmt, args, lineno, filename): """ Parameters ---------- name : string Event name. - props : list of str - Property names. fmt : str Event printing format string. args : Arguments @@ -401,7 +394,6 @@ def __init__(self, name, props, fmt, args, lineno, file= name): =20 """ self.name =3D name - self.properties =3D props self.fmt =3D fmt self.args =3D args self.lineno =3D int(lineno) @@ -411,11 +403,6 @@ def __init__(self, name, props, fmt, args, lineno, fil= ename): raise ValueError("Event '%s' has more than maximum permitted " "argument count" % name) =20 - unknown_props =3D set(self.properties) - self._VALID_PROPS - if len(unknown_props) > 0: - raise ValueError("Unknown properties: %s" - % ", ".join(unknown_props)) - =20 @staticmethod def build(line_str, lineno, filename): @@ -435,7 +422,6 @@ def build(line_str, lineno, filename): groups =3D m.groupdict('') =20 name =3D groups["name"] - props =3D groups["props"].split() fmt =3D groups["fmt"] if fmt.find("%m") !=3D -1: raise ValueError("Event format '%m' is forbidden, pass the err= or " @@ -448,14 +434,13 @@ def build(line_str, lineno, filename): =20 args =3D Arguments.build(groups["args"]) =20 - return Event(name, props, fmt, args, lineno, posix_relpath(filenam= e)) + return Event(name, fmt, args, lineno, posix_relpath(filename)) =20 def __repr__(self): """Evaluable string representation for this object.""" - return "Event('%s %s(%s) %s')" % (" ".join(self.properties), - self.name, - self.args, - self.fmt) + return "Event('%s(%s) %s')" % (self.name, + self.args, + self.fmt) # Star matching on PRI is dangerous as one might have multiple # arguments with that format, hence the non-greedy version of it. _FMT =3D re.compile(r"(%[\d\.]*\w+|%.*?PRI\S+)") diff --git a/scripts/tracetool/backend/dtrace.py b/scripts/tracetool/backen= d/dtrace.py index f0b58cc1585..6bce25c8d2d 100644 --- a/scripts/tracetool/backend/dtrace.py +++ b/scripts/tracetool/backend/dtrace.py @@ -79,8 +79,6 @@ def generate_rs_begin(events, group): # These are the Rust declarations of the .probes section semaphores # generated by dtrace(1) in its .o file output. for e in events: - if 'disable' in e.properties: - continue out(' #[allow(dead_code)]', f' static qemu_{e.name}_semaphore: UnsafeCell;') out('}', diff --git a/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py index 9f06894623e..3754c7e06fd 100644 --- a/scripts/tracetool/format/c.py +++ b/scripts/tracetool/format/c.py @@ -16,9 +16,6 @@ =20 =20 def generate(events, backend, group): - active_events =3D [e for e in events - if "disable" not in e.properties] - header =3D "trace-" + group + ".h" =20 out('/* This file is autogenerated by tracetool, do not edit. */', @@ -62,7 +59,7 @@ def generate(events, backend, group): 'trace_init(trace_%(group)s_register_events)', group =3D group.lower()) =20 - backend.generate_begin(active_events, group) - for event in active_events: + backend.generate_begin(events, group) + for event in events: backend.generate(event, group) - backend.generate_end(active_events, group) + backend.generate_end(events, group) diff --git a/scripts/tracetool/format/d.py b/scripts/tracetool/format/d.py index e9e33dfe30a..df7780cb0af 100644 --- a/scripts/tracetool/format/d.py +++ b/scripts/tracetool/format/d.py @@ -30,9 +30,6 @@ =20 =20 def generate(events, backend, group): - events =3D [e for e in events - if "disable" not in e.properties] - # SystemTap's dtrace(1) warns about empty "provider qemu {}" but is ha= ppy # with an empty file. Avoid the warning. # But dtrace on macOS can't deal with empty files. diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index 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:21 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=1790934809; cv=none; d=zohomail.com; s=zohoarc; b=KTN/kgph2NssXijM11nZhDurJwRjYbbvjR6GRt06Y1BEJ4KmsWhBA3BH/eL92B7xJt8wJ/lTH7K/6WrkE+jSigQDlcQAFIHZypU9a1H39sTGmC9221jk07A3pwRldvYc3kW/OaXgz9fbDoZxotiOpEgquspwRMywjksYO755q0U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790934809; 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=nX5n9PcJWESBHcmE5HSyA40KTRWhZ/9cdxqeLnCla0c=; b=m9Fx+9HEVvOI8Sv0mj4d1+eBeGP9LYd9hA+wAhhbuRoxDGntps/tk1oVHAga0z9MbS6o2f5Y+x1lCLbjDd98FVb0WXj5lVlK5pJgBYx0AedcEC7UZUTJe87xSNECLuFhOmClFQf/O+oNIMhOjvJzvIDc4IDzvyGweqD7fCcu6So= 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 1790934809116891.5884162277291; Fri, 2 Oct 2026 02:53:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCZxB-0004AL-Ui; Fri, 02 Oct 2026 05:53:21 -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 1xCZx9-00043V-LJ for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53:19 -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 1xCZx7-00011G-Lk for qemu-devel@nongnu.org; Fri, 02 Oct 2026 05:53:19 -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-66-CBU8DXMGNu-HcLJ6dgpc7w-1; Fri, 02 Oct 2026 05:53:13 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B3985195607F; Fri, 2 Oct 2026 09:53:12 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 33B9E180049F; Fri, 2 Oct 2026 09:53:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790934796; 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=nX5n9PcJWESBHcmE5HSyA40KTRWhZ/9cdxqeLnCla0c=; b=Keyiq1yVZCOqwGbsbIkWASv5M1czgdKSONy7HdMdDYDYEgye2dHjBemS3oVTinWnFk5YxT DIbcRjdGcQvmDpi8bxBUmMa74SOdxesgGJS9WlesI+Q+hvVIhTlJI8qyCr7HXdL8PGgXTa 3DASf/3gFeKVgYst+XL0b3MmleSoNrE= X-MC-Unique: CBU8DXMGNu-HcLJ6dgpc7w-1 X-Mimecast-MFC-AGG-ID: CBU8DXMGNu-HcLJ6dgpc7w_1790934792 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 20/20] trace: remove 'trace_event_get_state' wrapper Date: Fri, 2 Oct 2026 10:52:32 +0100 Message-ID: <20261002095232.3605567-21-berrange@redhat.com> In-Reply-To: <20261002095232.3605567-1-berrange@redhat.com> References: <20261002095232.3605567-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 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: 1790934809774158500 The 'trace_event_get_state' macro is a wrapper around the 'trace_event_get_state_dynamic_by_id' macro, which is a direct check of the _TRACE_...._DSTATE global variable. The only code that should be using this is the generated trace probes, but the name looks rather appealing causing it to be mistakenly used in other places, instead of the recommended 'trace_event_get_state_dynamic_backends'. Removing the 'trace_event_get_state' macro reduces the potential for confusion. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Daniel P. Berrang=C3=A9 --- 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