From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934697Ab0CLXOG (ORCPT ); Fri, 12 Mar 2010 18:14:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28093 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932279Ab0CLXOE (ORCPT ); Fri, 12 Mar 2010 18:14:04 -0500 From: Masami Hiramatsu Subject: [PATCH -tip 1/3] kprobes: Hide CONFIG_OPTPROBES and set if arch support optimized kprobes To: Ingo Molnar , lkml Cc: systemtap , DLE , Masami Hiramatsu , Dieter Ries , Ingo Molnar , Ananth N Mavinakayanahalli Date: Fri, 12 Mar 2010 18:22:09 -0500 Message-ID: <20100312232208.2017.55337.stgit@localhost6.localdomain6> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Dieter Ries Cc: Ingo Molnar Cc: Ananth N Mavinakayanahalli --- 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