This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: How to track the functions in self-written module using SystemTap?
- From: Nan Xiao <xiaonan830818 at gmail dot com>
- To: David Smith <dsmith at redhat dot com>
- Cc: systemtap at sourceware dot org
- Date: Thu, 19 Nov 2015 16:33:21 +0800
- Subject: Re: How to track the functions in self-written module using SystemTap?
- Authentication-results: sourceware.org; auth=none
- References: <CA+MhoaPMSTgpHCDjNhwcDkMaLryLy+F6tH6HNcrvDDF9bEbBbg at mail dot gmail dot com> <564B5A4C dot 1080302 at redhat dot com> <CA+MhoaNG0hENo=cnOrxogX2qofdQodh-sY7mbKoZabn+L5GgFg at mail dot gmail dot com> <564CD3C1 dot 2090900 at redhat dot com> <CA+MhoaPxCC1_CH86A7SuXaoNEJyzaRvv2wpha8shF4V8T9WeOQ at mail dot gmail dot com>
Hi David,
Another interesting thing: if there is a "-" in path, the SystemTap
also fail to parse:
# stap -v -l 'module("/root/Downloads/kernel-master/105.ops/kex.ko").function("*")'
Pass 1: parsed user script and 102 library script(s) using
78528virt/28740res/2700shr/26724data kb, in 170usr/20sys/183real ms.
Pass 2: analyzed script: 0 probe(s), 0 function(s), 0 embed(s), 0
global(s) using 79536virt/30480res/3164shr/27732data kb, in
0usr/50sys/53real ms.
Change kernel-master to kernel:
# stap -v -l 'module("/root/Downloads/kernel/105.ops/kex.ko").function("*")'
Pass 1: parsed user script and 102 library script(s) using
78528virt/28732res/2700shr/26724data kb, in 180usr/10sys/189real ms.
module("/root/Downloads/kernel/105.ops/kex.ko").function("_open@/root/Downloads/kernel-master/105.ops/kex.c:21")
module("/root/Downloads/kernel/105.ops/kex.ko").function("_read@/root/Downloads/kernel-master/105.ops/kex.c:45")
module("/root/Downloads/kernel/105.ops/kex.ko").function("_release@/root/Downloads/kernel-master/105.ops/kex.c:33")
module("/root/Downloads/kernel/105.ops/kex.ko").function("copy_to_user@/usr/src/linux-3.12.49-6/arch/x86/include/asm/uaccess_64.h:72")
module("/root/Downloads/kernel/105.ops/kex.ko").function("kex_cleanup@/root/Downloads/kernel-master/105.ops/kex.c:90")
module("/root/Downloads/kernel/105.ops/kex.ko").function("kex_init@/root/Downloads/kernel-master/105.ops/kex.c:61")
Pass 2: analyzed script: 6 probe(s), 0 function(s), 0 embed(s), 0
global(s) using 79548virt/30624res/3304shr/27744data kb, in
20usr/30sys/56real ms.
Thanks!
Best Regards
Nan Xiao
On Thu, Nov 19, 2015 at 8:49 AM, Nan Xiao <xiaonan830818@gmail.com> wrote:
> Hi David,
>
> Got it, thanks very much for your time and help!
> Best Regards
> Nan Xiao
>
>
> On Thu, Nov 19, 2015 at 3:38 AM, David Smith <dsmith@redhat.com> wrote:
>> On 11/17/2015 09:38 PM, Nan Xiao wrote:
>>> Hi David,
>>>
>>> Yes, the "FULL_PATH_TO_KEX" works:
>>>
>>> ~/Downloads/kernel/105.ops # stap -l
>>> 'module("/root/Downloads/kernel/105.ops/kex.ko").function("*")'
>>> module("/root/Downloads/kernel/105.ops/kex.ko").function("_open@/root/Downloads/kernel/105.ops/kex.c:21")
>>> module("/root/Downloads/kernel/105.ops/kex.ko").function("_read@/root/Downloads/kernel/105.ops/kex.c:45")
>>> module("/root/Downloads/kernel/105.ops/kex.ko").function("_release@/root/Downloads/kernel/105.ops/kex.c:33")
>>> module("/root/Downloads/kernel/105.ops/kex.ko").function("copy_to_user@/usr/src/linux-3.12.49-3/arch/x86/include/asm/uaccess_64.h:72")
>>> module("/root/Downloads/kernel/105.ops/kex.ko").function("kex_cleanup@/root/Downloads/kernel/105.ops/kex.c:90")
>>> module("/root/Downloads/kernel/105.ops/kex.ko").function("kex_init@/root/Downloads/kernel/105.ops/kex.c:61")
>>>
>>> But the "RELATIVE_PATH_TO_KEX" doesn't work:
>>> ~/Downloads/kernel/105.ops # stap -l 'module("./kex.ko").function("*")'
>>> ~/Downloads/kernel/105.ops #
>>>
>>> Is it the expected behavior of SystemTap? Thanks!
>>
>> Good question. You are correct, using relative paths doesn't seem to
>> work. I've filed PR19265 on this issue.
>>
>> <https://sourceware.org/bugzilla/show_bug.cgi?id=19265>
>>
>> Feel free to add yourself to the CC list on that bug. If you have the
>> time, also feel free to look into this more.
>>
>> --
>> David Smith
>> dsmith@redhat.com
>> Red Hat
>> http://www.redhat.com
>> 256.217.0141 (direct)
>> 256.837.0057 (fax)