Re: [PATCH] rv: Add signal reactor

2025-10-02 Thread Gabriele Monaco
2025-10-02T14:56:23Z Nam Cao : > Thomas Weißschuh writes: >> I am wondering if it would make sense to add a new tracepoint that >> fires in addition of the reactors. That would allow multiple >> simultaneous consumers and also bespoke handlers in userspace. > > We do have tracepoints for each mon

Re: [PATCH 2/2] rv: Make rtapp/pagefault monitor depends on CONFIG_MMU

2025-10-02 Thread Gabriele Monaco
sense. Reviewed-by: Gabriele Monaco Thanks, Gabriele > > Fixes: 9162620eb604 ("rv: Add rtapp_pagefault monitor") > Signed-off-by: Nam Cao > Reported-by: kernel test robot > Closes: > https://lore.kernel.org/oe-kbuild-all/202509260455.6z9vkty4-...@intel.com/ >

Re: [PATCH 1/2] rv: Fully convert enabled_monitors to use list_head as iterator

2025-10-02 Thread Gabriele Monaco
as reported by Nathan. > > Convert everything to use struct list_head * as iterator. This also makes > enabled_monitors consistent with available_monitors. > Looks good to me and passes my tests. Reviewed-by: Gabriele Monaco Thanks, Gabriele > Fixes: de090d1ccae

Re: [PATCH v2 03/20] rv: Unify DA event handling functions across monitor types

2025-10-02 Thread Gabriele Monaco
On Thu, 2025-10-02 at 11:14 +0200, Nam Cao wrote: > Gabriele Monaco writes: > > +/* > > + * da_get_task - return the task associated to the monitor > > + */ > > +static inline struct task_struct *da_get_task(struct da_monitor *da_mon) > > +{ > > + return

Re: [PATCH v2 11/20] verification/rvgen: Allow spaces in and events strings

2025-10-02 Thread Gabriele Monaco
On Thu, 2025-10-02 at 13:03 +0200, Nam Cao wrote: > Gabriele Monaco writes: > > > Currently the automata parser assumes event strings don't have any > > space, this stands true for event names, but can be a wrong assumption > > if we want to store other informat

[PATCH 2/2] selftests/verification: Add initial RV tests

2025-09-26 Thread Gabriele Monaco
the printk reactor works. Also validate disabling reacting_on or monitoring_on prevents reactions. These tests use the ftracetest suite. Signed-off-by: Gabriele Monaco --- MAINTAINERS | 1 + .../testing/selftests/verification/.gitignore | 2 + tools

[PATCH 1/2] selftest/ftrace: Generalise ftracetest to use with RV

2025-09-26 Thread Gabriele Monaco
names like initialize_ftrace to initialize_system. Add the --rv argument to set up the test for rv, basically changing the trace directory to $TRACING_DIR/rv and displaying an error if that cannot be found. This prepares for rv selftests inclusion. Signed-off-by: Gabriele Monaco --- tools/testing

[PATCH 0/2] selftests/verification: Add initial RV tests

2025-09-26 Thread Gabriele Monaco
in [1]. [1] - https://lore.kernel.org/lkml/87tt0t4u19@yellow.woof To: Steven Rostedt To: Nam Cao Cc: Masami Hiramatsu Cc: John Kacur Cc: Waylon Cude Cc: linux-trace-kernel@vger.kernel.org Cc: linux-kselft...@vger.kernel.org Gabriele Monaco (2): selftest/ftrace: Generalise ftracetest to

Re: [PATCH] rv: Fix wrong type cast in enabled_monitors_next()

2025-09-23 Thread Gabriele Monaco
On Tue, 2025-09-23 at 10:44 +0200, Nam Cao wrote: > Gabriele Monaco writes: > > Looks reasonable, can you work on the fix? > > I see Steve is out for conferences so this won't be too urgent. > > The fix is in my previous email. I confirm enabled_monitors works with you

Re: [PATCH] rv: Fix wrong type cast in enabled_monitors_next()

2025-09-23 Thread Gabriele Monaco
On Tue, 2025-09-23 at 07:28 +0200, Nam Cao wrote: > Hi Nathan, > Thanks for finding this! > Nathan Chancellor writes: > > I am seeing a crash when reading from > > /sys/kernel/tracing/rv/enabled_monitors > > on a couple of my arm64 boxes running Fedora after this change, which > > landed in mai

[PATCH v2 00/20] rv: Add Hybrid Automata monitor type, per-object and deadline monitors

2025-09-20 Thread Gabriele Monaco
l.org/lkml/20250814150809.140739-1-gmon...@redhat.com To: Steven Rostedt To: Nam Cao Cc: Tomas Glozar Cc: Juri Lelli Cc: Clark Williams Cc: John Kacur Cc: linux-trace-kernel@vger.kernel.org Gabriele Monaco (20): rv: Refactor da_monitor to minimise macros rv: Cleanup da_monitor after refactor rv

[PATCH v2 18/20] rv: Add support for per-object monitors in DA/HA

2025-09-20 Thread Gabriele Monaco
The monitor storage (e.g. the rv monitor, pointer to the target, etc.) is stored in a hash table indexed by id. Monitor storage objects are automatically allocated unless specified otherwise (e.g. if the creation context is unsafe for allocation). Signed-off-by: Gabriele Monaco --- include/linux

[PATCH v2 05/20] verification/rvgen: Adapt dot2k and templates after refactoring da_monitor.h

2025-09-20 Thread Gabriele Monaco
: 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/rvgen/rvgen/dot2k.py

[PATCH v2 15/20] rv: Convert the opid monitor to a hybrid automaton

2025-09-19 Thread Gabriele Monaco
ng on PREEMPT_RT only and allows the monitor to be built on kernels without the preemptirqs tracepoints. [1] - https://lore.kernel.org/lkml/20250625120823.60600-1-gmon...@redhat.com Signed-off-by: Gabriele Monaco --- Documentation/trace/rv/monitor_sched.rst | 62 +++- kernel/trace/rv/monitors

Re: [PATCH v2 16/20] sched: Export hidden tracepoints to modules

2025-09-19 Thread Gabriele Monaco
2025-09-19T15:36:50Z Steven Rostedt : > On Fri, 19 Sep 2025 16:09:50 +0200 > Gabriele Monaco wrote: > >> The tracepoints sched_entry, sched_exit and sched_set_need_resched >> are not exported to tracefs as trace events, this allows only kernel >> code to access them.

[PATCH v2 10/20] rv: Add Hybrid Automata monitor type

2025-09-19 Thread Gabriele Monaco
y) on state and events. Signed-off-by: Gabriele Monaco --- include/linux/rv.h | 38 +++ include/rv/da_monitor.h| 59 - include/rv/ha_monitor.h| 469 + kernel/trace/rv/Kconfig| 13 + kernel/trace/rv/rv_trace.h | 63 + 5 files changed

