Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764022AbZANQbn (ORCPT ); Wed, 14 Jan 2009 11:31:43 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759617AbZANQbe (ORCPT ); Wed, 14 Jan 2009 11:31:34 -0500 Received: from mx2.redhat.com ([66.187.237.31]:59317 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759492AbZANQbe (ORCPT ); Wed, 14 Jan 2009 11:31:34 -0500 Message-ID: <496E1357.8050507@redhat.com> Date: Wed, 14 Jan 2009 11:31:19 -0500 From: Masami Hiramatsu User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Andrew Morton CC: Ananth N Mavinakayanahalli , Jim Keniston , David Miller , LKML , systemtap-ml Subject: Re: [PATCH][bugfix] kprobes: fix module compilation error with CONFIG_KPROBES=n References: <49628849.1000706@redhat.com> <20090114003234.3720e9a1.akpm@linux-foundation.org> In-Reply-To: <20090114003234.3720e9a1.akpm@linux-foundation.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2444 Lines: 78 Andrew Morton wrote: > On Mon, 05 Jan 2009 17:23:05 -0500 Masami Hiramatsu wrote: > >> Define kprobes related data structures even if CONFIG_KPROBES is not set. >> This fixes compilation errors which occur if CONFIG_KPROBES is not set, in >> kprobe using modules. >> >> Reviewed-by: Ananth N Mavinakayanahalli >> Signed-off-by: Masami Hiramatsu >> --- >> include/linux/kprobes.h | 45 +++++++++++++++++++++++---------------------- >> 1 file changed, 23 insertions(+), 22 deletions(-) >> >> Index: 2.6.28/include/linux/kprobes.h >> =================================================================== >> --- 2.6.28.orig/include/linux/kprobes.h >> +++ 2.6.28/include/linux/kprobes.h >> @@ -37,9 +37,9 @@ >> #include >> #include >> #include >> +#include >> >> #ifdef CONFIG_KPROBES >> -#include >> > > The above change breaks alpha, and any other architecture which has no > asm/kprobes.h. Oops, indeed. Thank you for finding it! > I undid that change, but maybe that rebroke things? Yes, some structures should be defined in asm/kprobes.h, so here is an additional fix patch. ------------------------------------------------------ From: Masami Hiramatsu Add dummy definitions of kprobe_opcode_t and arch_specific_insn when CONFIG_KPROBES=n. Signed-off-by: Masami Hiramatsu --- include/linux/kprobes.h | 4 ++++ 1 file changed, 4 insertions(+) Index: 2.6-mm/include/linux/kprobes.h =================================================================== --- 2.6-mm.orig/include/linux/kprobes.h +++ 2.6-mm/include/linux/kprobes.h @@ -50,6 +50,10 @@ /* Attach to insert probes on any functions which should be ignored*/ #define __kprobes __attribute__((__section__(".kprobes.text"))) notrace #else /* CONFIG_KPROBES */ +typedef int kprobe_opcode_t; +struct arch_specific_insn { + int dummy; +}; #define __kprobes notrace #endif /* CONFIG_KPROBES */ -- Masami Hiramatsu Software Engineer Hitachi Computer Products (America) Inc. Software Solutions Division e-mail: mhiramat@redhat.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/