All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: zhouchuangao <zhouchuangao@vivo.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kernel/sched/core: Print the time when the process entered the D state
Date: Fri, 9 Jul 2021 11:46:43 +0200	[thread overview]
Message-ID: <YOgbA/+Mm+tHKwqN@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <1625807160-112041-1-git-send-email-zhouchuangao@vivo.com>

On Thu, Jul 08, 2021 at 10:05:59PM -0700, zhouchuangao wrote:
> Sometimes we need to trigger /proc/sysrq-trigger to view the information
> of the D state process in the system.
> e.g:
> echo w > /proc/sysrq-trigger
> 
> Here we print the scheduling time of the process, which is convenient
> for us to judge the state of the system and for debugging.
> 
> Signed-off-by: zhouchuangao <zhouchuangao@vivo.com>
> ---
>  kernel/sched/core.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index cf16f8f..e03474d 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -8154,9 +8154,10 @@ void sched_show_task(struct task_struct *p)
>  	if (pid_alive(p))
>  		ppid = task_pid_nr(rcu_dereference(p->real_parent));
>  	rcu_read_unlock();
> -	pr_cont(" stack:%5lu pid:%5d ppid:%6d flags:0x%08lx\n",
> +	pr_cont(" stack:%5lu pid:%5d ppid:%6d flags:0x%08lx sched:%llu\n",
>  		free, task_pid_nr(p), ppid,
> -		(unsigned long)task_thread_info(p)->flags);
> +		(unsigned long)task_thread_info(p)->flags,
> +		p->sched_info.last_arrival);

How's that not a compile fail for SCHED_INFO=n ?

      parent reply	other threads:[~2021-07-09 10:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-09  5:05 [PATCH] kernel/sched/core: Print the time when the process entered the D state zhouchuangao
2021-07-09  6:53 ` kernel test robot
2021-07-09  6:53   ` kernel test robot
2021-07-09  7:48 ` kernel test robot
2021-07-09  7:48   ` kernel test robot
2021-07-09  9:46 ` Peter Zijlstra [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YOgbA/+Mm+tHKwqN@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=zhouchuangao@vivo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.