public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [PATCH -tip 2/3] [BUGFIX] perf probe: Fix probe_point buffer overrun
  2010-03-12 23:13 [PATCH -tip 1/3] kprobes: Hide CONFIG_OPTPROBES and set if arch support optimized kprobes Masami Hiramatsu
@ 2010-03-12 23:13 ` Masami Hiramatsu
  2010-03-13 12:27   ` [tip:perf/urgent] " tip-bot for Masami Hiramatsu
  2010-03-12 23:13 ` [PATCH -tip 3/3] [BUGFIX] perf probe: Set need_dwarf if lazy matching is used Masami Hiramatsu
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Masami Hiramatsu @ 2010-03-12 23:13 UTC (permalink / raw)
  To: Ingo Molnar, lkml; +Cc: systemtap, DLE, Masami Hiramatsu, Ingo Molnar

Fix probe_point array-size overrun problem. In some cases (e.g. inline
function), one user-specified probe-point can be translated to many
probe address, and it overruns pre-defined array-size.
This also removes redundant MAX_PROBES macro definition.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
---

 tools/perf/builtin-probe.c     |    1 -
 tools/perf/util/probe-finder.c |    3 +++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index c30a335..152d6c9 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -47,7 +47,6 @@
 #include "util/probe-event.h"
 
 #define MAX_PATH_LEN 256
-#define MAX_PROBES 128
 
 /* Session management structure */
 static struct {
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 1e6c65e..f9cbbf1 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -455,6 +455,9 @@ static void show_probe_point(Dwarf_Die *sp_die, struct probe_finder *pf)
 	/* *pf->fb_ops will be cached in libdw. Don't free it. */
 	pf->fb_ops = NULL;
 
+	if (pp->found == MAX_PROBES)
+		die("Too many( > %d) probe point found.\n", MAX_PROBES);
+
 	pp->probes[pp->found] = strdup(tmp);
 	pp->found++;
 }


-- 
Masami Hiramatsu
e-mail: mhiramat@redhat.com

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

* [PATCH -tip 1/3] kprobes: Hide CONFIG_OPTPROBES and set if arch  support optimized kprobes
@ 2010-03-12 23:13 Masami Hiramatsu
  2010-03-12 23:13 ` [PATCH -tip 2/3] [BUGFIX] perf probe: Fix probe_point buffer overrun Masami Hiramatsu
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Masami Hiramatsu @ 2010-03-12 23:13 UTC (permalink / raw)
  To: Ingo Molnar, lkml
  Cc: systemtap, DLE, Masami Hiramatsu, Dieter Ries, Ingo Molnar,
	Ananth N Mavinakayanahalli

Hide CONFIG_OPTPROBES and set if arch support optimized kprobes, since
this option doesn't change the behavior of kprobes, but just reduces
the overhead.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Dieter Ries <mail@dieterries.net>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
---

 Documentation/kprobes.txt |   10 ++--------
 arch/Kconfig              |    6 ++----
 2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt
index 2f9115c..61c291c 100644
--- a/Documentation/kprobes.txt
+++ b/Documentation/kprobes.txt
@@ -165,8 +165,8 @@ the user entry_handler invocation is also skipped.
 
 1.4 How Does Jump Optimization Work?
 
-If you configured your kernel with CONFIG_OPTPROBES=y (currently
-this option is supported on x86/x86-64, non-preemptive kernel) and
+If your kernel is built with CONFIG_OPTPROBES=y (currently this flag
+is automatically set 'y' on x86/x86-64, non-preemptive kernel) and
 the "debug.kprobes_optimization" kernel parameter is set to 1 (see
 sysctl(8)), Kprobes tries to reduce probe-hit overhead by using a jump
 instruction instead of a breakpoint instruction at each probepoint.
@@ -271,8 +271,6 @@ tweak the kernel's execution path, you need to suppress optimization,
 using one of the following techniques:
 - Specify an empty function for the kprobe's post_handler or break_handler.
  or
-- Config CONFIG_OPTPROBES=n.
- or
 - Execute 'sysctl -w debug.kprobes_optimization=n'
 
 2. Architectures Supported
@@ -307,10 +305,6 @@ it useful to "Compile the kernel with debug info" (CONFIG_DEBUG_INFO),
 so you can use "objdump -d -l vmlinux" to see the source-to-object
 code mapping.
 