[PATCH v2 02/20] rv: Cleanup da_monitor after refactor

2025-09-19 Thread Gabriele Monaco
ge in struct da_monitor is fixed to unsigned int. Remove empty and no longer required macros and substitute the type parameter with the appropriate enum. Additionally break long line and adjust the format overall. Signed-off-by: Gabriele Monaco --- include/rv/automata.h | 24 +++- inclu

[PATCH v2 08/20] verification/dot2c: Remove superfluous enum assignment and add last comma

2025-09-19 Thread Gabriele Monaco
es or events are added. Remove the assignment to 0 and add a comma to last elements, this simplifies the logic for the code generator. Signed-off-by: Gabriele Monaco --- kernel/trace/rv/monitors/nrp/nrp.h | 20 +++--- kernel/trace/rv/monitors/opid/opid.h| 22 +++ kernel/

[PATCH v2 14/20] rv: Add sample hybrid monitors stall

2025-09-19 Thread Gabriele Monaco
Add a sample monitor to showcase hybrid/timed automata. The stall monitor identifies tasks stalled for longer than a threshold and reacts when that happens. Signed-off-by: Gabriele Monaco --- Documentation/tools/rv/index.rst | 1 + Documentation/tools/rv/rv-mon-stall.rst

[PATCH v2 03/20] rv: Unify DA event handling functions across monitor types

2025-09-19 Thread Gabriele Monaco
monitors. Signed-off-by: Gabriele Monaco --- include/rv/da_monitor.h | 303 +++- 1 file changed, 142 insertions(+), 161 deletions(-) diff --git a/include/rv/da_monitor.h b/include/rv/da_monitor.h index 7c3540d0f64e..05b216f90f93 100644 --- a/include/rv

[PATCH v2 20/20] rv: Add deadline monitors

2025-09-19 Thread Gabriele Monaco
deadiline Signed-off-by: Gabriele Monaco --- Documentation/trace/rv/index.rst | 1 + Documentation/trace/rv/monitor_deadline.rst | 151 ++ kernel/trace/rv/Kconfig | 5 + kernel/trace/rv/Makefile | 3 + kernel/trace/rv

[PATCH v2 17/20] sched: Add deadline tracepoints

2025-09-19 Thread Gabriele Monaco
hard): Called when a deadline server is stopped (hard) or put to idle waiting for the next period (!hard) Those tracepoints can be useful to validate the deadline scheduler with RV and are not exported to tracefs. Signed-off-by: Gabriele Monaco --- include/trace/events/sched.h

[PATCH v2 19/20] verification/rvgen: Add support for per-obj monitors

2025-09-19 Thread Gabriele Monaco
. Signed-off-by: Gabriele Monaco --- tools/verification/rvgen/rvgen/dot2k.py | 6 ++ tools/verification/rvgen/rvgen/generator.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/verification/rvgen/rvgen/dot2k.py b/tools/verification/rvgen/rvgen/dot2k.py index

[PATCH v2 16/20] sched: Export hidden tracepoints to modules

2025-09-19 Thread Gabriele Monaco
tracepoints being exported. Export the 3 not exported tracepoints. Note that sched_set_state is already exported as the macro is called from modules. [1] - https://github.com/qais-yousef/sched_tp.git Signed-off-by: Gabriele Monaco --- kernel/sched/core.c | 3 +++ 1 file changed, 3 insertions(+) diff

[PATCH v2 12/20] verification/rvgen: Add support for Hybrid Automata

2025-09-19 Thread Gabriele Monaco
(separated by \n). The tool can now generate the appropriate code to validate constraints at runtime according to the dot specification. Signed-off-by: Gabriele Monaco --- tools/verification/rvgen/__main__.py | 8 +- tools/verification/rvgen/rvgen/automata.py| 141 +- tools

[PATCH v2 13/20] Documentation/rv: Add documentation about hybrid automata

2025-09-19 Thread Gabriele Monaco
Describe theory and implementation of hybrid automata in the dedicated page hybrid_automata.rst Include a section on how to integrate a hybrid automaton in monitor_synthesis.rst Also remove a hanging $ in deterministic_automata.rst Signed-off-by: Gabriele Monaco --- .../trace/rv

[PATCH v2 11/20] verification/rvgen: Allow spaces in and events strings

2025-09-19 Thread Gabriele Monaco
rings. Signed-off-by: Gabriele Monaco --- tools/verification/rvgen/rvgen/automata.py | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/verification/rvgen/rvgen/automata.py b/tools/verification/rvgen/rvgen/automata.py index 3f06aef8d4fd..977ba859c34e 100644 --- a/

[PATCH v2 06/20] verification/rvgen: Annotate DA functions with types

2025-09-19 Thread Gabriele Monaco
Functions in automata.py, dot2c.py and dot2k.py don't have type annotations and it can get complicated to remember how to use them. Add minimal type annotations. Signed-off-by: Gabriele Monaco --- tools/verification/rvgen/rvgen/automata.py | 20 +-- tools/verification/rvgen/

[PATCH v2 07/20] verification/dot2c: Remove __buff_to_string() and cleanup

2025-09-19 Thread Gabriele Monaco
str.join() can do what __buff_to_string() does. Therefore replace __buff_to_string() to make the scripts more pythonic. Also clean and remove some intermediate functions. Reviewed-by: Nam Cao Signed-off-by: Gabriele Monaco --- tools/verification/rvgen/rvgen/dot2c.py | 35

[PATCH v2 09/20] verification/rvgen: Remove unused variable declaration from containers

2025-09-19 Thread Gabriele Monaco
The monitor container source files contained a declaration and a definition for the rv_monitor variable. The former is superfluous and can be removed. Remove the variable declaration from the template as well as the existing monitor containers. Reviewed-by: Nam Cao Signed-off-by: Gabriele

[PATCH v2 04/20] Documentation/rv: Adapt documentation after da_monitor refactoring

2025-09-19 Thread Gabriele Monaco
documentation to reflect the changes. 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/trace/rv

[PATCH v2 01/20] rv: Refactor da_monitor to minimise macros

2025-09-19 Thread Gabriele Monaco
mpty macro definitions to ease review of this change with diff tools, but cleanup is required. Also adapt existing monitors to keep the build working. Signed-off-by: Gabriele Monaco --- include/linux/rv.h | 4 + include/rv/automata.h | 132 ++-- include/rv/da

Re: [PATCH] rv: Add signal reactor

2025-09-19 Thread Gabriele Monaco
On Fri, 2025-09-19 at 12:49 +0200, Thomas Weißschuh wrote: > Reactions of the existing reactors are not easily detectable from programs > and also not easily attributable to the triggering task. > This makes it hard to test the monitors themselves programmatically. > > The signal reactors allows a

Re: [PATCH] rv: Fix boot failure when kernel lockdown is active

2025-09-19 Thread Gabriele Monaco
On Thu, 2025-09-18 at 11:48 +0200, Tomas Glozar wrote: > čt 18. 9. 2025 v 10:36 odesílatel Gabriele Monaco napsal: > > > > Yeah totally, I have the feeling that with the kernel there's no such a > > thing as a "theoretical bug", kinda like a good cons

Re: [PATCH] rv: Fix boot failure when kernel lockdown is active

2025-09-18 Thread Gabriele Monaco
On Wed, 2025-09-17 at 16:07 +0200, Nam Cao wrote: > Gabriele Monaco writes: > > On Wed, 2025-09-17 at 12:57 +, Xiu Jianfeng wrote: > > > From: Xiu Jianfeng > > > > > > When booting kernel with lockdown=confidentiality parameter, the > > > sys

Re: [PATCH] rv: Fix boot failure when kernel lockdown is active

2025-09-17 Thread Gabriele Monaco
On Wed, 2025-09-17 at 12:57 +, Xiu Jianfeng wrote: > From: Xiu Jianfeng > > When booting kernel with lockdown=confidentiality parameter, the > system > will hang at rv_register_reactor() due to waiting for > rv_interface_lock, > as shown in the following log, > Thanks for finding this, the

[PATCH v12 2/9] timers: Rename tmigr 'online' bit to 'available'

2025-09-15 Thread Gabriele Monaco
: Frederic Weisbecker Signed-off-by: Gabriele Monaco --- include/trace/events/timer_migration.h | 4 ++-- kernel/time/timer_migration.c | 22 +++--- kernel/time/timer_migration.h | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include

Re: [PATCH] rv/ltl_monitor: adapt handle_task_newtask to u64 clone_flags

2025-09-09 Thread Gabriele Monaco
> However, ltl_monitor was not adapted, resulting in a faulty callback. > This also resulted in an lkp build warning due to > -Wincompatible-pointer-types. > Looks good to me, thanks! Reviewed-by: Gabriele Monaco Adding Nam (author of LTL) to the loop. Gabriele > Fixes: edd3cb

Re: [RFC PATCH 16/17] verification/rvgen: Add support for per-obj monitors

2025-09-04 Thread Gabriele Monaco
On Thu, 2025-09-04 at 10:20 +0200, Nam Cao wrote: > On Thu, Aug 14, 2025 at 05:08:08PM +0200, Gabriele Monaco wrote: > > +    def fill_per_obj_definitions(self) -> list: > > +    if self.monitor_type == "per_obj": > > +    return [""&qu

Re: [PATCH] rv: Fix missing mutex unlock in rv_register_monitor()

2025-09-04 Thread Gabriele Monaco
On Thu, 2025-09-04 at 09:19 +0200, Nam Cao wrote: > Am I hallucinating, or the fix tag is already there? I should stop doing 3 things at the same time, my bad :') > > > (Adding Nam to the loop, as author of that patch) > > Thanks for CC! > > Reviewed-by: Nam Cao > > I have been debating whet

Re: [PATCH] rv: Fix missing mutex unlock in rv_register_monitor()

2025-09-04 Thread Gabriele Monaco
or path jump to out_unlock, ensuring that the > mutex is always released before returning. > > Fixes: 24cbfe18d55a ("rv: Merge struct rv_monitor_def into struct > rv_monitor") > Signed-off-by: Zhen Ni Good catch, thank you! Reviewed-by: Gabriele Monaco I would also add a:

Re: [RFC PATCH 10/17] verification/rvgen: Add support for Hybrid Automata

2025-08-25 Thread Gabriele Monaco
On Mon, 2025-08-25 at 11:55 +0200, Nam Cao wrote: > On Thu, Aug 14, 2025 at 05:08:02PM +0200, Gabriele Monaco wrote: > > for i in event.split("\\n"): > > +    if ";" in i: > > +    # if the event c

Re: [RFC PATCH 10/17] verification/rvgen: Add support for Hybrid Automata

2025-08-25 Thread Gabriele Monaco
On Mon, 2025-08-25 at 12:06 +0200, Nam Cao wrote: > On Thu, Aug 14, 2025 at 05:08:02PM +0200, Gabriele Monaco wrote: > > +    def fill_constr_func(self) -> list[str]: > > +    buff = [] > > +    if self.constraints: > > +    buff.append( > > +&q

Re: [RFC PATCH 08/17] rv: Add Hybrid Automata monitor type

2025-08-25 Thread Gabriele Monaco
On Mon, 2025-08-25 at 10:13 +0200, Nam Cao wrote: > On Mon, Aug 25, 2025 at 09:48:23AM +0200, Gabriele Monaco wrote: > > On Thu, 2025-08-21 at 14:18 +0200, Nam Cao wrote: > > > On Thu, Aug 14, 2025 at 05:08:00PM +0200, Gabriele Monaco wrote: > > > > Deterministi

Re: [RFC PATCH 01/17] rv: Refactor da_monitor to minimise macros

2025-08-25 Thread Gabriele Monaco
On Thu, 2025-08-21 at 10:49 +0200, Gabriele Monaco wrote: > On Thu, 2025-08-21 at 10:14 +0200, Nam Cao wrote: > > > > +#define RV_AUTOMATON_NAME CONCATENATE(automaton_, MONITOR_NAME) > > > +#define EVENT_MAX CONCATENATE(event_max_, MONITOR_NAME) > > > +#define

Re: [RFC PATCH 08/17] rv: Add Hybrid Automata monitor type

2025-08-25 Thread Gabriele Monaco
On Thu, 2025-08-21 at 14:18 +0200, Nam Cao wrote: > On Thu, Aug 14, 2025 at 05:08:00PM +0200, Gabriele Monaco wrote: > > Deterministic automata define which events are allowed in every > > state, > > but cannot define more sophisticated constraint taking into account

Re: [RFC PATCH 09/17] verification/rvgen: Allow spaces in and events strings

2025-08-21 Thread Gabriele Monaco
2025-08-21T15:15:36Z Nam Cao : > We could also rewrite the parser using ply with a well-defined grammar and > tokenizer, like how the LTL parser is implemented. Doing it this way would > be easier to validate as well, because the grammar would be mostly > copy-pasted from the specification. Good i

Re: [RFC PATCH 09/17] verification/rvgen: Allow spaces in and events strings

2025-08-21 Thread Gabriele Monaco
On Thu, 2025-08-21 at 14:22 +0200, Nam Cao wrote: > On Thu, Aug 14, 2025 at 05:08:01PM +0200, Gabriele Monaco wrote: > > Currently the automata parser assumes event strings don't have any > > space, this stands true for event names, but can be a wrong > > assumption >

Re: [RFC PATCH 10/17] verification/rvgen: Add support for Hybrid Automata

2025-08-21 Thread Gabriele Monaco
On Thu, 2025-08-21 at 14:38 +0200, Nam Cao wrote: > On Thu, Aug 14, 2025 at 05:08:02PM +0200, Gabriele Monaco wrote: > > +import re > > Oh no.. I was tempted to suggest rewriting the dot parser with regex but I guess I'll hold that back! > > > +from typing imp

Re: [RFC PATCH 05/17] verification/rvgen: Annotate DA functions with types

2025-08-21 Thread Gabriele Monaco
On Thu, 2025-08-21 at 10:29 +0200, Nam Cao wrote: > On Thu, Aug 14, 2025 at 05:07:57PM +0200, Gabriele Monaco wrote: > > Functions in automata.py, dot2c.py and dot2k.py don't have type > > annotations and it can get complicated to remember how to use them. > > > &

Re: [RFC PATCH 01/17] rv: Refactor da_monitor to minimise macros

2025-08-21 Thread Gabriele Monaco
On Thu, 2025-08-21 at 10:14 +0200, Nam Cao wrote: > On Thu, Aug 14, 2025 at 05:07:53PM +0200, Gabriele Monaco wrote: > > The da_monitor helper functions are generated from macros of the > > type: > > > > DECLARE_DA_FUNCTION(name, type) \ > > static void da_func_x

Re: [RFC PATCH 14/17] sched: Add deadline tracepoints

2025-08-19 Thread Gabriele Monaco
On Tue, 2025-08-19 at 16:02 +0200, Juri Lelli wrote: > On 19/08/25 12:34, Gabriele Monaco wrote: > > > > > > On Tue, 2025-08-19 at 12:12 +0200, Peter Zijlstra wrote: > > > On Tue, Aug 19, 2025 at 11:56:57AM +0200, Juri Lelli wrote: > > > > Hi! > >

Re: [RFC PATCH 08/17] rv: Add Hybrid Automata monitor type

2025-08-19 Thread Gabriele Monaco
On Tue, 2025-08-19 at 12:08 +0200, Juri Lelli wrote: > On 19/08/25 11:48, Gabriele Monaco wrote: > > That's a good point, I need to check the actual overhead.. > > > > One thing to note is that this timer is used only on state > > constraints, > > one cou

Re: [RFC PATCH 11/17] Documentation/rv: Add documentation about hybrid automata

2025-08-19 Thread Gabriele Monaco
On Tue, 2025-08-19 at 11:14 +0200, Juri Lelli wrote: > On 19/08/25 10:53, Juri Lelli wrote: > > Hi! > > > > On 14/08/25 17:08, Gabriele Monaco wrote: > > ... > > > > +  static bool verify_constraint(enum states curr_state, enum > > > events eve

Re: [RFC PATCH 11/17] Documentation/rv: Add documentation about hybrid automata

2025-08-19 Thread Gabriele Monaco
On Tue, 2025-08-19 at 10:53 +0200, Juri Lelli wrote: > Hi! > > On 14/08/25 17:08, Gabriele Monaco wrote: > > > > + > > +Examples > > + > > Maybe add subsection titles to better mark separation between > different examples? Sure, makes sense

Re: [RFC PATCH 14/17] sched: Add deadline tracepoints

2025-08-19 Thread Gabriele Monaco
On Tue, 2025-08-19 at 12:12 +0200, Peter Zijlstra wrote: > On Tue, Aug 19, 2025 at 11:56:57AM +0200, Juri Lelli wrote: > > Hi! > > > > On 14/08/25 17:08, Gabriele Monaco wrote: > > > Add the following tracepoints: > > > > > > * sched_dl_throttle

Re: [RFC PATCH 08/17] rv: Add Hybrid Automata monitor type

2025-08-19 Thread Gabriele Monaco
On Tue, 2025-08-19 at 11:18 +0200, Juri Lelli wrote: > Hi! > > On 14/08/25 17:08, Gabriele Monaco wrote: > > ... > > > +/* > > + * ha_monitor_init_env - setup timer and reset all environment > > + * > > + * Called from a hook in the DA s

Re: [PATCH] Documentation/rv: Fix minor typo in monitor_synthesis page

2025-08-18 Thread Gabriele Monaco
On Sun, 2025-08-10 at 16:42 +0530, Gopi Krishna Menon wrote: > Specifically, fix spelling of "practice" > > Signed-off-by: Gopi Krishna Menon Thanks for finding this! Reviewed-by: Gabriele Monaco > --- >  Documentation/trace/rv/monitor_synthesis.rst | 2 +- >

[RFC PATCH 16/17] verification/rvgen: Add support for per-obj monitors

2025-08-14 Thread Gabriele Monaco
. Signed-off-by: Gabriele Monaco --- tools/verification/rvgen/rvgen/dot2k.py | 20 tools/verification/rvgen/rvgen/generator.py | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/tools/verification/rvgen/rvgen/dot2k.py b/tools/verification/rvgen/rvgen

[RFC PATCH 09/17] verification/rvgen: Allow spaces in and events strings

2025-08-14 Thread Gabriele Monaco
rings. Signed-off-by: Gabriele Monaco --- tools/verification/rvgen/rvgen/automata.py | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/verification/rvgen/rvgen/automata.py b/tools/verification/rvgen/rvgen/automata.py index 76d7a3cfaec6..c637cf4ee749 100644 --- a/

[RFC PATCH 14/17] sched: Add deadline tracepoints

2025-08-14 Thread Gabriele Monaco
hard): Called when a deadline server is stopped (hard) or put to idle waiting for the next period (!hard) Those tracepoints can be useful to validate the deadline scheduler with RV and are not exported to tracefs. Signed-off-by: Gabriele Monaco --- include/trace/events/sched.h

[RFC PATCH 17/17] rv: Add deadline monitors

2025-08-14 Thread Gabriele Monaco
deadiline Signed-off-by: Gabriele Monaco --- Documentation/trace/rv/monitor_deadline.rst | 111 kernel/trace/rv/Kconfig | 5 + kernel/trace/rv/Makefile | 3 + kernel/trace/rv/monitors/deadline/Kconfig | 5 + kernel/trace/rv/monitors

[RFC PATCH 15/17] rv: Add support for per-object monitors in DA/HA

2025-08-14 Thread Gabriele Monaco
in a hash table indexed by id. Monitor storage objects are automatically allocated unless specified otherwise (e.g. if the creation context is unsafe for allocation). Signed-off-by: Gabriele Monaco --- include/linux/rv.h | 2 +- include/rv/da_common.h | 21 +++ include/rv/da_monitor.h

[RFC PATCH 12/17] rv: Add sample hybrid monitors stall

2025-08-14 Thread Gabriele Monaco
Add a sample monitor to showcase hybrid/timed automata. The stall monitor identifies tasks stalled for longer than a threshold and reacts when that happens. Signed-off-by: Gabriele Monaco --- Documentation/tools/rv/rv-mon-stall.rst | 44 +++ Documentation/trace/rv/monitor_stall.rst

[RFC PATCH 07/17] verification/rvgen: Remove unused variable declaration from containers

2025-08-14 Thread Gabriele Monaco
The monitor container source files contained a declaration and a definition for the rv_monitor variable. The former is superfluous and can be removed. Remove the variable declaration from the template as well as the existing monitor containers. Signed-off-by: Gabriele Monaco --- kernel/trace

[RFC PATCH 05/17] verification/rvgen: Annotate DA functions with types

2025-08-14 Thread Gabriele Monaco
Functions in automata.py, dot2c.py and dot2k.py don't have type annotations and it can get complicated to remember how to use them. Add minimal type annotations. Signed-off-by: Gabriele Monaco --- tools/verification/rvgen/rvgen/automata.py | 18 ++--- tools/verification/rvgen/

[RFC PATCH 06/17] verification/dot2c: Remove __buff_to_string() and cleanup

2025-08-14 Thread Gabriele Monaco
str.join() can do what __buff_to_string() does. Therefore replace __buff_to_string() to make the scripts more pythonic. Also clean and remove some intermediate functions. Signed-off-by: Gabriele Monaco --- tools/verification/rvgen/rvgen/dot2c.py | 35 + 1 file changed

[RFC PATCH 08/17] rv: Add Hybrid Automata monitor type

2025-08-14 Thread Gabriele Monaco
y) on state and events. Signed-off-by: Gabriele Monaco --- include/linux/rv.h | 26 +++ include/rv/da_monitor.h| 45 - include/rv/ha_monitor.h| 384 + kernel/trace/rv/Kconfig| 13 ++ kernel/trace/rv/rv_trace.h | 63 ++ 5 files ch

[RFC PATCH 03/17] Documentation/rv: Adapt documentation after da_monitor refactoring

2025-08-14 Thread Gabriele Monaco
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/trace/rv/monitor_synthesis.rst index ac808a7554f5..ce0c1a5104d4

[RFC PATCH 04/17] verification/rvgen: Adapt dot2k and templates after refactoring da_monitor.h

2025-08-14 Thread Gabriele Monaco
Signed-off-by: Gabriele Monaco --- tools/verification/rvgen/rvgen/dot2k.py | 6 -- .../rvgen/rvgen/templates/dot2k/main.c | 17 + 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/tools/verification/rvgen/rvgen/dot2k.py b/tools/verification

[RFC PATCH 02/17] rv: Cleanup da_monitor after refactor

2025-08-14 Thread Gabriele Monaco
ge in struct da_monitor is fixed to unsigned int. Remove empty and no longer required macros and substitute the type parameter with the appropriate enum. Additionally break long line and adjust the format overall. Signed-off-by: Gabriele Monaco --- include/rv/automata.h | 24 +++-- inclu

[RFC PATCH 13/17] rv: Convert the opid monitor to a hybrid automaton

2025-08-14 Thread Gabriele Monaco
ng on PREEMPT_RT only and allows the monitor to be built on kernels without the preemptirqs tracepoints. [1] - https://lore.kernel.org/lkml/20250625120823.60600-1-gmon...@redhat.com Signed-off-by: Gabriele Monaco --- Documentation/trace/rv/monitor_sched.rst | 62 +++- kernel/trace/rv/monitors

[RFC PATCH 11/17] Documentation/rv: Add documentation about hybrid automata

2025-08-14 Thread Gabriele Monaco
Describe theory and implementation of hybrid automata in the dedicated page hybrid_automata.rst Include a section on how to integrate a hybrid automaton in monitor_synthesis.rst Also remove a hanging $ in deterministic_automata.rst Signed-off-by: Gabriele Monaco --- .../trace/rv

[RFC PATCH 10/17] verification/rvgen: Add support for Hybrid Automata

2025-08-14 Thread Gabriele Monaco
(separated by \n). The tool can now generate the appropriate code to validate constraints at runtime according to the dot specification. Signed-off-by: Gabriele Monaco --- tools/verification/rvgen/__main__.py | 8 +- tools/verification/rvgen/rvgen/automata.py| 128 +++- tools

[RFC PATCH 01/17] rv: Refactor da_monitor to minimise macros

2025-08-14 Thread Gabriele Monaco
mpty macro definitions to ease review of this change with diff tools, but cleanup is required. Also adapt existing monitors to keep the build working. Signed-off-by: Gabriele Monaco --- include/linux/rv.h | 4 + include/rv/automata.h | 132 ++-- include/rv/da

[RFC PATCH 00/17] rv: Add Hybrid Automata monitor type, per-object and deadline monitors

2025-08-14 Thread Gabriele Monaco
am Cao Cc: Tomas Glozar Cc: Juri Lelli Cc: Clark Williams Cc: John Kacur Cc: linux-trace-kernel@vger.kernel.org Gabriele Monaco (17): rv: Refactor da_monitor to minimise macros rv: Cleanup da_monitor after refactor Documentation/rv: Adapt documentation after da_monitor refactoring ve

Re: [PATCH v3 4/5] sched: Add task enqueue/dequeue trace points

2025-08-12 Thread Gabriele Monaco
On Mon, 2025-08-11 at 10:40 +0200, Nam Cao wrote: > Add trace points into enqueue_task() and dequeue_task(). They are > useful to implement RV monitor which validates RT scheduling. > > Signed-off-by: Nam Cao > --- Peter, Ingo, this patch adds new tracepoints in the scheduler do agree with the c

Re: [PATCH v2] include/linux/rv.h: remove redundant include file

2025-08-11 Thread Gabriele Monaco
ry. Also, it shouldn't happen, but sometimes the order of inclusion matters. Anyway this isn't the case here (builds fine locally) and when it is, the test robot should notice. Looks good to me overall, thanks! Reviewed-by: Gabriele Monaco > > Fixes: 24cbfe18d55a ("rv: Merge

Re: [PATCH] include/linux/rv.h: remove redundant include file

2025-08-11 Thread Gabriele Monaco
2025-08-09T06:36:58Z Akhilesh Patil : > Remove redundant include to clean up the code. > Fix this redundancy introduced by commit [1]. > > Fixes: 24cbfe18d55a ("rv: Merge struct rv_monitor_def into struct > rv_monitor") [1] > Reported-by: kernel test robot > Closes: https://lore.kernel.org/r/20

Re: [PATCH v2 5/5] rv: Add rts monitor

2025-08-08 Thread Gabriele Monaco
On Fri, 2025-08-08 at 07:29 +0200, Nam Cao wrote: > Gabriele Monaco writes: > > The monitor shows a violation also in case of priority inversion > > boosting, e.g.: > > > >  stress-ng --prio-inv 2 > > This looks like something that would trigger the fair deadli

Re: [PATCH v2 3/5] verification/rvgen/ltl: Support per-cpu monitor generation

2025-08-07 Thread Gabriele Monaco
On Fri, 2025-08-08 at 07:12 +0200, Nam Cao wrote: > Gabriele Monaco writes: > > I get you're trying to be more type-agnostic, but I believe this > > /online/ is a bit imprecise, unless you register a hotplug handler > > and just initialise the online CPUs (much of an o

Re: [PATCH v2 5/5] rv: Add rts monitor

2025-08-07 Thread Gabriele Monaco
On Wed, 2025-08-06 at 10:01 +0200, Nam Cao wrote: > Add "real-time scheduling" monitor, which validates that SCHED_RR and > SCHED_FIFO tasks are scheduled before tasks with normal and > extensible scheduling policies > > Signed-off-by: Nam Cao > --- The monitor shows a violation also in case of

Re: [PATCH v2 5/5] rv: Add rts monitor

2025-08-07 Thread Gabriele Monaco
On Wed, 2025-08-06 at 10:01 +0200, Nam Cao wrote: > Add "real-time scheduling" monitor, which validates that SCHED_RR and > SCHED_FIFO tasks are scheduled before tasks with normal and > extensible scheduling policies > > Signed-off-by: Nam Cao > --- > v2: >   - use the new tracepoints >   - move

Re: [PATCH v2 2/5] rv/ltl: Support per-cpu monitors

2025-08-07 Thread Gabriele Monaco
cpu" Looks good to me. Reviewed-by: Gabriele Monaco Thanks, Gabriele > --- >  include/rv/ltl_monitor.h   | 32 ++ >  kernel/trace/rv/Kconfig    |  4 >  kernel/trace/rv/rv_trace.h | 46 > ++ >  3 files changed,

Re: [PATCH v2 3/5] verification/rvgen/ltl: Support per-cpu monitor generation

2025-08-07 Thread Gabriele Monaco
unless you register a hotplug handler and just initialise the online CPUs (much of an overkill I'd say). What about something like "this is false if the monitor exists already before the monitor is enabled" Other than that it looks good to me. Reviewed-by: Gabriele Monaco Thanks, Gabrie

Re: [PATCH] rv: Fix wrong type cast in enabled_monitors_next()

2025-08-06 Thread Gabriele Monaco
list_head, and this > wrong type cast became a functional problem. > > Properly use container_of() instead. Good catch, thanks! Reviewed-by: Gabriele Monaco > > Fixes: 24cbfe18d55a ("rv: Merge struct rv_monitor_def into struct > rv_monitor") > Signed-off-by: Nam

Re: [PATCH 5/5] rv: Add rts monitor

2025-08-06 Thread Gabriele Monaco
On Wed, 2025-08-06 at 10:46 +0200, Nam Cao wrote: > On Wed, Aug 06, 2025 at 10:15:48AM +0200, Gabriele Monaco wrote: > > I didn't make it on time before your V2, I assume you solved > > already so > > you might ignore this. > > > > You kinda have some

Re: [PATCH 5/5] rv: Add rts monitor

2025-08-06 Thread Gabriele Monaco
On Tue, 2025-08-05 at 17:45 +0200, Nam Cao wrote: > On Tue, Aug 05, 2025 at 02:22:17PM +0200, Nam Cao wrote: > > On Tue, Aug 05, 2025 at 10:40:30AM +0200, Gabriele Monaco wrote: > > > Hello Nam, > > > > > > I just built and booted up the monitor in a VM (vir

Re: [PATCH 5/5] rv: Add rts monitor

2025-08-05 Thread Gabriele Monaco
On Wed, 2025-07-30 at 14:45 +0200, Nam Cao wrote: > Add "real-time scheduling" monitor, which validates that SCHED_RR and > SCHED_FIFO tasks are scheduled before tasks with normal and > extensible > scheduling policies > > Signed-off-by: Nam Cao Hello Nam, I just built and booted up the monitor

Re: [PATCH] rv: Support systems with time64-only syscalls

2025-08-04 Thread Gabriele Monaco
On Mon, 2025-08-04 at 12:45 -0700, Palmer Dabbelt wrote: > From: Palmer Dabbelt > > Some systems (like 32-bit RISC-V) only have the 64-bit time_t > versions of syscalls.  So handle the 32-bit time_t version of those > being undefined. > > Fixes: f74f8bb246cf ("rv: Add rtapp_sleep monitor") > Sig

Re: [PATCH 4/5] sched: Add rt task enqueue/dequeue trace points

2025-08-01 Thread Gabriele Monaco
On Fri, 2025-08-01 at 15:26 +0530, K Prateek Nayak wrote: > There are a few more cases with delayed dequeue: > > 1. A delayed task can be reenqueued before it is completely dequeued > and >    will lead to a enqueue -> enqueue transition if we don't trace the >    first dequeue. > > 2. There are

Re: [PATCH 5/5] rv: Add rts monitor

2025-08-01 Thread Gabriele Monaco
On Fri, 2025-08-01 at 09:58 +0200, Nam Cao wrote: > On Thu, Jul 31, 2025 at 09:47:10AM +0200, Gabriele Monaco wrote: > > On Wed, 2025-07-30 at 14:45 +0200, Nam Cao wrote: > > > Add "real-time scheduling" monitor, which validates that SCHED_RR > > > and SCHED_

Re: [PATCH 1/5] rv/ltl: Prepare for other monitor types

2025-07-31 Thread Gabriele Monaco
On Thu, 2025-07-31 at 11:28 +0200, Nam Cao wrote: > On Thu, Jul 31, 2025 at 11:04:44AM +0200, Gabriele Monaco wrote: > > I stole your solution to get rid of macros for the DA as well > > (might > > post it after this merge window or with the next changes) and I'm >

Re: [PATCH 1/5] rv/ltl: Prepare for other monitor types

2025-07-31 Thread Gabriele Monaco
patches going to coordinate, but I think it may make sense to share those values for all monitor types. What do you think? For the rest this patch looks good to me, nice use of the typedef. Reviewed-by: Gabriele Monaco Thanks, Gabriele

Re: [PATCH 4/5] sched: Add rt task enqueue/dequeue trace points

2025-07-31 Thread Gabriele Monaco
On Thu, 2025-07-31 at 09:35 +0200, Nam Cao wrote: > On Wed, Jul 30, 2025 at 06:18:45PM +0200, Gabriele Monaco wrote: > > Well, thinking about it again, these tracepoints might simplify > > things > > considerably when tasks change policy.. > > > > Syscalls may fai

Re: [PATCH 2/5] rv/ltl: Support per-cpu monitors

2025-07-31 Thread Gabriele Monaco
On Wed, 2025-07-30 at 14:45 +0200, Nam Cao wrote: > Add support for per-cpu run-time verification linear temporal logic > monitors. This is analogous to deterministic automaton per-cpu > monitors. > > Signed-off-by: Nam Cao > --- > > diff --git a/kernel/trace/rv/rv_trace.h b/kernel/trace/rv/rv_t

Re: [PATCH 5/5] rv: Add rts monitor

2025-07-31 Thread Gabriele Monaco
On Wed, 2025-07-30 at 14:45 +0200, Nam Cao wrote: > Add "real-time scheduling" monitor, which validates that SCHED_RR and > SCHED_FIFO tasks are scheduled before tasks with normal and > extensible > scheduling policies > Looks a very interesting monitor! A few questions: I assume this works with

Re: [PATCH 4/5] sched: Add rt task enqueue/dequeue trace points

2025-07-30 Thread Gabriele Monaco
On Wed, 2025-07-30 at 17:18 +0200, Nam Cao wrote: > On Wed, Jul 30, 2025 at 03:53:14PM +0200, Gabriele Monaco wrote: > > On Wed, 2025-07-30 at 14:45 +0200, Nam Cao wrote: > > > Add trace points into enqueue_task_rt() and dequeue_task_rt(). > > > They > > > are

Re: [PATCH 4/5] sched: Add rt task enqueue/dequeue trace points

2025-07-30 Thread Gabriele Monaco
On Wed, 2025-07-30 at 14:45 +0200, Nam Cao wrote: > Add trace points into enqueue_task_rt() and dequeue_task_rt(). They > are useful to implement RV monitor which validates RT scheduling. > I get it's much simpler this way, but is it that different to follow the task's existing tracepoints? * ta

Re: [PATCH v5 7/9] rv: Replace tss and sncid monitors with more complete sts

2025-07-29 Thread Gabriele Monaco
On Tue, 2025-07-29 at 11:37 +0200, Nam Cao wrote: > On Tue, Jul 29, 2025 at 11:25:12AM +0200, Nam Cao wrote: > > Kernel: > >   - base: ftrace/for-next I assume you mean rv/for-next ? The one that includes all changes as of yesterday. > >   - config: defconfig + mod2noconfig + PREEMPT_RT + monitor

  1   2   3   4   >