This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [RFC -mm][PATCH ] Patch to avoid probing __init functions using kprobes
- From: Masami Hiramatsu <mhiramat at redhat dot com>
- To: Srinivasa Ds <srinivasa at in dot ibm dot com>
- Cc: ananth at in dot ibm dot com, Jim Keniston <jkenisto at us dot ibm dot com>, Roland McGrath <roland at redhat dot com>, Arjan van de Ven <arjan at infradead dot org>, anil dot s dot keshavamurthy at intel dot com, davem at davemloft dot net, systemtap-ml <systemtap at sources dot redhat dot com>
- Date: Thu, 13 Dec 2007 13:50:35 -0500
- Subject: Re: [RFC -mm][PATCH ] Patch to avoid probing __init functions using kprobes
- References: <475DC362.9000707@redhat.com> <4760EAAE.7090303@in.ibm.com> <20071213082326.GA10642@in.ibm.com> <200712131651.18077.srinivasa@in.ibm.com>
Hi Srinivasa,
Srinivasa Ds wrote:
> On Thursday 13 Dec 2007 1:53:26 pm Ananth N Mavinakayanahalli wrote:
>> On Thu, Dec 13, 2007 at 01:47:50PM +0530, Srinivasa Ds wrote:
>>> Ananth N Mavinakayanahalli wrote:
>>>> On Wed, Dec 12, 2007 at 08:21:01PM -0500, Masami Hiramatsu wrote:
>>>>> Masami Hiramatsu wrote:
>>>>>> Finally, I reproduced it by executing a command below:
>>>>>> % stap -e 'probe kernel.function("migration_init"){}'
>>>> That does seem like the right thing to do. This also needs to live in
>>>> common code.
>>>>
>>>> Srini,
>>>> Want to take a stab at it?
>
> This patch taken against the 2.6.24-rc4-mm1 fixes the problem
> of probing __init functions.I have reused the code from extable.c
> and modified the kprobes.c accordingly.
Thanks, this patch worked fine for me.
---
$ stap -ve 'probe kernel.function("migration_init"){}'
Pass 1: parsed user script and 38 library script(s) in 210usr/10sys/227real ms.
Pass 2: analyzed script: 1 probe(s), 0 function(s), 0 embed(s), 0 global(s) in 230usr/100sys/324real ms.
Pass 3: translated to C into "/tmp/staphufPIP/stap_aefede84fedbb0c1a1c03305e269e9af_273.c" in 0usr/0sys/0real ms.
Pass 4: compiled C into "stap_aefede84fedbb0c1a1c03305e269e9af_273.ko" in 2390usr/390sys/2915real ms.
Pass 5: starting run.
ERROR: probe kernel.function("migration_init@/home/mhiramat/ksrc/2.6-mm/kernel/sched.c:5602") registration error (rc -22)
Pass 5: run completed in 20usr/90sys/112real ms.
---
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division
e-mail: mhiramat@redhat.com, masami.hiramatsu.pt@hitachi.com