diff options
author | Daniel Thompson <daniel.thompson@linaro.org> | 2021-11-02 17:31:58 +0000 |
---|---|---|
committer | Daniel Thompson <daniel.thompson@linaro.org> | 2021-11-03 17:21:37 +0000 |
commit | b77dbc86d60459b42ab375e4e23172e7245f2854 (patch) | |
tree | a05747cbf2d24c7f29a000386e970414c22840c7 /kernel/debug/kdb/kdb_private.h | |
parent | e4e737bb5c170df6135a127739a9e6148ee3da82 (diff) | |
download | lwn-b77dbc86d60459b42ab375e4e23172e7245f2854.tar.gz lwn-b77dbc86d60459b42ab375e4e23172e7245f2854.zip |
kdb: Adopt scheduler's task classification
Currently kdb contains some open-coded routines to generate a summary
character for each task. This code currently issues warnings, is
almost certainly broken and won't make sense to any kernel dev who
has ever used /proc to examine task states.
Fix both the warning and the potential for confusion by adopting the
scheduler's task classification. Whilst doing this we also simplify the
filtering by using mask strings directly (which means we don't have to
guess all the characters the scheduler might give us).
Unfortunately we can't quite match the scheduler classification completely.
We add four extra states: - for idle loops and i, m and s for sleeping
system daemons (which means kthreads in one of the I, M and S states).
These extra states are used to manage the filters for tools to make the
output of ps and bta less noisy.
Note: The Fixes below is the last point the original dubious code was
moved; it was not introduced by that patch. However it gives us
the last point to which this patch can be easily backported.
Happily that should be enough to cover the introduction of
CONFIG_WERROR!
Fixes: 2f064a59a11f ("sched: Change task_struct::state")
Link: https://lore.kernel.org/r/20211102173158.3315227-1-daniel.thompson@linaro.org
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Diffstat (limited to 'kernel/debug/kdb/kdb_private.h')
-rw-r--r-- | kernel/debug/kdb/kdb_private.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/debug/kdb/kdb_private.h b/kernel/debug/kdb/kdb_private.h index 629590084a0d..0d2f9feea0a4 100644 --- a/kernel/debug/kdb/kdb_private.h +++ b/kernel/debug/kdb/kdb_private.h @@ -190,10 +190,8 @@ extern char kdb_grep_string[]; extern int kdb_grep_leading; extern int kdb_grep_trailing; extern char *kdb_cmds[]; -extern unsigned long kdb_task_state_string(const char *); extern char kdb_task_state_char (const struct task_struct *); -extern unsigned long kdb_task_state(const struct task_struct *p, - unsigned long mask); +extern bool kdb_task_state(const struct task_struct *p, const char *mask); extern void kdb_ps_suppressed(void); extern void kdb_ps1(const struct task_struct *p); extern void kdb_send_sig(struct task_struct *p, int sig); |