From nobody Thu Apr 2 01:54:03 2026 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 4710F3128D4 for ; Mon, 23 Feb 2026 16:30:33 +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=1771864234; cv=none; b=KpeEe9oE3WxjDfNFkThaiKHyqyI1G8uBrcHVXBsfCAaUVLttq5FccYRM9zKiGV2gL0Q1/p2ClHgGVp8oYSEq89QmUq9DTUFjDEO6C5fZrnWFY1TXhQ0mClKxU0B+tW7PvxPeUIAUTRW9aZGWcX6P9scBXs3LQfT8uXIS8T96z2U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771864234; c=relaxed/simple; bh=JKCYNEeN/DjkXwRGymqHAF0dsNfsOprRq4sv49NAUYM=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FPCwNjAhoKQZGGPjJm3cwKQof43UkLyaMKbrwVE8NxeIHOEDlWSAvOH0lufr2hLi7zfRcdHkxwP3FDt5IH4pGZrLStqxZfA487KgoyOYFyj2dnufeVj+vqdEoo66yE8o/XyeugspqXMWPYW8MJuev4CaolmP+5935x9GXJ3IvMU= 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=fO6DShav; 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="fO6DShav" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771864232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C80re9BR9cuOqri0fwco4+uqG9iMQO/SIrKYil8gync=; b=fO6DShavd0QZiV55jirN8RswEat8d+RlrDS9DOBeJmWD8TppDxTwnuFuJLqlqdjPdQkWnm 37CKYP616dG6lHtQAzCSYmKMOf0V5vRsSUQMItCHvyoqnJbOLAQncSOr1VRSLFBv+O92GP qA3gOQjT5fahaDH/zjiE6PvDSS246To= 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-269-bnehINCWOPKbnii0F-GiWQ-1; Mon, 23 Feb 2026 11:30:30 -0500 X-MC-Unique: bnehINCWOPKbnii0F-GiWQ-1 X-Mimecast-MFC-AGG-ID: bnehINCWOPKbnii0F-GiWQ_1771864229 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 95F3019560B2; Mon, 23 Feb 2026 16:30:29 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.88.94]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7DC811800669; Mon, 23 Feb 2026 16:30:27 +0000 (UTC) From: Wander Lairson Costa To: Steven Rostedt , Gabriele Monaco , Nam Cao , Wander Lairson Costa , linux-trace-kernel@vger.kernel.org (open list:RUNTIME VERIFICATION (RV)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v3 16/19] rv/rvgen: extract node marker string to class constant Date: Mon, 23 Feb 2026 13:17:59 -0300 Message-ID: <20260223162407.147003-17-wander@redhat.com> In-Reply-To: <20260223162407.147003-1-wander@redhat.com> References: <20260223162407.147003-1-wander@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" Add a node_marker class constant to the Automata class to replace the hardcoded "{node" string literal used throughout the DOT file parsing logic. This follows the existing pattern established by the init_marker and invalid_state_str class constants in the same class. The "{node" string is used as a marker to identify node declaration lines in DOT files during state variable extraction and cursor positioning. Extracting it to a named constant improves code maintainability and makes the marker's purpose explicit. Signed-off-by: Wander Lairson Costa Reviewed-by: Gabriele Monaco --- tools/verification/rvgen/rvgen/automata.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/verification/rvgen/rvgen/automata.py b/tools/verificatio= n/rvgen/rvgen/automata.py index 6613a9d6159a9..fd2a4a0c3f6eb 100644 --- a/tools/verification/rvgen/rvgen/automata.py +++ b/tools/verification/rvgen/rvgen/automata.py @@ -44,6 +44,7 @@ class Automata: =20 invalid_state_str =3D "INVALID_STATE" init_marker =3D "__init_" + node_marker =3D "{node" # val can be numerical, uppercase (constant or macro), lowercase (para= meter or function) # only numerical values should have units constraint_rule =3D re.compile(r""" @@ -112,7 +113,7 @@ class Automata: for cursor, line in enumerate(self.__dot_lines): split_line =3D line.split() =20 - if len(split_line) and split_line[0] =3D=3D "{node": + if len(split_line) and split_line[0] =3D=3D self.node_marker: return cursor =20 raise AutomataError("Could not find a beginning state") @@ -127,9 +128,9 @@ class Automata: continue =20 if state =3D=3D 0: - if line[0] =3D=3D "{node": + if line[0] =3D=3D self.node_marker: state =3D 1 - elif line[0] !=3D "{node": + elif line[0] !=3D self.node_marker: break else: raise AutomataError("Could not find beginning event") @@ -151,7 +152,7 @@ class Automata: # process nodes for line in islice(self.__dot_lines, cursor, None): split_line =3D line.split() - if not split_line or split_line[0] !=3D "{node": + if not split_line or split_line[0] !=3D self.node_marker: break =20 raw_state =3D split_line[-1] --=20 2.53.0