mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 15:02:40 -04: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.0 KiB
C
48 lines
1.0 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Automatically generated C representation of tss automaton
|
|
* For further information about this format, see kernel documentation:
|
|
* Documentation/trace/rv/deterministic_automata.rst
|
|
*/
|
|
|
|
enum states_tss {
|
|
thread_tss = 0,
|
|
sched_tss,
|
|
state_max_tss
|
|
};
|
|
|
|
#define INVALID_STATE state_max_tss
|
|
|
|
enum events_tss {
|
|
sched_switch_tss = 0,
|
|
schedule_entry_tss,
|
|
schedule_exit_tss,
|
|
event_max_tss
|
|
};
|
|
|
|
struct automaton_tss {
|
|
char *state_names[state_max_tss];
|
|
char *event_names[event_max_tss];
|
|
unsigned char function[state_max_tss][event_max_tss];
|
|
unsigned char initial_state;
|
|
bool final_states[state_max_tss];
|
|
};
|
|
|
|
static const struct automaton_tss automaton_tss = {
|
|
.state_names = {
|
|
"thread",
|
|
"sched"
|
|
},
|
|
.event_names = {
|
|
"sched_switch",
|
|
"schedule_entry",
|
|
"schedule_exit"
|
|
},
|
|
.function = {
|
|
{ INVALID_STATE, sched_tss, INVALID_STATE },
|
|
{ sched_tss, INVALID_STATE, thread_tss },
|
|
},
|
|
.initial_state = thread_tss,
|
|
.final_states = { 1, 0 },
|
|
};
|