lkml.org 
[lkml]   [2021]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sched/debug: print column titles of show_state_filter()
On Tue, 13 Jul 2021 16:35:18 +0530
Shirish S <shirish.s@amd.com> wrote:

> This addition in the debug output shall improve readablitly..
> Its not intuitive for users that the pid printed in last column
> is of parent process.
>
> Signed-off-by: Shirish S <shirish.s@amd.com>
> ---
> kernel/sched/core.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 2d9ff40f4661..d95d46a89e7e 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -8194,6 +8194,11 @@ void show_state_filter(unsigned int state_filter)
> {
> struct task_struct *g, *p;
>
> +#if BITS_PER_LONG == 32
> + pr_info(" task PC stack pid father\n");
> +#else
> + pr_info(" task PC stack pid father\n");
> +#endif

Or remove the ugly #ifdef logic and just have:

pr_info(" task%*s", BITS_PER_LONG == 32 ? 38 : 46,
"PC stack pid father\n");

-- Steve

> rcu_read_lock();
> for_each_process_thread(g, p) {
> /*

\
 
 \ /
  Last update: 2021-07-13 18:01    [W:0.031 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site