All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@elte.hu>, Steven Rostedt <rostedt@goodmis.org>,
	Randy Dunlap <rdunlap@xenotime.net>,
	Arnaldo Carvalho de Melo <acme@infradead.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Christoph Hellwig <hch@infradead.org>,
	Oleg Nesterov <oleg@redhat.com>, Mark Wielaard <mjw@redhat.com>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Naren A Devaiah <naren.devaiah@in.ibm.com>,
	Jim Keniston <jkenisto@linux.vnet.ibm.com>,
	"Frank Ch. Eigler" <fche@redhat.com>,
	Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	2nddept-manager@sdl.hitachi.co.jp
Subject: Re: [PATCHv10 2.6.35-rc6-tip 9/14]  trace: uprobes trace_event interface
Date: Mon, 2 Aug 2010 04:28:42 +0200	[thread overview]
Message-ID: <20100802022840.GC5581@nowhere> (raw)
In-Reply-To: <20100729141524.GH21723@linux.vnet.ibm.com>

On Thu, Jul 29, 2010 at 07:45:24PM +0530, Srikar Dronamraju wrote:
> > 
> > Possible enhancement: Moving this config right after KPROBE_EVENT, because
> >  those two provide similar dynamic events.
> > 
> 
> Masami, 
>  Below patch should address the comments raised by you.
> 
> --
> Thanks and Regards
> Srikar
> 
> ---
> From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
> 
> 
> Implements trace_event support for uprobes. In its
> current form it can be used to put probes at a specified text address
> in a process and dump the required registers when the code flow reaches
> the probed address.
> 
> TODO: Documentation/trace/uprobetrace.txt
> 
> Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
> ---
> 
> Changelog from v5: Addressed comments from Masami Hiramatsu and Steven
>       Rostedt. Some changes because of changes in common probe events.
> 
> Changelog from v4: (Merged to 2.6.35-rc3-tip)
> 
> Changelog from v2/v3: (Addressing comments from Steven Rostedt
> 					and Frederic Weisbecker)
> 	* removed pit field from uprobe_trace_entry.
> 	* share common parts with kprobe trace events.
> 	* use trace_create_file instead of debugfs_create_file.
> 
> 
> The following example shows how to dump the instruction pointer and %ax a
> register at the probed text address.
> 
> Start a process to trace. Get the address to trace.
>   [Here pid is asssumed as 6016]
>   [Address to trace is 0x0000000000446420]
>   [Registers to be dumped are %ip and %ax]
> 
> # cd /sys/kernel/debug/tracing/
> # echo 'p 6016:0x0000000000446420 %ip %ax' > uprobe_events
> # cat uprobe_events
> p:uprobes/p_6016_0x0000000000446420 6016:0x0000000000446420 %ip=%ip %ax=%ax
> # cat events/uprobes/p_6016_0x0000000000446420/enable
> 0
> [enable the event]
> # echo 1 > events/uprobes/p_6016_0x0000000000446420/enable
> # cat events/uprobes/p_6016_0x0000000000446420/enable
> 1
> # #### do some activity on the program so that it hits the breakpoint
> # cat uprobe_profile
>   6016 p_6016_0x0000000000446420                                234
> # tracer: nop
> #
> #           TASK-PID    CPU#    TIMESTAMP  FUNCTION
> #              | |       |          |         |
>              zsh-6016  [004] 227931.093579: p_6016_0x0000000000446420: (0x446420) %ip=446421 %ax=79
>              zsh-6016  [005] 227931.097541: p_6016_0x0000000000446420: (0x446420) %ip=446421 %ax=79
>              zsh-6016  [000] 227931.124909: p_6016_0x0000000000446420: (0x446420) %ip=446421 %ax=79
>              zsh-6016  [001] 227933.128565: p_6016_0x0000000000446420: (0x446420) %ip=446421 %ax=79
>              zsh-6016  [004] 227933.132756: p_6016_0x0000000000446420: (0x446420) %ip=446421 %ax=79
>              zsh-6016  [000] 227933.158802: p_6016_0x0000000000446420: (0x446420) %ip=446421 %ax=79
>              zsh-6016  [001] 227935.161602: p_6016_0x0000000000446420: (0x446420) %ip=446421 %ax=79
>              zsh-6016  [004] 227935.165229: p_6016_0x0000000000446420: (0x446420) %ip=446421 %ax=79
> 
>  arch/Kconfig                |   11 -
>  kernel/trace/Kconfig        |   16 +
>  kernel/trace/Makefile       |    1 
>  kernel/trace/trace.h        |    5 
>  kernel/trace/trace_probe.h  |    2 
>  kernel/trace/trace_uprobe.c |  739 +++++++++++++++++++++++++++++++++++++++++++
>  6 files changed, 764 insertions(+), 10 deletions(-)
>  create mode 100644 kernel/trace/trace_uprobe.c
> 
> 
> diff --git a/arch/Kconfig b/arch/Kconfig
> index c8c8e3f..af167f8 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -48,16 +48,7 @@ config OPTPROBES
>  	select KALLSYMS_ALL
>  
>  config UPROBES
> -	bool "User-space probes (EXPERIMENTAL)"
> -	default n
> -	depends on ARCH_SUPPORTS_UPROBES
> -	depends on MMU
> -	help
> -	  Uprobes enables kernel subsystems to establish probepoints
> -	  in user applications and execute handler functions when
> -	  the probepoints are hit. For more information, refer to
> -	  Documentation/uprobes.txt.
> -	  If in doubt, say "N".
> +	def_bool n
>  
>  config HAVE_EFFICIENT_UNALIGNED_ACCESS
>  	bool
> diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
> index c681fa7..c77ba2d 100644
> --- a/kernel/trace/Kconfig
> +++ b/kernel/trace/Kconfig
> @@ -377,6 +377,22 @@ config KPROBE_EVENT
>  	  This option is also required by perf-probe subcommand of perf tools.
>  	  If you want to use perf tools, this option is strongly recommended.
>  
> +config UPROBE_EVENT
> +	bool "Enable uprobes-based dynamic events"
> +	depends on ARCH_SUPPORTS_UPROBES
> +	depends on MMU
> +	select UPROBES
> +	select PROBE_EVENTS
> +	select TRACING
> +	default n
> +	help
> +	  This allows the user to add tracing events on top of userspace dynamic
> +	  events (similar to tracepoints) on the fly via the traceevents interface.
> +	  Those events can be inserted wherever uprobes can probe, and record
> +	  various registers.
> +	  This option is required if you plan to use perf-probe subcommand of perf
> +	  tools on user space applications.
> +



