From nobody Mon Dec 1 23:11:14 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 B4B4331B83B for ; Wed, 26 Nov 2025 10:43:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764153790; cv=none; b=gC8OBavCOgcgnZ7qEdlg7rLwtZ0rrFobvkb5fF6uAps7cytdMHDfLI1ATgiWXZsl6qBuwvxY28itEU+I8js+B2zAMLzUF22r/OxbI/86BudtSW9GMVpvrqZJyReSptscNNyiPl34ivZRiN/hodN0Ta02MpdQOws5aS39y2TjQ1g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764153790; c=relaxed/simple; bh=xzvgaU/jHkHNHoLV+AEnOOFCrbedfXH4Y/myMGNYhj0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hwPtV5WvXg10qgvvn6CbS/nQLtIb2mvIBm7QtUlWJK4Hn5pVxUGud8EFcfhNXaejNNEabKMKqYvXnbM3JZ74u1xCArdvCG7JDIgTdS1LyKm1sdIIiH7PiVabYzuIfIJ/ib+MyA7+Y8QU6UUFU3Z4TyYwz6EztZFu/MUNxu4teHo= 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=bweTMHBT; arc=none smtp.client-ip=170.10.133.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="bweTMHBT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1764153787; 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=9JHlfLXvHQ/f3tSlurs7sciQCZwBwOndT3yQiCDkBXY=; b=bweTMHBTw4T4h6sUSaO7wMJ4QPaOR2Lu21nwSgn7pEg4M7IETwj+MPCPLR6k2SlqUehV/P HEWQrPEuo/BsXjUmCDBlson7RB6pkuET9up17nQAvq4AYy9PNa+ZVj4uExh4e0paaK4x+E bjCtAguWcvYJ5KBD6+05+8xBGUxNWRY= 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-256-gk_pSRvSOMqufiCybJnFbA-1; Wed, 26 Nov 2025 05:43:03 -0500 X-MC-Unique: gk_pSRvSOMqufiCybJnFbA-1 X-Mimecast-MFC-AGG-ID: gk_pSRvSOMqufiCybJnFbA_1764153782 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 077751800358; Wed, 26 Nov 2025 10:43:02 +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 EC42218004A3; Wed, 26 Nov 2025 10:42:58 +0000 (UTC) From: Gabriele Monaco To: linux-kernel@vger.kernel.org, Steven Rostedt , Nam Cao , Gabriele Monaco , Jonathan Corbet , linux-trace-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Subject: [PATCH 3/8] Documentation/rv: Adapt documentation after da_monitor refactoring Date: Wed, 26 Nov 2025 11:42:34 +0100 Message-ID: <20251126104241.291258-4-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_ da_handle_event_() is substituted by da_handle_event() Update the documentation to reflect the changes. Reviewed-by: Nam Cao Signed-off-by: Gabriele Monaco --- Documentation/trace/rv/monitor_synthesis.rst | 44 ++++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/Documentation/trace/rv/monitor_synthesis.rst b/Documentation/t= race/rv/monitor_synthesis.rst index 3a7d7b2f6cb6..cc5f97977a29 100644 --- a/Documentation/trace/rv/monitor_synthesis.rst +++ b/Documentation/trace/rv/monitor_synthesis.rst @@ -100,54 +100,52 @@ rv/da_monitor.h =20 This initial implementation presents three different types of monitor inst= ances: =20 -- ``#define DECLARE_DA_MON_GLOBAL(name, type)`` -- ``#define DECLARE_DA_MON_PER_CPU(name, type)`` -- ``#define DECLARE_DA_MON_PER_TASK(name, type)`` +- ``#define RV_MON_TYPE RV_MON_GLOBAL`` +- ``#define RV_MON_TYPE RV_MON_PER_CPU`` +- ``#define RV_MON_TYPE RV_MON_PER_TASK`` =20 -The first declares the functions for a global deterministic automata monit= or, -the second for monitors with per-cpu instances, and the third with per-task -instances. +The first sets up functions declaration for a global deterministic automata +monitor, the second for monitors with per-cpu instances, and the third with +per-task instances. =20 -In all cases, the 'name' argument is a string that identifies the monitor,= and -the 'type' argument is the data type used by rvgen on the representation of -the model in C. +In all cases, the C file must include the $(MODEL_NAME).h file (generated = by +`rvgen`), for example, to define the per-cpu 'wip' monitor, the `wip.c` so= urce +file must include:: =20 -For example, the wip model with two states and three events can be -stored in an 'unsigned char' type. Considering that the preemption control -is a per-cpu behavior, the monitor declaration in the 'wip.c' file is:: - - DECLARE_DA_MON_PER_CPU(wip, unsigned char); + #define RV_MON_TYPE RV_MON_PER_CPU + #include "wip.h" + #include =20 The monitor is executed by sending events to be processed via the functions presented below:: =20 - da_handle_event_$(MONITOR_NAME)($(event from event enum)); - da_handle_start_event_$(MONITOR_NAME)($(event from event enum)); - da_handle_start_run_event_$(MONITOR_NAME)($(event from event enum)); + da_handle_event($(event from event enum)); + da_handle_start_event($(event from event enum)); + da_handle_start_run_event($(event from event enum)); =20 -The function ``da_handle_event_$(MONITOR_NAME)()`` is the regular case whe= re +The function ``da_handle_event()`` is the regular case where the event will be processed if the monitor is processing events. =20 When a monitor is enabled, it is placed in the initial state of the automa= ta. However, the monitor does not know if the system is in the *initial state*. =20 -The ``da_handle_start_event_$(MONITOR_NAME)()`` function is used to notify= the +The ``da_handle_start_event()`` function is used to notify the monitor that the system is returning to the initial state, so the monitor = can start monitoring the next event. =20 -The ``da_handle_start_run_event_$(MONITOR_NAME)()`` function is used to no= tify +The ``da_handle_start_run_event()`` function is used to notify the monitor that the system is known to be in the initial state, so the monitor can start monitoring and monitor the current event. =20 Using the wip model as example, the events "preempt_disable" and "sched_waking" should be sent to monitor, respectively, via [2]:: =20 - da_handle_event_wip(preempt_disable_wip); - da_handle_event_wip(sched_waking_wip); + da_handle_event(preempt_disable_wip); + da_handle_event(sched_waking_wip); =20 While the event "preempt_enabled" will use:: =20 - da_handle_start_event_wip(preempt_enable_wip); + da_handle_start_event(preempt_enable_wip); =20 To notify the monitor that the system will be returning to the initial sta= te, so the system and the monitor should be in sync. --=20 2.51.1