All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: wenyang.linux@foxmail.com
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Mel Gorman <mgorman@techsingularity.net>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] coredump debugging: add a tracepoint to report the coredumping
Date: Sat, 17 Feb 2024 11:49:24 +0100	[thread overview]
Message-ID: <20240217104924.GB10393@redhat.com> (raw)
In-Reply-To: <tencent_5CD40341EC9384E9B7CC127EA5CF2655B408@qq.com>

On 02/17, wenyang.linux@foxmail.com wrote:
>
> From: Wen Yang <wenyang.linux@foxmail.com>
>
> Currently coredump_task_exit() takes some time to wait for the generation
> of the dump file. But if the user-space wants to receive a notification
> as soon as possible it maybe inconvenient.
>
> Add the new trace_sched_process_coredump() into coredump_task_exit(),
> this way a user-space monitor could easily wait for the exits and
> potentially make some preparations in advance.

Can't comment, I never know when the new tracepoint will make sense.

Stupid question. Can we simply shift trace_sched_process_exit() up
before coredump_task_exit() ?

Oleg.


> Signed-off-by: Wen Yang <wenyang.linux@foxmail.com>
> Cc: Oleg Nesterov <oleg@redhat.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Masami Hiramatsu <mhiramat@kernel.org>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Mel Gorman <mgorman@techsingularity.net>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: linux-kernel@vger.kernel.org
> ---
>  include/trace/events/sched.h | 7 +++++++
>  kernel/exit.c                | 1 +
>  2 files changed, 8 insertions(+)
>
> diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
> index dbb01b4b7451..ce7448065986 100644
> --- a/include/trace/events/sched.h
> +++ b/include/trace/events/sched.h
> @@ -334,6 +334,13 @@ DEFINE_EVENT(sched_process_template, sched_process_exit,
>  	     TP_PROTO(struct task_struct *p),
>  	     TP_ARGS(p));
>
> +/*
> + * Tracepoint for a task coredumping:
> + */
> +DEFINE_EVENT(sched_process_template, sched_process_coredump,
> +	     TP_PROTO(struct task_struct *p),
> +	     TP_ARGS(p));
> +
>  /*
>   * Tracepoint for waiting on task to unschedule:
>   */
> diff --git a/kernel/exit.c b/kernel/exit.c
> index 493647fd7c07..c11e12d73f4e 100644
> --- a/kernel/exit.c
> +++ b/kernel/exit.c
> @@ -425,6 +425,7 @@ static void coredump_task_exit(struct task_struct *tsk)
>  			self.next = xchg(&core_state->dumper.next, &self);
>  		else
>  			self.task = NULL;
> +		trace_sched_process_coredump(tsk);
>  		/*
>  		 * Implies mb(), the result of xchg() must be visible
>  		 * to core_state->dumper.
> --
> 2.25.1
>


  reply	other threads:[~2024-02-17 10:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 18:59 [PATCH] coredump debugging: add a tracepoint to report the coredumping wenyang.linux
2024-02-17 10:49 ` Oleg Nesterov [this message]
2024-02-18 15:16   ` Wen Yang
2024-02-18 17:52     ` Oleg Nesterov
2024-02-19 16:29   ` Steven Rostedt
2024-02-19 17:00     ` Oleg Nesterov
2024-02-19 17:28       ` Steven Rostedt
2024-02-19 18:01         ` Mathieu Desnoyers
2024-02-20 15:08           ` Steven Rostedt
2024-02-23 14:26           ` Steven Rostedt
2024-02-23 16:54             ` [lttng-dev] " Mathieu Desnoyers via lttng-dev
2024-02-23 16:54               ` Mathieu Desnoyers
2024-02-23 17:03               ` [lttng-dev] " Steven Rostedt via lttng-dev
2024-02-23 17:03                 ` Steven Rostedt
2024-02-23 17:12               ` [lttng-dev] " Karim Yaghmour via lttng-dev
2024-02-23 17:12                 ` Karim Yaghmour
2024-02-21 16:00         ` Wen Yang
2024-02-21 17:54           ` Steven Rostedt
2024-02-21 15:45       ` Wen Yang
2024-02-21 17:48         ` Steven Rostedt

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=20240217104924.GB10393@redhat.com \
    --to=oleg@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mgorman@techsingularity.net \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=wenyang.linux@foxmail.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.