Why did you split CONFIG_UPROBES and CONFIG_UPROBE_EVENT?
Is there another kind of use of uprobes than through "trace events"?

Hmm, speaking about it, I think kprobes has the same problem. In fact
now I remember I noticed it by the past but we found another user of
kprobes, mostly unused I guess.

Anyway, uprobes config itself doesn't need to be split from uprobes events.

Also, what about the "Dynamic Probes" menu I proposed? (it's possibly a
crappy idea, I don't know).


  reply	other threads:[~2010-08-02  2:28 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-27 11:08 [PATCHv10 2.6.35-rc6-tip 0/14] Uprobes Patches Srikar Dronamraju
2010-07-27 11:09 ` [PATCHv10 2.6.35-rc6-tip 1/14] mm: Move replace_page() / write_protect_page() to mm/memory.c Srikar Dronamraju
2010-07-27 11:09 ` [PATCHv10 2.6.35-rc6-tip 2/14] uprobes: Breakpoint insertion/removal in user space applications Srikar Dronamraju
2010-07-27 11:09 ` [PATCHv10 2.6.35-rc6-tip 3/14] uprobes: Slot allocation for Execution out of line(XOL) Srikar Dronamraju
2010-07-27 11:09 ` [PATCHv10 2.6.35-rc6-tip 4/14] uprobes: x86 specific functions for user space breakpointing Srikar Dronamraju
2010-07-27 11:09 ` [PATCHv10 2.6.35-rc6-tip 5/14] uprobes: Uprobes (un)registration and exception handling Srikar Dronamraju
2010-07-27 11:10 ` [PATCHv10 2.6.35-rc6-tip 6/14] uprobes: X86 support for Uprobes Srikar Dronamraju
2010-07-27 11:10 ` [PATCHv10 2.6.35-rc6-tip 7/14] uprobes: Uprobes Documentation Srikar Dronamraju
2010-07-27 11:10 ` [PATCHv10 2.6.35-rc6-tip 8/14] trace: Extract out common code for kprobes/uprobes traceevents Srikar Dronamraju
2010-07-27 13:22   ` Masami Hiramatsu
2010-07-27 14:03     ` Srikar Dronamraju
2010-07-28  7:56       ` Masami Hiramatsu
2010-07-29 14:16     ` Srikar Dronamraju
2010-07-27 11:10 ` [PATCHv10 2.6.35-rc6-tip 9/14] trace: uprobes trace_event interface Srikar Dronamraju
2010-07-29  5:04   ` Masami Hiramatsu
2010-08-02  2:20     ` Frederic Weisbecker
2010-08-02  3:45       ` Masami Hiramatsu
2010-08-02  6:46         ` Srikar Dronamraju
2010-08-02  7:58           ` Frederic Weisbecker
2010-08-02  7:46         ` Frederic Weisbecker
2010-08-02  7:56           ` Ingo Molnar
2010-08-02  8:00             ` Christoph Hellwig
2010-08-02  9:29               ` Masami Hiramatsu
2010-08-02  9:36                 ` Christoph Hellwig
2010-07-29  5:04   ` Masami Hiramatsu
2010-07-29  5:20     ` Srikar Dronamraju
2010-07-29 14:15     ` Srikar Dronamraju
2010-08-02  2:28       ` Frederic Weisbecker [this message]
2010-07-27 11:10 ` [PATCHv10 2.6.35-rc6-tip 10/14] perf: rename common fields/functions from kprobe to probe Srikar Dronamraju
2010-07-29 11:51   ` Masami Hiramatsu
2010-07-29 14:13     ` Srikar Dronamraju
2010-07-29 19:42       ` Arnaldo Carvalho de Melo
2010-08-02  7:53       ` [tip:perf/core] perf probe: Rename " tip-bot for Srikar Dronamraju
2010-07-27 11:11 ` [PATCHv10 2.6.35-rc6-tip 11/14] perf: perf interface for uprobes Srikar Dronamraju
2010-07-29 12:01   ` Masami Hiramatsu
2010-07-29 14:11     ` Srikar Dronamraju
2010-07-30 19:19   ` Arnaldo Carvalho de Melo
2010-07-31  2:57     ` Srikar Dronamraju
2010-07-31 19:30       ` Arnaldo Carvalho de Melo
2010-08-02  1:51         ` Masami Hiramatsu
2010-08-02 12:27     ` Srikar Dronamraju
2010-08-02 14:56       ` Arnaldo Carvalho de Melo
2010-08-02 12:38     ` [PATCH] perf: expose event__process function Srikar Dronamraju
2010-08-05  8:01       ` [tip:perf/core] " tip-bot for Srikar Dronamraju
2010-08-02 12:41     ` [PATCHv10 2.6.35-rc6-tip 11/14] perf: perf interface for uprobes Srikar Dronamraju
2010-07-27 11:11 ` [PATCHv10 2.6.35-rc6-tip 12/14] perf: Add third parameter to symbol_filter_t Srikar Dronamraju
2010-08-05 15:19   ` Arnaldo Carvalho de Melo
2010-08-05 15:20     ` Arnaldo Carvalho de Melo
2010-08-05 15:23     ` Srikar Dronamraju
2010-07-27 11:11 ` [PATCHv10 2.6.35-rc6-tip 13/14] [RFC] perf: Show Potential probe points Srikar Dronamraju
2010-07-27 11:11 ` [PATCHv10 2.6.35-rc6-tip 14/14] [RFC] perf: show functions in a file without using pid Srikar Dronamraju

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=20100802022840.GC5581@nowhere \
    --to=fweisbec@gmail.com \
    --cc=2nddept-manager@sdl.hitachi.co.jp \
    --cc=acme@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=ananth@in.ibm.com \
    --cc=fche@redhat.com \
    --cc=hch@infradead.org \
    --cc=jkenisto@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@elte.hu \
    --cc=mjw@redhat.com \
    --cc=naren.devaiah@in.ibm.com \
    --cc=oleg@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rdunlap@xenotime.net \
    --cc=rostedt@goodmis.org \
    --cc=srikar@linux.vnet.ibm.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 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.