This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC -mm][PATCH ] Patch to avoid probing __init functions using kprobes


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]