From: Masami Hiramatsu <mhiramat@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
Jim Keniston <jkenisto@us.ibm.com>,
David Miller <davem@davemloft.net>,
LKML <linux-kernel@vger.kernel.org>,
systemtap-ml <systemtap@sources.redhat.com>
Subject: Re: [PATCH][bugfix] kprobes: fix module compilation error with CONFIG_KPROBES=n
Date: Wed, 14 Jan 2009 11:31:19 -0500 [thread overview]
Message-ID: <496E1357.8050507@redhat.com> (raw)
In-Reply-To: <20090114003234.3720e9a1.akpm@linux-foundation.org>
Andrew Morton wrote:
> On Mon, 05 Jan 2009 17:23:05 -0500 Masami Hiramatsu <mhiramat@redhat.com> 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 <ananth@in.ibm.com>
>> Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
>> ---
>> 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 <linux/spinlock.h>
>> #include <linux/rcupdate.h>
>> #include <linux/mutex.h>
>> +#include <asm/kprobes.h>
>>
>> #ifdef CONFIG_KPROBES
>> -#include <asm/kprobes.h>
>>
>
> 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 <mhiramat@redhat.com>
Add dummy definitions of kprobe_opcode_t and arch_specific_insn
when CONFIG_KPROBES=n.
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
---
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
prev parent reply other threads:[~2009-01-14 16:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-05 22:23 [PATCH][bugfix] kprobes: fix module compilation error with CONFIG_KPROBES=n Masami Hiramatsu
2009-01-06 16:39 ` Masami Hiramatsu
2009-01-12 22:51 ` Andrew Morton
2009-01-13 1:34 ` Masami Hiramatsu
2009-01-14 8:32 ` Andrew Morton
2009-01-14 16:31 ` Masami Hiramatsu [this message]
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=496E1357.8050507@redhat.com \
--to=mhiramat@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=ananth@in.ibm.com \
--cc=davem@davemloft.net \
--cc=jkenisto@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=systemtap@sources.redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox