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: __kbrobes?


Masami Hiramatsu wrote:
> Hi Jun,
> 
> Jun Koi wrote:
>> Hi,
>>
>> I found some functions use __kprobes as directive (like text_poke()).
>> Closer look points out that it is used to collect them into a section
>> ".kprobes.text". What do we have to do with that? Is that because we
>> dont want to probe those areas?
> 
> The __kprobes means that those functions are invoked from kprobe itself.
> And kprobes doesn't accept to probe at the addresses in ".kprobes.text"
> sectoin for preventing recursive-call of kprobes.
> 
>> If so, why do we want to protect text_poke() against kprobes?
> 
> Indeed. text_poke() seems not to be invoked from kprobes probing
> functions. It is used only for disarming/arming breakpoints from
> registering/disabling kprobes.

Hmm, arch_disarm_kprobe() which invokes text_poke() is invoked in
a special case on x86_64. See reenter_kprobe@arch/x86/kernel/kprobes.c.
So, text_poke() should be marked as __kprobes.

Thank you,

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com


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