mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-08-17 23:36:44 +00:00

Add 2 per-cpu monitors as part of the sched model: * sco: scheduling context operations Monitor to ensure sched_set_state happens only in thread context * tss: task switch while scheduling Monitor to ensure sched_switch happens only in scheduling context To: Ingo Molnar <mingo@redhat.com> To: Peter Zijlstra <peterz@infradead.org> Cc: Juri Lelli <juri.lelli@redhat.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: John Kacur <jkacur@redhat.com> Cc: Clark Williams <williams@redhat.com> Link: https://lore.kernel.org/20250305140406.350227-4-gmonaco@redhat.com Signed-off-by: Gabriele Monaco <gmonaco@redhat.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
48 lines
1.1 KiB
C
48 lines
1.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Automatically generated C representation of sco automaton
|
|
* For further information about this format, see kernel documentation:
|
|
* Documentation/trace/rv/deterministic_automata.rst
|
|
*/
|
|
|
|
enum states_sco {
|
|
thread_context_sco = 0,
|
|
scheduling_context_sco,
|
|
state_max_sco
|
|
};
|
|
|
|
#define INVALID_STATE state_max_sco
|
|
|
|
enum events_sco {
|
|
sched_set_state_sco = 0,
|
|
schedule_entry_sco,
|
|
schedule_exit_sco,
|
|
event_max_sco
|
|
};
|
|
|
|
struct automaton_sco {
|
|
char *state_names[state_max_sco];
|
|
char *event_names[event_max_sco];
|
|
unsigned char function[state_max_sco][event_max_sco];
|
|
unsigned char initial_state;
|
|
bool final_states[state_max_sco];
|
|
};
|
|
|
|
static const struct automaton_sco automaton_sco = {
|
|
.state_names = {
|
|
"thread_context",
|
|
"scheduling_context"
|
|
},
|
|
.event_names = {
|
|
"sched_set_state",
|
|
"schedule_entry",
|
|
"schedule_exit"
|
|
},
|
|
.function = {
|
|
{ thread_context_sco, scheduling_context_sco, INVALID_STATE },
|
|
{ INVALID_STATE, INVALID_STATE, thread_context_sco },
|
|
},
|
|
.initial_state = thread_context_sco,
|
|
.final_states = { 1, 0 },
|
|
};
|