diff options
| author | Pat Somaru <patso@likewhatevs.io> | 2026-07-10 01:59:11 -0400 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-07-10 06:25:24 -1000 |
| commit | cbcda14b12fbc8c89546bfe4568df9b984238687 (patch) | |
| tree | 093b9be3a03351d9b183856629a16a1efd79674a /include | |
| parent | 3d1519011e395ea96c7fbc5ced35b49cfe60d93e (diff) | |
| download | linux-cbcda14b12fbc8c89546bfe4568df9b984238687.tar.gz linux-cbcda14b12fbc8c89546bfe4568df9b984238687.zip | |
sched_ext: Add tracepoint for scheduler exit
sched_ext schedulers have state in BPF programs and kernel. scx_dump
provides kernel state and BPF program state on error, but this is static
in what it can provide.
Add a sched_ext_exit tracepoint in scx_claim_exit() so that BPF programs
can dynamically inspect scheduler specific state at the moment of exit.
Pass the exiting scx_sched so attached programs can read its state, and,
since exits propagate through a hierarchy of sub-schedulers, identify
which scheduler each event belongs to.
Signed-off-by: Pat Somaru <patso@likewhatevs.io>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/trace/events/sched_ext.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/trace/events/sched_ext.h b/include/trace/events/sched_ext.h index d1bf5acd59c5..1e54f9564ef3 100644 --- a/include/trace/events/sched_ext.h +++ b/include/trace/events/sched_ext.h @@ -84,6 +84,34 @@ TRACE_EVENT(sched_ext_bypass_lb, ) ); +TRACE_EVENT(sched_ext_exit, + + TP_PROTO(struct scx_sched *sch, __u32 kind), + + TP_ARGS(sch, kind), + + TP_STRUCT__entry( + __string( name, sch->ops.name ) + __field( __s32, level ) + __field( __u64, sub_cgroup_id ) + __string( cgrp_path, sch_cgrp_path(sch) ) + __field( __u32, kind ) + ), + + TP_fast_assign( + __assign_str(name); + __entry->level = sch->level; + __entry->sub_cgroup_id = sch->ops.sub_cgroup_id; + __assign_str(cgrp_path); + __entry->kind = kind; + ), + + TP_printk("sched %s level %d sub_cgroup_id %llu cgrp_path %s kind %u", + __get_str(name), __entry->level, __entry->sub_cgroup_id, + __get_str(cgrp_path), __entry->kind + ) +); + #endif /* _TRACE_SCHED_EXT_H */ /* This part must be outside protection */ |
