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: Tue, 1 Dec 2015 07:45:13 +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> <CA+MhoaPGgWuVCEnW8p6cvbN_6qFE1jeDjz+pYtDuCbL00b5Ong at mail dot gmail dot com> <564DE376 dot 3020104 at redhat dot com> <CA+MhoaPCnkDp=A8KD19g1J+Gu91Z=+re09i8xgbg8=DW++uegQ at mail dot gmail dot com> <565CC50B dot 90104 at redhat dot com>
Hi David,
My OS is RHEL 7.0, but run on VirtualBox:
# stap -V
Systemtap translator/driver (version 2.4/0.158, rpm 2.4-14.el7)
Copyright (C) 2005-2013 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
enabled features: AVAHI LIBRPM LIBSQLITE3 NSS BOOST_SHARED_PTR
TR1_UNORDERED_MAP NLS DYNINST JAVA LIBVIRT LIBXML2
run "# stap -e 'probe
module("/root/kernel/105.ops/kex.ko").function("*") { printf("%s\n",
ppfunc()) }'", but
run "insmod kex.ko" & "rmmod kex" still outputs nothing.
Best Regards
Nan Xiao
On Tue, Dec 1, 2015 at 5:52 AM, David Smith <dsmith@redhat.com> wrote:
> On 11/26/2015 12:10 AM, Nan Xiao wrote:
>> Hi David,
>>
>> I do "insmod kex.ko" and "rmmod kex" repeatedly, but It seems the
>> related probes can't be triggered:
>>
>> # stap -l 'module("/root/kernel/105.ops/kex.ko").function("*")'
>> module("/root/kernel/105.ops/kex.ko").function("_open@/root/kernel/105.ops/kex.c:21")
>> module("/root/kernel/105.ops/kex.ko").function("_read@/root/kernel/105.ops/kex.c:45")
>> module("/root/kernel/105.ops/kex.ko").function("_release@/root/kernel/105.ops/kex.c:33")
>> module("/root/kernel/105.ops/kex.ko").function("copy_to_user@/usr/src/kernels/3.10.0-123.el7.x86_64.debug/arch/x86/include/asm/uaccess_64.h:72")
>> module("/root/kernel/105.ops/kex.ko").function("kex_cleanup@/root/kernel/105.ops/kex.c:90")
>> module("/root/kernel/105.ops/kex.ko").function("kex_init@/root/kernel/105.ops/kex.c:61")
>> # stap -e 'probe
>> module("/root/kernel/105.ops/kex.ko").function("kex_init"),
>> module("/root/kernel/105.ops/kex.ko").function("kex_cleanup")
>> {print_backtrace()}'
>
> Hmm. Note that I've done a good bit of work in the area of catching
> module init functions recently. What version of systemtap are you
> working with?
>
> Let's see if systemtap can catch anything in your module. Try something
> like:
>
> # stap -e 'probe module("/root/kernel/105.ops/kex.ko").function("*") {
> printf("%s\n", ppfunc()) }'
>
> --
> David Smith
> dsmith@redhat.com
> Red Hat
> http://www.redhat.com
> 256.217.0141 (direct)
> 256.837.0057 (fax)