-If you want to reduce probing overhead, set "Kprobes jump optimization
-support" (CONFIG_OPTPROBES) to "y". You can find this option under the
-"Kprobes" line.
-
 4. API Reference
 
 The Kprobes API includes a "register" function and an "unregister"
diff --git a/arch/Kconfig b/arch/Kconfig
index e5eb133..12f9dcc 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -42,11 +42,9 @@ config KPROBES
 	  If in doubt, say "N".
 
 config OPTPROBES
-	bool "Kprobes jump optimization support (EXPERIMENTAL)"
-	default y
-	depends on KPROBES
+	def_bool y
+	depends on KPROBES && HAVE_OPTPROBES
 	depends on !PREEMPT
-	depends on HAVE_OPTPROBES
 	select KALLSYMS_ALL
 	help
 	  This option will allow kprobes to optimize breakpoint to


-- 
Masami Hiramatsu
e-mail: mhiramat@redhat.com

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

* [PATCH -tip 3/3] [BUGFIX] perf probe: Set need_dwarf if lazy matching  is used
  2010-03-12 23:13 [PATCH -tip 1/3] kprobes: Hide CONFIG_OPTPROBES and set if arch support optimized kprobes Masami Hiramatsu
  2010-03-12 23:13 ` [PATCH -tip 2/3] [BUGFIX] perf probe: Fix probe_point buffer overrun Masami Hiramatsu
@ 2010-03-12 23:13 ` Masami Hiramatsu
  2010-03-13 12:27   ` [tip:perf/urgent] perf probe: Fix need_dwarf flag " tip-bot for Masami Hiramatsu
  2010-03-13  7:28 ` [PATCH -tip 1/3] kprobes: Hide CONFIG_OPTPROBES and set if arch support optimized kprobes Ingo Molnar
  2010-03-14  0:15 ` [PATCH -tip 1/3] kprobes: Hide CONFIG_OPTPROBES and set if arch support " OGAWA Hirofumi
  3 siblings, 1 reply; 10+ messages in thread
From: Masami Hiramatsu @ 2010-03-12 23:13 UTC (permalink / raw)
  To: Ingo Molnar, lkml; +Cc: systemtap, DLE, Masami Hiramatsu, Ingo Molnar

Set need_dwarf if lazy matching pattern is specified, because
lazy matching requires real source path for which we must use
debuginfo.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
---

 tools/perf/util/probe-event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 53181db..7c004b6 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -242,7 +242,7 @@ void parse_perf_probe_event(const char *str, struct probe_point *pp,
 
 	/* Parse probe point */
 	parse_perf_probe_probepoint(argv[0], pp);
-	if (pp->file || pp->line)
+	if (pp->file || pp->line || pp->lazy_line)
 		*need_dwarf = true;
 
 	/* Copy arguments and ensure return probe has no C argument */


-- 
Masami Hiramatsu
e-mail: mhiramat@redhat.com

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

* Re: [PATCH -tip 1/3] kprobes: Hide CONFIG_OPTPROBES and set if arch  support optimized kprobes
  2010-03-12 23:13 [PATCH -tip 1/3] kprobes: Hide CONFIG_OPTPROBES and set if arch support optimized kprobes Masami Hiramatsu
  2010-03-12 23:13 ` [PATCH -tip 2/3] [BUGFIX] perf probe: Fix probe_point buffer overrun Masami Hiramatsu
  2010-03-12 23:13 ` [PATCH -tip 3/3] [BUGFIX] perf probe: Set need_dwarf if lazy matching is used Masami Hiramatsu
@ 2010-03-13  7:28 ` Ingo Molnar
  2010-03-15 16:52   ` [PATCH -tip v3] " Masami Hiramatsu
  2010-03-14  0:15 ` [PATCH -tip 1/3] kprobes: Hide CONFIG_OPTPROBES and set if arch support " OGAWA Hirofumi
  3 siblings, 1 reply; 10+ messages in thread
From: Ingo Molnar @ 2010-03-13  7:28 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: lkml, systemtap, DLE, Dieter Ries, Ananth N Mavinakayanahalli


* Masami Hiramatsu <mhiramat@redhat.com> wrote:

>  config OPTPROBES
> -	bool "Kprobes jump optimization support (EXPERIMENTAL)"
> -	default y
> -	depends on KPROBES
> +	def_bool y
> +	depends on KPROBES && HAVE_OPTPROBES
>  	depends on !PREEMPT
> -	depends on HAVE_OPTPROBES
>  	select KALLSYMS_ALL
>  	help
>  	  This option will allow kprobes to optimize breakpoint to

