Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: mathieu.desnoyers@polymtl.ca (Mathieu Desnoyers)
Subject: [ltt-dev] [PATCH 2/2] tracepoints-kexec
Date: Wed, 17 Dec 2008 23:19:18 -0500	[thread overview]
Message-ID: <20081218041918.GB21563@Krystal> (raw)
In-Reply-To: <4949BD67.40501@cn.fujitsu.com>

* Zhaolei (zhaolei at cn.fujitsu.com) wrote:
> Instrumentation of kexec related events : kernel_kexec and crash_kexec.
> It is useful for build flight-recorder program based on lttng infrastructure.
> 
> Signed-off-by: Zhao lei <zhaolei at cn.fujitsu.com>
> ---
>  include/trace/kexec.h |   14 ++++++++++++++
>  kernel/kexec.c        |    8 ++++++++
>  2 files changed, 22 insertions(+), 0 deletions(-)
>  create mode 100644 include/trace/kexec.h
> 
> diff --git a/include/trace/kexec.h b/include/trace/kexec.h
> new file mode 100644
> index 0000000..928bdd2
> --- /dev/null
> +++ b/include/trace/kexec.h
> @@ -0,0 +1,14 @@
> +#ifndef _TRACE_KEXEC_H
> +#define _TRACE_KEXEC_H
> +
> +#include <linux/tracepoint.h>
> +#include <linux/kexec.h>
> +
> +DECLARE_TRACE(kexec_kernel_kexec,
> +	TPPROTO(struct kimage *image),
> +	TPARGS(image));
> +DECLARE_TRACE(kexec_crash_kexec,
> +	TPPROTO(struct kimage *image, struct pt_regs *regs),
> +	TPARGS(image, regs));
> +

Those could fit in include/trace/kernel.h too.

kernel_kexec
and
kernel_kexec_crash

?

My rule of thumb would be this :
- If we instrument a very small kernel file under kernel/, then we use
  kernel_ prefix.
- If we instrument a bigger kernel infrastructure, even if under
  kernel/, like the scheduler, then it may be better to use a sched_
  prefix.

Mathieu

> +#endif
> diff --git a/kernel/kexec.c b/kernel/kexec.c
> index aef2653..01ab16b 100644
> --- a/kernel/kexec.c
> +++ b/kernel/kexec.c
> @@ -30,6 +30,7 @@
>  #include <linux/pm.h>
>  #include <linux/cpu.h>
>  #include <linux/console.h>
> +#include <trace/kexec.h>
>  
>  #include <asm/page.h>
>  #include <asm/uaccess.h>
> @@ -37,6 +38,9 @@
>  #include <asm/system.h>
>  #include <asm/sections.h>
>  
> +DEFINE_TRACE(kexec_kernel_kexec);
> +DEFINE_TRACE(kexec_crash_kexec);
> +
>  /* Per cpu memory for storing cpu states in case of system crash. */
>  note_buf_t* crash_notes;
>  
> @@ -1062,6 +1066,8 @@ asmlinkage long compat_sys_kexec_load(unsigned long entry,
>  
>  void crash_kexec(struct pt_regs *regs)
>  {
> +	trace_kexec_crash_kexec(kexec_crash_image, regs);
> +
>  	/* Take the kexec_mutex here to prevent sys_kexec_load
>  	 * running on one cpu from replacing the crash kernel
>  	 * we are using after a panic on a different cpu.
> @@ -1428,6 +1434,8 @@ int kernel_kexec(void)
>  {
>  	int error = 0;
>  
> +	trace_kexec_kernel_kexec(kexec_image);
> +
>  	if (!mutex_trylock(&kexec_mutex))
>  		return -EBUSY;
>  	if (!kexec_image) {
> -- 
> 1.5.5.3
> 
> 

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68




      reply	other threads:[~2008-12-18  4:19 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-18  3:01 [ltt-dev] [PATCH 0/2] Add tracepoint of panic and kexec Zhaolei
2008-12-18  3:02 ` [ltt-dev] [PATCH 2/1] tracepoints-panic Zhaolei
2008-12-18  4:14   ` Mathieu Desnoyers
2008-12-18  5:38     ` Zhaolei
2008-12-18  5:38       ` [ltt-dev] [PATCH v2] add tracepoints of panic and kexec Zhaolei
2008-12-18 18:47         ` Mathieu Desnoyers
2008-12-19  1:36           ` Zhaolei
2009-01-03 14:02             ` Mathieu Desnoyers
2009-01-12  5:55               ` Zhaolei
2009-01-12 16:32                 ` Mathieu Desnoyers
2009-01-16  6:47                   ` Lai Jiangshan
2009-01-16 15:43                     ` Mathieu Desnoyers
2009-01-19  6:29                       ` KOSAKI Motohiro
2009-01-20  2:08                         ` Mathieu Desnoyers
2009-02-19  4:14             ` Mathieu Desnoyers
2009-02-19  5:31               ` Zhaolei
2009-02-19  5:46                 ` Mathieu Desnoyers
2009-02-19  6:13                   ` Mathieu Desnoyers
2009-02-19  6:25                     ` Zhaolei
2008-12-30  1:52           ` [ltt-dev] [PATCH v3 0/1] " Zhaolei
2008-12-30  1:53             ` [ltt-dev] [PATCH v3 1/1] " Zhaolei
2009-01-03 13:45               ` Mathieu Desnoyers
2008-12-18  3:03 ` [ltt-dev] [PATCH 2/2] tracepoints-kexec Zhaolei
2008-12-18  4:19   ` Mathieu Desnoyers [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=20081218041918.GB21563@Krystal \
    --to=mathieu.desnoyers@polymtl.ca \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox