linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v20] tracing: Fix kconfig warning due to a typo
@ 2012-05-08 11:11 Srikar Dronamraju
  2012-05-08 11:29 ` Peter Zijlstra
  2012-05-08 12:49 ` [tip:perf/uprobes] " tip-bot for Srikar Dronamraju
  0 siblings, 2 replies; 8+ messages in thread
From: Srikar Dronamraju @ 2012-05-08 11:11 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar
  Cc: Linus Torvalds, Ananth N Mavinakayanahalli, LKML, Oleg Nesterov,
	Christoph Hellwig, Steven Rostedt, Arnaldo Carvalho de Melo,
	Masami Hiramatsu, Anton Arapov, Stephen Boyd

From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>

Commit f3f096cfe ("tracing: Provide trace events interface for
uprobes") throws a warning about unmet dependencies.

The exact warning message is:
	warning: (UPROBE_EVENT) selects UPROBES which has unmet
direct dependencies (UPROBE_EVENTS && PERF_EVENTS)

This is due to a typo in arch/Kconfig file. Fix similar typos in
uprobetracer documentation.

Also add sample format of a uprobe event in the uprobetracer
documentation as suggested by Masami Hiramatsu.

Reported-by: Stephen Boyd <sboyd@codeaurora.org>
Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
---
 Documentation/trace/uprobetracer.txt |   22 ++++++++++++++++++++--
 arch/Kconfig                         |    2 +-
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/Documentation/trace/uprobetracer.txt b/Documentation/trace/uprobetracer.txt
index eae40a0..24ce682 100644
--- a/Documentation/trace/uprobetracer.txt
+++ b/Documentation/trace/uprobetracer.txt
@@ -5,7 +5,7 @@
 Overview
 --------
 Uprobe based trace events are similar to kprobe based trace events.
-To enable this feature, build your kernel with CONFIG_UPROBE_EVENTS=y.
+To enable this feature, build your kernel with CONFIG_UPROBE_EVENT=y.
 
 Similar to the kprobe-event tracer, this doesn't need to be activated via
 current_tracer. Instead of that, add probe points via
@@ -68,7 +68,25 @@ in the object. We can see the events that are registered by looking at the
 uprobe_events file.
 
     # cat uprobe_events
-    p:uprobes/p_zsh_0x46420 /bin/zsh:0x0000000000046420
+    p:uprobes/p_zsh_0x46420 /bin/zsh:0x00046420 arg1=%ip arg2=%ax
+
+The format of events can be seen by viewing the file events/uprobes/p_zsh_0x46420/format
+
+    # cat events/uprobes/p_zsh_0x46420/format
+    name: p_zsh_0x46420
+    ID: 922
+    format:
+	field:unsigned short common_type;	offset:0;	size:2;	signed:0;
+	field:unsigned char common_flags;	offset:2;	size:1;	signed:0;
+	field:unsigned char common_preempt_count;	offset:3;	size:1;	signed:0;
+	field:int common_pid;	offset:4;	size:4;	signed:1;
+	field:int common_padding;	offset:8;	size:4;	signed:1;
+
+	field:unsigned long __probe_ip;	offset:12;	size:4;	signed:0;
+	field:u32 arg1;	offset:16;	size:4;	signed:0;
+	field:u32 arg2;	offset:20;	size:4;	signed:0;
+
+    print fmt: "(%lx) arg1=%lx arg2=%lx", REC->__probe_ip, REC->arg1, REC->arg2
 
 Right after definition, each event is disabled by default. For tracing these
 events, you need to enable it by:
diff --git a/arch/Kconfig b/arch/Kconfig
index 9e2fbb5..c160d92 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -78,7 +78,7 @@ config OPTPROBES
 
 config UPROBES
 	bool "Transparent user-space probes (EXPERIMENTAL)"
-	depends on UPROBE_EVENTS && PERF_EVENTS
+	depends on UPROBE_EVENT && PERF_EVENTS
 	default n
 	help
 	  Uprobes is the user-space counterpart to kprobes: they



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v20] tracing: Fix kconfig warning due to a typo
  2012-05-08 11:11 [PATCH v20] tracing: Fix kconfig warning due to a typo Srikar Dronamraju
@ 2012-05-08 11:29 ` Peter Zijlstra
  2012-05-08 12:48   ` Steven Rostedt
  2012-05-08 12:49 ` [tip:perf/uprobes] " tip-bot for Srikar Dronamraju
  1 sibling, 1 reply; 8+ messages in thread
From: Peter Zijlstra @ 2012-05-08 11:29 UTC (permalink / raw)
  To: Srikar Dronamraju
  Cc: Ingo Molnar, Linus Torvalds, Ananth N Mavinakayanahalli, LKML,
	Oleg Nesterov, Christoph Hellwig, Steven Rostedt,
	Arnaldo Carvalho de Melo, Masami Hiramatsu, Anton Arapov,
	Stephen Boyd

On Tue, 2012-05-08 at 16:41 +0530, Srikar Dronamraju wrote:
> +    p:uprobes/p_zsh_0x46420 /bin/zsh:0x00046420 arg1=%ip arg2=%ax

can you also do things like:

 p:uprobes/ponies /bin/zsh:foo arg1=bar

when bar is either a function argument of foo (or an otherwise live
variable at the probe point)?

Only sampling register content is somewhat limiting, you might want to
have %ax[5] + 24 for example, or a pure memory deref -- and the dwarves
know where it all lives.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v20] tracing: Fix kconfig warning due to a typo
  2012-05-08 11:29 ` Peter Zijlstra
@ 2012-05-08 12:48   ` Steven Rostedt
  2012-05-08 13:17     ` Peter Zijlstra
  0 siblings, 1 reply; 8+ messages in thread
From: Steven Rostedt @ 2012-05-08 12:48 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Srikar Dronamraju, Ingo Molnar, Linus Torvalds,
	Ananth N Mavinakayanahalli, LKML, Oleg Nesterov,
	Christoph Hellwig, Arnaldo Carvalho de Melo, Masami Hiramatsu,
	Anton Arapov, Stephen Boyd

On Tue, 2012-05-08 at 13:29 +0200, Peter Zijlstra wrote:
> On Tue, 2012-05-08 at 16:41 +0530, Srikar Dronamraju wrote:
> > +    p:uprobes/p_zsh_0x46420 /bin/zsh:0x00046420 arg1=%ip arg2=%ax
> 
> can you also do things like:
> 
>  p:uprobes/ponies /bin/zsh:foo arg1=bar
> 
> when bar is either a function argument of foo (or an otherwise live
> variable at the probe point)?
> 
> Only sampling register content is somewhat limiting, you might want to
> have %ax[5] + 24 for example, or a pure memory deref -- and the dwarves
> know where it all lives.

But this is for the raw entry into the kernel. The kernel wont know the
variable name. Although perf could do that parsing for you.

That said, the %ax[5] + 24 could be done in kernel, and that would be
useful. Does kprobes handle that?

-- Steve



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [tip:perf/uprobes] tracing: Fix kconfig warning due to a typo
  2012-05-08 11:11 [PATCH v20] tracing: Fix kconfig warning due to a typo Srikar Dronamraju
  2012-05-08 11:29 ` Peter Zijlstra
@ 2012-05-08 12:49 ` tip-bot for Srikar Dronamraju
  1 sibling, 0 replies; 8+ messages in thread
From: tip-bot for Srikar Dronamraju @ 2012-05-08 12:49 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, torvalds, peterz, sboyd, hch, anton,
	ananth, masami.hiramatsu.pt, acme, rostedt, srikar, tglx, oleg

Commit-ID:  ec83db0f78cd44c3b586ec1c3a348d1a8a389797
Gitweb:     http://git.kernel.org/tip/ec83db0f78cd44c3b586ec1c3a348d1a8a389797
Author:     Srikar Dronamraju <srikar@linux.vnet.ibm.com>
AuthorDate: Tue, 8 May 2012 16:41:26 +0530
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 8 May 2012 14:17:25 +0200

tracing: Fix kconfig warning due to a typo

Commit f3f096cfe ("tracing: Provide trace events interface for
uprobes") throws a warning about unmet dependencies.

The exact warning message is:
	warning: (UPROBE_EVENT) selects UPROBES which has unmet direct dependencies (UPROBE_EVENTS && PERF_EVENTS)

This is due to a typo in arch/Kconfig file. Fix similar typos in
the uprobetracer documentation.

Also add sample format of a uprobe event in the uprobetracer
documentation as suggested by Masami Hiramatsu.

Reported-by: Stephen Boyd <sboyd@codeaurora.org>
Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Anton Arapov <anton@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20120508111126.21004.38285.sendpatchset@srdronam.in.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 Documentation/trace/uprobetracer.txt |   22 ++++++++++++++++++++--
 arch/Kconfig                         |    2 +-
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/Documentation/trace/uprobetracer.txt b/Documentation/trace/uprobetracer.txt
index eae40a0..24ce682 100644
--- a/Documentation/trace/uprobetracer.txt
+++ b/Documentation/trace/uprobetracer.txt
@@ -5,7 +5,7 @@
 Overview
 --------
 Uprobe based trace events are similar to kprobe based trace events.
-To enable this feature, build your kernel with CONFIG_UPROBE_EVENTS=y.
+To enable this feature, build your kernel with CONFIG_UPROBE_EVENT=y.
 
 Similar to the kprobe-event tracer, this doesn't need to be activated via
 current_tracer. Instead of that, add probe points via
@@ -68,7 +68,25 @@ in the object. We can see the events that are registered by looking at the
 uprobe_events file.
 
     # cat uprobe_events
-    p:uprobes/p_zsh_0x46420 /bin/zsh:0x0000000000046420
+    p:uprobes/p_zsh_0x46420 /bin/zsh:0x00046420 arg1=%ip arg2=%ax
+
+The format of events can be seen by viewing the file events/uprobes/p_zsh_0x46420/format
+
+    # cat events/uprobes/p_zsh_0x46420/format
+    name: p_zsh_0x46420
+    ID: 922
+    format:
+	field:unsigned short common_type;	offset:0;	size:2;	signed:0;
+	field:unsigned char common_flags;	offset:2;	size:1;	signed:0;
+	field:unsigned char common_preempt_count;	offset:3;	size:1;	signed:0;
+	field:int common_pid;	offset:4;	size:4;	signed:1;
+	field:int common_padding;	offset:8;	size:4;	signed:1;
+
+	field:unsigned long __probe_ip;	offset:12;	size:4;	signed:0;
+	field:u32 arg1;	offset:16;	size:4;	signed:0;
+	field:u32 arg2;	offset:20;	size:4;	signed:0;
+
+    print fmt: "(%lx) arg1=%lx arg2=%lx", REC->__probe_ip, REC->arg1, REC->arg2
 
 Right after definition, each event is disabled by default. For tracing these
 events, you need to enable it by:
diff --git a/arch/Kconfig b/arch/Kconfig
index 0f8f968..2880abf 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -78,7 +78,7 @@ config OPTPROBES
 
 config UPROBES
 	bool "Transparent user-space probes (EXPERIMENTAL)"
-	depends on UPROBE_EVENTS && PERF_EVENTS
+	depends on UPROBE_EVENT && PERF_EVENTS
 	default n
 	help
 	  Uprobes is the user-space counterpart to kprobes: they

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v20] tracing: Fix kconfig warning due to a typo
  2012-05-08 12:48   ` Steven Rostedt
@ 2012-05-08 13:17     ` Peter Zijlstra
  2012-05-09  5:55       ` Masami Hiramatsu
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Zijlstra @ 2012-05-08 13:17 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Srikar Dronamraju, Ingo Molnar, Linus Torvalds,
	Ananth N Mavinakayanahalli, LKML, Oleg Nesterov,
	Christoph Hellwig, Arnaldo Carvalho de Melo, Masami Hiramatsu,
	Anton Arapov, Stephen Boyd

On Tue, 2012-05-08 at 08:48 -0400, Steven Rostedt wrote:
> On Tue, 2012-05-08 at 13:29 +0200, Peter Zijlstra wrote:
> > On Tue, 2012-05-08 at 16:41 +0530, Srikar Dronamraju wrote:
> > > +    p:uprobes/p_zsh_0x46420 /bin/zsh:0x00046420 arg1=%ip arg2=%ax
> > 
> > can you also do things like:
> > 
> >  p:uprobes/ponies /bin/zsh:foo arg1=bar
> > 
> > when bar is either a function argument of foo (or an otherwise live
> > variable at the probe point)?
> > 
> > Only sampling register content is somewhat limiting, you might want to
> > have %ax[5] + 24 for example, or a pure memory deref -- and the dwarves
> > know where it all lives.
> 
> But this is for the raw entry into the kernel. The kernel wont know the
> variable name. Although perf could do that parsing for you.

Ah, ok. Yes I meant for perf to do this, I overlooked it was the kernel
input.

> That said, the %ax[5] + 24 could be done in kernel, and that would be
> useful. Does kprobes handle that?

In general something like: %mr + %c * %cr + %cr would be most useful I
think (%m - memory address, %r - register, %c - constant). Although
maybe it needs segment registers too, dunno. Also no idea if this covers
the addressing scope of all archs.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v20] tracing: Fix kconfig warning due to a typo
  2012-05-08 13:17     ` Peter Zijlstra
@ 2012-05-09  5:55       ` Masami Hiramatsu
  2012-05-09 10:57         ` Peter Zijlstra
  0 siblings, 1 reply; 8+ messages in thread
From: Masami Hiramatsu @ 2012-05-09  5:55 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Steven Rostedt, Srikar Dronamraju, Ingo Molnar, Linus Torvalds,
	Ananth N Mavinakayanahalli, LKML, Oleg Nesterov,
	Christoph Hellwig, Arnaldo Carvalho de Melo, Anton Arapov,
	Stephen Boyd, yrl.pp-manager.tt

(2012/05/08 22:17), Peter Zijlstra wrote:
> On Tue, 2012-05-08 at 08:48 -0400, Steven Rostedt wrote:
>> On Tue, 2012-05-08 at 13:29 +0200, Peter Zijlstra wrote:
>>> On Tue, 2012-05-08 at 16:41 +0530, Srikar Dronamraju wrote:
>>>> +    p:uprobes/p_zsh_0x46420 /bin/zsh:0x00046420 arg1=%ip arg2=%ax
>>>
>>> can you also do things like:
>>>
>>>  p:uprobes/ponies /bin/zsh:foo arg1=bar
>>>
>>> when bar is either a function argument of foo (or an otherwise live
>>> variable at the probe point)?
>>>
>>> Only sampling register content is somewhat limiting, you might want to
>>> have %ax[5] + 24 for example, or a pure memory deref -- and the dwarves
>>> know where it all lives.
>>
>> But this is for the raw entry into the kernel. The kernel wont know the
>> variable name. Although perf could do that parsing for you.
> 
> Ah, ok. Yes I meant for perf to do this, I overlooked it was the kernel
> input.

Right, perf-probe can provide that interface, if we can find debuginfo.

>> That said, the %ax[5] + 24 could be done in kernel, and that would be
>> useful. Does kprobes handle that?
> 
> In general something like: %mr + %c * %cr + %cr would be most useful I
> think (%m - memory address, %r - register, %c - constant). Although
> maybe it needs segment registers too, dunno. Also no idea if this covers
> the addressing scope of all archs.

Would you mean SIB + displacement addressing? :)

Currently, kprobe tracer just accept [[%mr + %c] + %c] ...,
because it's a basic functionality for accessing members of
a data structure.

I see that this is not enough for the person who want to debug
kernel in machine code level.
Now I'm considering that it may be better to re-implement
internal argument parser/fetcher for supporting those kind
of memory addressing.

Thank you,


-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v20] tracing: Fix kconfig warning due to a typo
  2012-05-09  5:55       ` Masami Hiramatsu
@ 2012-05-09 10:57         ` Peter Zijlstra
  2012-05-10 11:47           ` Masami Hiramatsu
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Zijlstra @ 2012-05-09 10:57 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: Steven Rostedt, Srikar Dronamraju, Ingo Molnar, Linus Torvalds,
	Ananth N Mavinakayanahalli, LKML, Oleg Nesterov,
	Christoph Hellwig, Arnaldo Carvalho de Melo, Anton Arapov,
	Stephen Boyd, yrl.pp-manager.tt

On Wed, 2012-05-09 at 14:55 +0900, Masami Hiramatsu wrote:
> Would you mean SIB + displacement addressing? :)

Yeah something like that. Basically something that's powerful enough to
cover all things directly addressable by an architecture (for all
archs). So that if you put a probe at a specific location you can indeed
obtain all life variables at that spot.

This would include segment prefixes for x86 so we can get at per-cpu
variables.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Re: [PATCH v20] tracing: Fix kconfig warning due to a typo
  2012-05-09 10:57         ` Peter Zijlstra
@ 2012-05-10 11:47           ` Masami Hiramatsu
  0 siblings, 0 replies; 8+ messages in thread
From: Masami Hiramatsu @ 2012-05-10 11:47 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Steven Rostedt, Srikar Dronamraju, Ingo Molnar, Linus Torvalds,
	Ananth N Mavinakayanahalli, LKML, Oleg Nesterov,
	Christoph Hellwig, Arnaldo Carvalho de Melo, Anton Arapov,
	Stephen Boyd, yrl.pp-manager.tt

(2012/05/09 19:57), Peter Zijlstra wrote:
> On Wed, 2012-05-09 at 14:55 +0900, Masami Hiramatsu wrote:
>> Would you mean SIB + displacement addressing? :)
> 
> Yeah something like that. Basically something that's powerful enough to
> cover all things directly addressable by an architecture (for all
> archs). So that if you put a probe at a specific location you can indeed
> obtain all life variables at that spot.
> 
> This would include segment prefixes for x86 so we can get at per-cpu
> variables.

Ah, right. Hmm, the problem is that this interface's syntax should be
arch-independent. It need to be extended to support more complex
addressing mode.

Thank you for the request!

-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-05-10 11:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-08 11:11 [PATCH v20] tracing: Fix kconfig warning due to a typo Srikar Dronamraju
2012-05-08 11:29 ` Peter Zijlstra
2012-05-08 12:48   ` Steven Rostedt
2012-05-08 13:17     ` Peter Zijlstra
2012-05-09  5:55       ` Masami Hiramatsu
2012-05-09 10:57         ` Peter Zijlstra
2012-05-10 11:47           ` Masami Hiramatsu
2012-05-08 12:49 ` [tip:perf/uprobes] " tip-bot for Srikar Dronamraju

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).