On Wed, Jul 30, 2025 at 04:16:46PM +0200, Nam Cao wrote:
> Quite interesting that the last "normal" line for cpu1 is:
> 
>             test-762     [001] dn...   112.407548: da_event_sts: cant_sched x 
> irq_enable -> can_sched (final)
> 
> But in the next error line, it mentions the "enable_to_exit". Where did
> this state come from??
> 
>            <...>-1621    [001] d....   119.919846: da_event_sts: rv: monitor 
> sts does not allow event sched_switch on state enable_to_exit

Never mind about this one, only cpu3 is accurate here, because I cut off
the trace_printk() as soon as the first error appears:

diff --git a/include/rv/da_monitor.h b/include/rv/da_monitor.h
index 17fa4f6e5ea6..927cf2cda03f 100644
--- a/include/rv/da_monitor.h
+++ b/include/rv/da_monitor.h
@@ -18,15 +18,22 @@
 
 #ifdef CONFIG_RV_REACTORS
 
+static bool nam_stop = true;
+
 #define DECLARE_RV_REACTING_HELPERS(name, type)                                
                        \
 static void cond_react_##name(type curr_state, type event)                     
                \
 {                                                                              
                \
        if (!rv_reacting_on() || !rv_##name.react)                              
                \
                return;                                                         
                \
+       nam_stop = true;\
        rv_##name.react("rv: monitor %s does not allow event %s on state %s\n", 
                \
                        #name,                                                  
                \
                        model_get_event_name_##name(event),                     
                \
                        model_get_state_name_##name(curr_state));               
                \
+       trace_printk("rv: monitor %s does not allow event %s on state %s\n",    
                \
+                       #name,                                                  
                \
+                       model_get_event_name_##name(event),                     
                \
+                       model_get_state_name_##name(curr_state));               
                \
 }
 
 #else /* CONFIG_RV_REACTOR */
@@ -136,6 +143,14 @@ da_event_##name(struct da_monitor *da_mon, enum 
events_##name event)                               \
                                           model_get_event_name_##name(event),  
                \
                                           
model_get_state_name_##name(next_state),             \
                                           
model_is_final_state_##name(next_state));            \
+                       if (nam_stop)\
+                               return true;\
+                       trace_printk("%s x %s -> %s%s\n", \
+                                       
model_get_state_name_##name(curr_state),                \
+                                          model_get_event_name_##name(event),  
                \
+                                          
model_get_state_name_##name(next_state),             \
+                                          
model_is_final_state_##name(next_state)?             \
+                                               " (final)" : "");               
\
                        return true;                                            
                \
                }                                                               
                \
        }                                                                       
                \

Reply via email to