From nobody Mon Dec 1 23:11:24 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 769FE31D399 for ; Wed, 26 Nov 2025 10:43:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764153791; cv=none; b=qJnTAAY3ckJutS95Z8WDQY1+gnoENoxMdfNxN9zmtCAI1Ov+5XScwynSHJO/BClfPWp7TgAsl4FU1OYFQ4QWXI5k7+YHNhaK4P3rINgqRply7HzTFbkXr/Q/Tj/T9XAI2ka7vljKFfdyWraF0dxcb5YSuqYQAs7N6p5hv+2Jm9Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764153791; c=relaxed/simple; bh=/UDn/5W83lvFD9h5OF95CDwRpH09gcN0aa8tdQ3XRJg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eaovhDJPhFMpZwLUa47hVni3qJPS8mOB4pkcWb0G/u9eDbHzSnX9gnlDKcJp3ydzb21ahtLnhmx/3ifUoS+/dGIHK+HyAsA0czNS13r7YHUAoVMNfuqy13rXLEsYfmfcK5g6cGkcqYG4WaeKpt4uPsXOWHr0NjPiTvahHmXwP+g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Nql0l1XQ; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Nql0l1XQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1764153788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6bTjsWcAgyFzINUHOD7EuUUEsT8+XkRCCX/wli3bZHI=; b=Nql0l1XQK9KUyVH/qqQc8M6ygMGcSYdX4P84nN/mzvePAcdUGY7EJ1n+nGIAWlIt3mFCrE cC1KT+Ol+ep3c2tPemRDQSIP2JYDOTYl+OVWhop/PlX8yaEmVU7Y8e5sUBKjXoYhGyLdHv BUqaqHOb/SrA6sycBJwgCf0CXj6SkJ8= 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-675-_i5J454BO4i0RBTs4RSNfg-1; Wed, 26 Nov 2025 05:43:06 -0500 X-MC-Unique: _i5J454BO4i0RBTs4RSNfg-1 X-Mimecast-MFC-AGG-ID: _i5J454BO4i0RBTs4RSNfg_1764153785 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 B81EE18002C5; Wed, 26 Nov 2025 10:43:05 +0000 (UTC) Received: from gmonaco-thinkpadt14gen3.rmtit.csb (unknown [10.45.226.131]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 41BC51800298; Wed, 26 Nov 2025 10:43:02 +0000 (UTC) From: Gabriele Monaco To: linux-kernel@vger.kernel.org, Steven Rostedt , Nam Cao , Gabriele Monaco , linux-trace-kernel@vger.kernel.org Cc: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Subject: [PATCH 4/8] verification/rvgen: Adapt dot2k and templates after refactoring da_monitor.h Date: Wed, 26 Nov 2025 11:42:35 +0100 Message-ID: <20251126104241.291258-5-gmonaco@redhat.com> In-Reply-To: <20251126104241.291258-1-gmonaco@redhat.com> References: <20251126104241.291258-1-gmonaco@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" Previous changes refactored the da_monitor header file to avoid using macros. This implies a few changes in how to import and use da_monitor helpers: DECLARE_DA_MON_(name, type) is substituted by #define RV_MON_TYPE RV_MON_ Update the rvgen templates to reflect the changes. Reviewed-by: Nam Cao Signed-off-by: Gabriele Monaco --- tools/verification/rvgen/rvgen/dot2k.py | 6 +++-- .../rvgen/rvgen/templates/dot2k/main.c | 25 +++++++------------ 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/tools/verification/rvgen/rvgen/dot2k.py b/tools/verification/r= vgen/rvgen/dot2k.py index ed0a3c901106..d618a842fc52 100644 --- a/tools/verification/rvgen/rvgen/dot2k.py +++ b/tools/verification/rvgen/rvgen/dot2k.py @@ -38,9 +38,9 @@ class dot2k(Monitor, Dot2c): handle =3D "handle_start_run_event" if self.monitor_type =3D=3D "per_task": buff.append("\tstruct task_struct *p =3D /* XXX: how do I = get p? */;"); - buff.append("\tda_%s_%s(p, %s%s);" % (handle, self.name, e= vent, self.enum_suffix)); + buff.append("\tda_%s(p, %s%s);" % (handle, event, self.enu= m_suffix)); else: - buff.append("\tda_%s_%s(%s%s);" % (handle, self.name, even= t, self.enum_suffix)); + buff.append("\tda_%s(%s%s);" % (handle, event, self.enum_s= uffix)); buff.append("}") buff.append("") return '\n'.join(buff) @@ -66,6 +66,8 @@ class dot2k(Monitor, Dot2c): buff.append(" * Documentation/trace/rv/deterministic_automata.rs= t") buff.append(" */") buff.append("") + buff.append("#define MONITOR_NAME %s" % (self.name)) + buff.append("") =20 return buff =20 diff --git a/tools/verification/rvgen/rvgen/templates/dot2k/main.c b/tools/= verification/rvgen/rvgen/templates/dot2k/main.c index e0fd1134bd85..a14e4f0883db 100644 --- a/tools/verification/rvgen/rvgen/templates/dot2k/main.c +++ b/tools/verification/rvgen/rvgen/templates/dot2k/main.c @@ -6,7 +6,6 @@ #include #include #include -#include =20 #define MODULE_NAME "%%MODEL_NAME%%" =20 @@ -20,15 +19,9 @@ * This is the self-generated part of the monitor. Generally, there is no = need * to touch this section. */ +#define RV_MON_TYPE RV_MON_%%MONITOR_TYPE%% #include "%%MODEL_NAME%%.h" - -/* - * Declare the deterministic automata monitor. - * - * The rv monitor reference is needed for the monitor declaration. - */ -static struct rv_monitor rv_%%MODEL_NAME%%; -DECLARE_DA_MON_%%MONITOR_TYPE%%(%%MODEL_NAME%%, %%MIN_TYPE%%); +#include =20 /* * This is the instrumentation part of the monitor. @@ -42,7 +35,7 @@ static int enable_%%MODEL_NAME%%(void) { int retval; =20 - retval =3D da_monitor_init_%%MODEL_NAME%%(); + retval =3D da_monitor_init(); if (retval) return retval; =20 @@ -53,33 +46,33 @@ static int enable_%%MODEL_NAME%%(void) =20 static void disable_%%MODEL_NAME%%(void) { - rv_%%MODEL_NAME%%.enabled =3D 0; + rv_this.enabled =3D 0; =20 %%TRACEPOINT_DETACH%% =20 - da_monitor_destroy_%%MODEL_NAME%%(); + da_monitor_destroy(); } =20 /* * This is the monitor register section. */ -static struct rv_monitor rv_%%MODEL_NAME%% =3D { +static struct rv_monitor rv_this =3D { .name =3D "%%MODEL_NAME%%", .description =3D "%%DESCRIPTION%%", .enable =3D enable_%%MODEL_NAME%%, .disable =3D disable_%%MODEL_NAME%%, - .reset =3D da_monitor_reset_all_%%MODEL_NAME%%, + .reset =3D da_monitor_reset_all, .enabled =3D 0, }; =20 static int __init register_%%MODEL_NAME%%(void) { - return rv_register_monitor(&rv_%%MODEL_NAME%%, %%PARENT%%); + return rv_register_monitor(&rv_this, %%PARENT%%); } =20 static void __exit unregister_%%MODEL_NAME%%(void) { - rv_unregister_monitor(&rv_%%MODEL_NAME%%); + rv_unregister_monitor(&rv_this); } =20 module_init(register_%%MODEL_NAME%%); --=20 2.51.1