The help text can be removed too, now that it's not interactive. Also, i'd 
suggest to add a comment that this just relays HAVE_OPTPROBES now, set by the 
arch.

	Ingo

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

* [tip:perf/urgent] perf probe: Fix need_dwarf flag if lazy matching is used
  2010-03-12 23:13 ` [PATCH -tip 3/3] [BUGFIX] perf probe: Set need_dwarf if lazy matching is used Masami Hiramatsu
@ 2010-03-13 12:27   ` tip-bot for Masami Hiramatsu
  0 siblings, 0 replies; 10+ messages in thread
From: tip-bot for Masami Hiramatsu @ 2010-03-13 12:27 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, dle-develop, tglx, mhiramat, systemtap, mingo

Commit-ID:  fc6ceea045031658d0b59af562369eae980b4370
Gitweb:     http://git.kernel.org/tip/fc6ceea045031658d0b59af562369eae980b4370
Author:     Masami Hiramatsu <mhiramat@redhat.com>
AuthorDate: Fri, 12 Mar 2010 18:22:24 -0500
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sat, 13 Mar 2010 08:32:22 +0100

perf probe: Fix need_dwarf flag if lazy matching is used

Set need_dwarf if lazy matching pattern is specified, because
lazy matching requires real source path for which we must use
debuginfo.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
LKML-Reference: <20100312232224.2017.54550.stgit@localhost6.localdomain6>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 tools/perf/util/probe-event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 53181db..7c004b6 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -242,7 +242,7 @@ void parse_perf_probe_event(const char *str, struct probe_point *pp,
 
 	/* Parse probe point */
 	parse_perf_probe_probepoint(argv[0], pp);
-	if (pp->file || pp->line)
+	if (pp->file || pp->line || pp->lazy_line)
 		*need_dwarf = true;
 
 	/* Copy arguments and ensure return probe has no C argument */

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

* [tip:perf/urgent] perf probe: Fix probe_point buffer overrun
  2010-03-12 23:13 ` [PATCH -tip 2/3] [BUGFIX] perf probe: Fix probe_point buffer overrun Masami Hiramatsu
@ 2010-03-13 12:27   ` tip-bot for Masami Hiramatsu
  0 siblings, 0 replies; 10+ messages in thread
From: tip-bot for Masami Hiramatsu @ 2010-03-13 12:27 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, dle-develop, stable, tglx, mhiramat,
	mingo, systemtap

Commit-ID:  594087a04eea544356f9c52e83c1a9bc380ce80f
Gitweb:     http://git.kernel.org/tip/594087a04eea544356f9c52e83c1a9bc380ce80f
Author:     Masami Hiramatsu <mhiramat@redhat.com>
AuthorDate: Fri, 12 Mar 2010 18:22:17 -0500
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sat, 13 Mar 2010 08:32:22 +0100

perf probe: Fix probe_point buffer overrun

Fix probe_point array-size overrun problem. In some cases (e.g.
inline function), one user-specified probe-point can be
translated to many probe address, and it overruns pre-defined
array-size. This also removes redundant MAX_PROBES macro
definition.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
Cc: <stable@kernel.org>
LKML-Reference: <20100312232217.2017.45017.stgit@localhost6.localdomain6>
[ Note that only root can create new probes. Eventually we should remove
  the MAX_PROBES limit, but that is a larger patch not eligible to
  perf/urgent treatment. ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 tools/perf/builtin-probe.c     |    1 -
 tools/perf/util/probe-finder.c |    3 +++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index c30a335..152d6c9 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -47,7 +47,6 @@
 #include "util/probe-event.h"
 
 #define MAX_PATH_LEN 256
-#define MAX_PROBES 128
 
 /* Session management structure */
 static struct {
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 1e6c65e..f9cbbf1 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -455,6 +455,9 @@ static void show_probe_point(Dwarf_Die *sp_die, struct probe_finder *pf)
 	/* *pf->fb_ops will be cached in libdw. Don't free it. */
 	pf->fb_ops = NULL;
 
+	if (pp->found == MAX_PROBES)
+		die("Too many( > %d) probe point found.\n", MAX_PROBES);
+
 	pp->probes[pp->found] = strdup(tmp);
 	pp->found++;
 }

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

* Re: [PATCH -tip 1/3] kprobes: Hide CONFIG_OPTPROBES and set if arch support optimized kprobes
  2010-03-12 23:13 [PATCH -tip 1/3] kprobes: Hide CONFIG_OPTPROBES and set if arch support optimized kprobes Masami Hiramatsu
                   ` (2 preceding siblings ...)
  2010-03-13  7:28 ` [PATCH -tip 1/3] kprobes: Hide CONFIG_OPTPROBES and set if arch support optimized kprobes Ingo Molnar
@ 2010-03-14  0:15 ` OGAWA Hirofumi
  2010-03-14  2:05   ` Masami Hiramatsu
  3 siblings, 1 reply; 10+ messages in thread
From: OGAWA Hirofumi @ 2010-03-14  0:15 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: Ingo Molnar, lkml, systemtap, DLE, Dieter Ries,
	Ananth N Mavinakayanahalli

Masami Hiramatsu <mhiramat@redhat.com> writes:

> Hide CONFIG_OPTPROBES and set if arch support optimized kprobes, since
> this option doesn't change the behavior of kprobes, but just reduces
> the overhead.

I don't so care whether this is configurable or not, but this confuses
me now. The following seems to say it's changed, but now this comment
says it wasn't changed. The following docs was obsoleted?

Thanks.

NOTE for geeks:
The jump optimization changes the kprobe's pre_handler behavior.
Without optimization, the pre_handler can change the kernel's execution
path by changing regs->ip and returning 1.  However, when the probe
is optimized, that modification is ignored.  Thus, if you want to
tweak the kernel's execution path, you need to suppress optimization,
using one of the following techniques:
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

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

* Re: [PATCH -tip 1/3] kprobes: Hide CONFIG_OPTPROBES and set if arch  support optimized kprobes
  2010-03-14  0:15 ` [PATCH -tip 1/3] kprobes: Hide CONFIG_OPTPROBES and set if arch support " OGAWA Hirofumi
@ 2010-03-14  2:05   ` Masami Hiramatsu
  0 siblings, 0 replies; 10+ messages in thread
From: Masami Hiramatsu @ 2010-03-14  2:05 UTC (permalink / raw)
  To: OGAWA Hirofumi
  Cc: Ingo Molnar, lkml, systemtap, DLE, Dieter Ries,
	Ananth N Mavinakayanahalli

OGAWA Hirofumi wrote:
> Masami Hiramatsu <mhiramat@redhat.com> writes:
> 
>> Hide CONFIG_OPTPROBES and set if arch support optimized kprobes, since
>> this option doesn't change the behavior of kprobes, but just reduces
>> the overhead.
> 
> I don't so care whether this is configurable or not, but this confuses
> me now. The following seems to say it's changed, but now this comment
> says it wasn't changed. The following docs was obsoleted?
> 
> Thanks.
> 
> NOTE for geeks:
> The jump optimization changes the kprobe's pre_handler behavior.
> Without optimization, the pre_handler can change the kernel's execution
> path by changing regs->ip and returning 1.  However, when the probe
> is optimized, that modification is ignored.  Thus, if you want to
> tweak the kernel's execution path, you need to suppress optimization,
> using one of the following techniques:

Ah, good point. This is only one point of changing the behavior.
So if someone makes an out of tree module for changing the ip
address by using kprobes, e.g. live code patching or something
like that, it will be affected by this change.
However, I think using kprobes for this way is not obviously
documented, moreover, some workarounds for that are documented
as above. So I don't worried about it.

Anyway, indeed, the patch comment is wrong. I need to say "this option
doesn't change the major behavior of kprobes, and workarounds for minor
change are documented." :)

Thank you for pointing it out!


-- 
Masami Hiramatsu
e-mail: mhiramat@redhat.com

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

* [PATCH -tip v3] kprobes: Hide CONFIG_OPTPROBES and set if arch  support optimized kprobes
  2010-03-13  7:28 ` [PATCH -tip 1/3] kprobes: Hide CONFIG_OPTPROBES and set if arch support optimized kprobes Ingo Molnar
@ 2010-03-15 16:52   ` Masami Hiramatsu
  2010-03-16 14:49     ` [tip:perf/core] kprobes: Hide CONFIG_OPTPROBES and set if arch supports " tip-bot for Masami Hiramatsu
  0 siblings, 1 reply; 10+ messages in thread
From: Masami Hiramatsu @ 2010-03-15 16:52 UTC (permalink / raw)
  To: Ingo Molnar, lkml
  Cc: systemtap, DLE, Masami Hiramatsu, Dieter Ries, Ingo Molnar,
	Ananth N Mavinakayanahalli, OGAWA Hirofumi

Hide CONFIG_OPTPROBES and set if the arch supports optimized kprobes
(IOW, HAVE_OPTPROBES=y), since this option doesn't change the major
behavior of kprobes, and workarounds for minor changes are documented.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Dieter Ries <mail@dieterries.net>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
---

 Documentation/kprobes.txt |   10 ++--------
 arch/Kconfig              |    9 ++-------
 2 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt
index 2f9115c..61c291c 100644
--- a/Documentation/kprobes.txt
+++ b/Documentation/kprobes.txt
@@ -165,8 +165,8 @@ the user entry_handler invocation is also skipped.
 
 1.4 How Does Jump Optimization Work?
 
-If you configured your kernel with CONFIG_OPTPROBES=y (currently
-this option is supported on x86/x86-64, non-preemptive kernel) and
+If your kernel is built with CONFIG_OPTPROBES=y (currently this flag
+is automatically set 'y' on x86/x86-64, non-preemptive kernel) and
 the "debug.kprobes_optimization" kernel parameter is set to 1 (see
 sysctl(8)), Kprobes tries to reduce probe-hit overhead by using a jump
 instruction instead of a breakpoint instruction at each probepoint.
@@ -271,8 +271,6 @@ tweak the kernel's execution path, you need to suppress optimization,
 using one of the following techniques:
 - Specify an empty function for the kprobe's post_handler or break_handler.
  or
-- Config CONFIG_OPTPROBES=n.
- or
 - Execute 'sysctl -w debug.kprobes_optimization=n'
 
 2. Architectures Supported
@@ -307,10 +305,6 @@ it useful to "Compile the kernel with debug info" (CONFIG_DEBUG_INFO),
 so you can use "objdump -d -l vmlinux" to see the source-to-object
 code mapping.
 
-If you want to reduce probing overhead, set "Kprobes jump optimization
-support" (CONFIG_OPTPROBES) to "y". You can find this option under the
-"Kprobes" line.
-
 4. API Reference
 
 The Kprobes API includes a "register" function and an "unregister"
diff --git a/arch/Kconfig b/arch/Kconfig
index e5eb133..f06010f 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -42,15 +42,10 @@ config KPROBES
 	  If in doubt, say "N".
 
 config OPTPROBES
-	bool "Kprobes jump optimization support (EXPERIMENTAL)"
-	default y
-	depends on KPROBES
+	def_bool y
+	depends on KPROBES && HAVE_OPTPROBES
 	depends on !PREEMPT
-	depends on HAVE_OPTPROBES
 	select KALLSYMS_ALL
-	help
-	  This option will allow kprobes to optimize breakpoint to
-	  a jump for reducing its overhead.
 
 config HAVE_EFFICIENT_UNALIGNED_ACCESS
 	bool


-- 
Masami Hiramatsu
e-mail: mhiramat@redhat.com

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

* [tip:perf/core] kprobes: Hide CONFIG_OPTPROBES and set if arch supports optimized kprobes
  2010-03-15 16:52   ` [PATCH -tip v3] " Masami Hiramatsu
@ 2010-03-16 14:49     ` tip-bot for Masami Hiramatsu
  0 siblings, 0 replies; 10+ messages in thread
From: tip-bot for Masami Hiramatsu @ 2010-03-16 14:49 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, mingo, a.p.zijlstra, mail, efault, fweisbec, dle-develop,
	hirofumi, tglx, mhiramat, systemtap, hpa, paulus, linux-kernel,
	ananth, mingo

Commit-ID:  5cc718b9dad682329a60e73547c6e708faa5bbe4
Gitweb:     http://git.kernel.org/tip/5cc718b9dad682329a60e73547c6e708faa5bbe4
Author:     Masami Hiramatsu <mhiramat@redhat.com>
AuthorDate: Mon, 15 Mar 2010 13:00:54 -0400
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Tue, 16 Mar 2010 11:07:23 +0100

kprobes: Hide CONFIG_OPTPROBES and set if arch supports optimized kprobes

Hide CONFIG_OPTPROBES and set if the arch supports optimized
kprobes (IOW, HAVE_OPTPROBES=y), since this option doesn't
change the major behavior of kprobes, and workarounds for minor
changes are documented.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
Cc: Dieter Ries <mail@dieterries.net>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20100315170054.31593.3153.stgit@localhost6.localdomain6>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 Documentation/kprobes.txt |   10 ++--------
 arch/Kconfig              |    9 ++-------
 2 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt
index 2f9115c..61c291c 100644
--- a/Documentation/kprobes.txt
+++ b/Documentation/kprobes.txt
@@ -165,8 +165,8 @@ the user entry_handler invocation is also skipped.
 
 1.4 How Does Jump Optimization Work?
 
-If you configured your kernel with CONFIG_OPTPROBES=y (currently
-this option is supported on x86/x86-64, non-preemptive kernel) and
+If your kernel is built with CONFIG_OPTPROBES=y (currently this flag
+is automatically set 'y' on x86/x86-64, non-preemptive kernel) and
 the "debug.kprobes_optimization" kernel parameter is set to 1 (see
 sysctl(8)), Kprobes tries to reduce probe-hit overhead by using a jump
 instruction instead of a breakpoint instruction at each probepoint.
@@ -271,8 +271,6 @@ tweak the kernel's execution path, you need to suppress optimization,
 using one of the following techniques:
 - Specify an empty function for the kprobe's post_handler or break_handler.
  or
-- Config CONFIG_OPTPROBES=n.
- or
 - Execute 'sysctl -w debug.kprobes_optimization=n'
 
 2. Architectures Supported
@@ -307,10 +305,6 @@ it useful to "Compile the kernel with debug info" (CONFIG_DEBUG_INFO),
 so you can use "objdump -d -l vmlinux" to see the source-to-object
 code mapping.
 
-If you want to reduce probing overhead, set "Kprobes jump optimization
-support" (CONFIG_OPTPROBES) to "y". You can find this option under the
-"Kprobes" line.
-
 4. API Reference
 
 The Kprobes API includes a "register" function and an "unregister"
diff --git a/arch/Kconfig b/arch/Kconfig
index e5eb133..f06010f 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -42,15 +42,10 @@ config KPROBES
 	  If in doubt, say "N".
 
 config OPTPROBES
-	bool "Kprobes jump optimization support (EXPERIMENTAL)"
-	default y
-	depends on KPROBES
+	def_bool y
+	depends on KPROBES && HAVE_OPTPROBES
 	depends on !PREEMPT
-	depends on HAVE_OPTPROBES
 	select KALLSYMS_ALL
-	help
-	  This option will allow kprobes to optimize breakpoint to
-	  a jump for reducing its overhead.
 
 config HAVE_EFFICIENT_UNALIGNED_ACCESS
 	bool

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

end of thread, other threads:[~2010-03-16 14:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-12 23:13 [PATCH -tip 1/3] kprobes: Hide CONFIG_OPTPROBES and set if arch support optimized kprobes Masami Hiramatsu
2010-03-12 23:13 ` [PATCH -tip 2/3] [BUGFIX] perf probe: Fix probe_point buffer overrun Masami Hiramatsu
2010-03-13 12:27   ` [tip:perf/urgent] " tip-bot for Masami Hiramatsu
2010-03-12 23:13 ` [PATCH -tip 3/3] [BUGFIX] perf probe: Set need_dwarf if lazy matching is used Masami Hiramatsu
2010-03-13 12:27   ` [tip:perf/urgent] perf probe: Fix need_dwarf flag " tip-bot for Masami Hiramatsu
2010-03-13  7:28 ` [PATCH -tip 1/3] kprobes: Hide CONFIG_OPTPROBES and set if arch support optimized kprobes Ingo Molnar
2010-03-15 16:52   ` [PATCH -tip v3] " Masami Hiramatsu
2010-03-16 14:49     ` [tip:perf/core] kprobes: Hide CONFIG_OPTPROBES and set if arch supports " tip-bot for Masami Hiramatsu
2010-03-14  0:15 ` [PATCH -tip 1/3] kprobes: Hide CONFIG_OPTPROBES and set if arch support " OGAWA Hirofumi
2010-03-14  2:05   ` Masami Hiramatsu

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 read-only IMAP folder(s) and NNTP newsgroup(s).