* [PATCH v1 0/2] tools/sched_ext: fix issues in scx_show_state.py
@ 2025-12-26 8:46 Kohei Enju
2025-12-26 8:46 ` [PATCH v1 1/2] tools/sched_ext: fix scx_show_state.py for scx_root change Kohei Enju
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Kohei Enju @ 2025-12-26 8:46 UTC (permalink / raw)
To: sched-ext
Cc: Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Kohei Enju,
Emil Tsalapatis, Dan Schatzberg, kohei
Due to recent changes in kernel/sched/ext.c,
tools/sched_ext/scx_show_state.py no longer works properly.
Fix these issues:
1. Use 'scx_root' instead of 'scx_ops'
2. Use scx_aborting instead of scx_in_softlockup and scx_breather_depth
Kohei Enju (2):
tools/sched_ext: fix scx_show_state.py for scx_root change
tools/sched_ext: update scx_show_state.py for scx_aborting change
tools/sched_ext/scx_show_state.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--
2.51.0
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v1 1/2] tools/sched_ext: fix scx_show_state.py for scx_root change 2025-12-26 8:46 [PATCH v1 0/2] tools/sched_ext: fix issues in scx_show_state.py Kohei Enju @ 2025-12-26 8:46 ` Kohei Enju 2025-12-28 2:01 ` Emil Tsalapatis 2025-12-26 8:46 ` [PATCH v1 2/2] tools/sched_ext: update scx_show_state.py for scx_aborting change Kohei Enju 2025-12-28 16:22 ` [PATCH v1 0/2] tools/sched_ext: fix issues in scx_show_state.py Tejun Heo 2 siblings, 1 reply; 6+ messages in thread From: Kohei Enju @ 2025-12-26 8:46 UTC (permalink / raw) To: sched-ext Cc: Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Kohei Enju, Emil Tsalapatis, Dan Schatzberg, kohei Commit 48e126777386 ("sched_ext: Introduce scx_sched") introduced scx_root and removed scx_ops, causing scx_show_state.py to fail when searching for the 'scx_ops' object. [1] Fix by using 'scx_root' instead, with NULL pointer handling. [1] # drgn -s vmlinux ./tools/sched_ext/scx_show_state.py Traceback (most recent call last): File "/root/.venv/bin/drgn", line 8, in <module> sys.exit(_main()) ~~~~~^^ File "/root/.venv/lib64/python3.14/site-packages/drgn/cli.py", line 625, in _main runpy.run_path( ~~~~~~~~~~~~~~^ script_path, init_globals={"prog": prog}, run_name="__main__" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "<frozen runpy>", line 287, in run_path File "<frozen runpy>", line 98, in _run_module_code File "<frozen runpy>", line 88, in _run_code File "./tools/sched_ext/scx_show_state.py", line 30, in <module> ops = prog['scx_ops'] ~~~~^^^^^^^^^^^ _drgn.ObjectNotFoundError: could not find 'scx_ops' Fixes: 48e126777386 ("sched_ext: Introduce scx_sched") Signed-off-by: Kohei Enju <enjuk@amazon.com> --- tools/sched_ext/scx_show_state.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/sched_ext/scx_show_state.py b/tools/sched_ext/scx_show_state.py index 7cdcc6729ea4..aec4a4498140 100644 --- a/tools/sched_ext/scx_show_state.py +++ b/tools/sched_ext/scx_show_state.py @@ -27,10 +27,13 @@ def read_static_key(name): def state_str(state): return prog['scx_enable_state_str'][state].string_().decode() -ops = prog['scx_ops'] +root = prog['scx_root'] enable_state = read_atomic("scx_enable_state_var") -print(f'ops : {ops.name.string_().decode()}') +if root: + print(f'ops : {root.ops.name.string_().decode()}') +else: + print('ops : ') print(f'enabled : {read_static_key("__scx_enabled")}') print(f'switching_all : {read_int("scx_switching_all")}') print(f'switched_all : {read_static_key("__scx_switched_all")}') -- 2.51.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v1 1/2] tools/sched_ext: fix scx_show_state.py for scx_root change 2025-12-26 8:46 ` [PATCH v1 1/2] tools/sched_ext: fix scx_show_state.py for scx_root change Kohei Enju @ 2025-12-28 2:01 ` Emil Tsalapatis 0 siblings, 0 replies; 6+ messages in thread From: Emil Tsalapatis @ 2025-12-28 2:01 UTC (permalink / raw) To: Kohei Enju, sched-ext Cc: Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Dan Schatzberg, kohei On Fri Dec 26, 2025 at 3:46 AM EST, Kohei Enju wrote: > Commit 48e126777386 ("sched_ext: Introduce scx_sched") introduced > scx_root and removed scx_ops, causing scx_show_state.py to fail when > searching for the 'scx_ops' object. [1] > > Fix by using 'scx_root' instead, with NULL pointer handling. > > [1] > # drgn -s vmlinux ./tools/sched_ext/scx_show_state.py > Traceback (most recent call last): > File "/root/.venv/bin/drgn", line 8, in <module> > sys.exit(_main()) > ~~~~~^^ > File "/root/.venv/lib64/python3.14/site-packages/drgn/cli.py", line 625, in _main > runpy.run_path( > ~~~~~~~~~~~~~~^ > script_path, init_globals={"prog": prog}, run_name="__main__" > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > ) > ^ > File "<frozen runpy>", line 287, in run_path > File "<frozen runpy>", line 98, in _run_module_code > File "<frozen runpy>", line 88, in _run_code > File "./tools/sched_ext/scx_show_state.py", line 30, in <module> > ops = prog['scx_ops'] > ~~~~^^^^^^^^^^^ > _drgn.ObjectNotFoundError: could not find 'scx_ops' > > Fixes: 48e126777386 ("sched_ext: Introduce scx_sched") > Signed-off-by: Kohei Enju <enjuk@amazon.com> Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com> > --- > tools/sched_ext/scx_show_state.py | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/tools/sched_ext/scx_show_state.py b/tools/sched_ext/scx_show_state.py > index 7cdcc6729ea4..aec4a4498140 100644 > --- a/tools/sched_ext/scx_show_state.py > +++ b/tools/sched_ext/scx_show_state.py > @@ -27,10 +27,13 @@ def read_static_key(name): > def state_str(state): > return prog['scx_enable_state_str'][state].string_().decode() > > -ops = prog['scx_ops'] > +root = prog['scx_root'] > enable_state = read_atomic("scx_enable_state_var") > > -print(f'ops : {ops.name.string_().decode()}') > +if root: > + print(f'ops : {root.ops.name.string_().decode()}') > +else: > + print('ops : ') > print(f'enabled : {read_static_key("__scx_enabled")}') > print(f'switching_all : {read_int("scx_switching_all")}') > print(f'switched_all : {read_static_key("__scx_switched_all")}') ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v1 2/2] tools/sched_ext: update scx_show_state.py for scx_aborting change 2025-12-26 8:46 [PATCH v1 0/2] tools/sched_ext: fix issues in scx_show_state.py Kohei Enju 2025-12-26 8:46 ` [PATCH v1 1/2] tools/sched_ext: fix scx_show_state.py for scx_root change Kohei Enju @ 2025-12-26 8:46 ` Kohei Enju 2025-12-28 2:02 ` Emil Tsalapatis 2025-12-28 16:22 ` [PATCH v1 0/2] tools/sched_ext: fix issues in scx_show_state.py Tejun Heo 2 siblings, 1 reply; 6+ messages in thread From: Kohei Enju @ 2025-12-26 8:46 UTC (permalink / raw) To: sched-ext Cc: Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Kohei Enju, Emil Tsalapatis, Dan Schatzberg, kohei Commit a69040ed57f5 ("sched_ext: Simplify breather mechanism with scx_aborting flag") removed scx_in_softlockup and scx_breather_depth, replacing them with scx_aborting. Update the script accordingly. Fixes: a69040ed57f5 ("sched_ext: Simplify breather mechanism with scx_aborting flag") Signed-off-by: Kohei Enju <enjuk@amazon.com> --- tools/sched_ext/scx_show_state.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/sched_ext/scx_show_state.py b/tools/sched_ext/scx_show_state.py index aec4a4498140..02e43c184d43 100644 --- a/tools/sched_ext/scx_show_state.py +++ b/tools/sched_ext/scx_show_state.py @@ -38,8 +38,7 @@ print(f'enabled : {read_static_key("__scx_enabled")}') print(f'switching_all : {read_int("scx_switching_all")}') print(f'switched_all : {read_static_key("__scx_switched_all")}') print(f'enable_state : {state_str(enable_state)} ({enable_state})') -print(f'in_softlockup : {prog["scx_in_softlockup"].value_()}') -print(f'breather_depth: {read_atomic("scx_breather_depth")}') +print(f'aborting : {prog["scx_aborting"].value_()}') print(f'bypass_depth : {prog["scx_bypass_depth"].value_()}') print(f'nr_rejected : {read_atomic("scx_nr_rejected")}') print(f'enable_seq : {read_atomic("scx_enable_seq")}') -- 2.51.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v1 2/2] tools/sched_ext: update scx_show_state.py for scx_aborting change 2025-12-26 8:46 ` [PATCH v1 2/2] tools/sched_ext: update scx_show_state.py for scx_aborting change Kohei Enju @ 2025-12-28 2:02 ` Emil Tsalapatis 0 siblings, 0 replies; 6+ messages in thread From: Emil Tsalapatis @ 2025-12-28 2:02 UTC (permalink / raw) To: Kohei Enju, sched-ext Cc: Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Dan Schatzberg, kohei On Fri Dec 26, 2025 at 3:46 AM EST, Kohei Enju wrote: > Commit a69040ed57f5 ("sched_ext: Simplify breather mechanism with > scx_aborting flag") removed scx_in_softlockup and scx_breather_depth, > replacing them with scx_aborting. > > Update the script accordingly. > > Fixes: a69040ed57f5 ("sched_ext: Simplify breather mechanism with scx_aborting flag") > Signed-off-by: Kohei Enju <enjuk@amazon.com> Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com> > --- > tools/sched_ext/scx_show_state.py | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/tools/sched_ext/scx_show_state.py b/tools/sched_ext/scx_show_state.py > index aec4a4498140..02e43c184d43 100644 > --- a/tools/sched_ext/scx_show_state.py > +++ b/tools/sched_ext/scx_show_state.py > @@ -38,8 +38,7 @@ print(f'enabled : {read_static_key("__scx_enabled")}') > print(f'switching_all : {read_int("scx_switching_all")}') > print(f'switched_all : {read_static_key("__scx_switched_all")}') > print(f'enable_state : {state_str(enable_state)} ({enable_state})') > -print(f'in_softlockup : {prog["scx_in_softlockup"].value_()}') > -print(f'breather_depth: {read_atomic("scx_breather_depth")}') > +print(f'aborting : {prog["scx_aborting"].value_()}') > print(f'bypass_depth : {prog["scx_bypass_depth"].value_()}') > print(f'nr_rejected : {read_atomic("scx_nr_rejected")}') > print(f'enable_seq : {read_atomic("scx_enable_seq")}') ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1 0/2] tools/sched_ext: fix issues in scx_show_state.py 2025-12-26 8:46 [PATCH v1 0/2] tools/sched_ext: fix issues in scx_show_state.py Kohei Enju 2025-12-26 8:46 ` [PATCH v1 1/2] tools/sched_ext: fix scx_show_state.py for scx_root change Kohei Enju 2025-12-26 8:46 ` [PATCH v1 2/2] tools/sched_ext: update scx_show_state.py for scx_aborting change Kohei Enju @ 2025-12-28 16:22 ` Tejun Heo 2 siblings, 0 replies; 6+ messages in thread From: Tejun Heo @ 2025-12-28 16:22 UTC (permalink / raw) To: Kohei Enju Cc: sched-ext, David Vernet, Andrea Righi, Changwoo Min, Emil Tsalapatis, Dan Schatzberg, kohei > Kohei Enju (2): > tools/sched_ext: fix scx_show_state.py for scx_root change > tools/sched_ext: update scx_show_state.py for scx_aborting change Applied 1-2 to sched_ext/for-6.19-fixes. Thanks. -- tejun ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-12-28 16:22 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-12-26 8:46 [PATCH v1 0/2] tools/sched_ext: fix issues in scx_show_state.py Kohei Enju 2025-12-26 8:46 ` [PATCH v1 1/2] tools/sched_ext: fix scx_show_state.py for scx_root change Kohei Enju 2025-12-28 2:01 ` Emil Tsalapatis 2025-12-26 8:46 ` [PATCH v1 2/2] tools/sched_ext: update scx_show_state.py for scx_aborting change Kohei Enju 2025-12-28 2:02 ` Emil Tsalapatis 2025-12-28 16:22 ` [PATCH v1 0/2] tools/sched_ext: fix issues in scx_show_state.py Tejun Heo
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox