mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: Paul Mundt <lethal@linux-sh.org>,
	linux-kernel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Mathieu Desnoyers <compudj@krystal.dyndns.org>,
	"Frank Ch. Eigler" <fche@redhat.com>,
	Roland McGrath <roland@redhat.com>
Cc: kosaki.motohiro@jp.fujitsu.com
Subject: Re: [PATCH] [RFC] tracehook: Hook in syscall tracing markers.
Date: Mon, 22 Sep 2008 10:12:18 +0900	[thread overview]
Message-ID: <20080922010408.F53D.KOSAKI.MOTOHIRO@jp.fujitsu.com> (raw)
In-Reply-To: <20080921021630.GA6443@linux-sh.org>

Hi Paul,

> At kernel summit, the idea that syscall tracing was generally desirable
> for tracing was mentioned several times, as was the argument that kernel
> developers aren't placing markers in meaningful locations. This is a
> simple patch to try and do that for the syscall case.
> 
> Presently LTTng attempts to litter these trace markers all over the
> architecture code, primarily to get around the fact that there was no
> generic way to get at this information before. Now that platforms are
> starting to do their syscall entry/exit notifiers through tracehook and
> we have the asm/syscall.h interface, all of this information can be
> generically abstracted.
> 
> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
> 

I think marriage between tracehook and generic marker is very good idea. 
at least, instruction pointer and return value are definitly useful.

but...
Have you seen Mathieu's tracepoint patch?
I recommend to use tracepoint insted use marker directly.


> ---
> 
>  include/linux/tracehook.h |    7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
> index 6186a78..481ff45 100644
> --- a/include/linux/tracehook.h
> +++ b/include/linux/tracehook.h
> @@ -49,6 +49,9 @@
>  #include <linux/sched.h>
>  #include <linux/ptrace.h>
>  #include <linux/security.h>
> +#include <linux/marker.h>
> +#include <asm/syscall.h>
> +
>  struct linux_binprm;
>  
>  /**
> @@ -112,6 +115,8 @@ static inline __must_check int tracehook_report_syscall_entry(
>  	struct pt_regs *regs)
>  {
>  	ptrace_report_syscall(regs);
> +	trace_mark(kernel_arch_syscall_entry, "syscall_id %ld ip #p%ld",
> +		   syscall_get_nr(NULL, regs), instruction_pointer(regs));
>  	return 0;
>  }
>  
> @@ -135,6 +140,8 @@ static inline __must_check int tracehook_report_syscall_entry(
>  static inline void tracehook_report_syscall_exit(struct pt_regs *regs, int step)
>  {
>  	ptrace_report_syscall(regs);
> +	trace_mark(kernel_arch_syscall_exit, "ret %ld",
> +		   syscall_get_return_value(NULL, regs));
>  }



  reply	other threads:[~2008-09-22  1:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-21  2:16 Paul Mundt
2008-09-22  1:12 ` KOSAKI Motohiro [this message]
2008-09-23  1:20   ` Mathieu Desnoyers
2008-09-22  1:28 ` Frank Ch. Eigler
2008-09-23  1:22   ` Mathieu Desnoyers
2008-09-26 10:42 ` Roland McGrath

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=20080922010408.F53D.KOSAKI.MOTOHIRO@jp.fujitsu.com \
    --to=kosaki.motohiro@jp.fujitsu.com \
    --cc=compudj@krystal.dyndns.org \
    --cc=fche@redhat.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roland@redhat.com \
    --cc=torvalds@linux-foundation.org \
    /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

all inboxes | Powered by JetHome®