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: David Smith <dsmith at redhat dot com>
- To: Nan Xiao <xiaonan830818 at gmail dot com>, "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: systemtap at sourceware dot org
- Date: Tue, 1 Dec 2015 10:27:47 -0600
- 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> <CA+MhoaPHi6ORfgTtWu_Z09zLAcgaAEPO10vWFi1kNhvsS5V0Ow at mail dot gmail dot com> <y0mk2oync6p dot fsf at fche dot csb> <CA+MhoaO9kbLCWJ4S3jSGxW2gr=TW8fGhZ8znG5pX5dXzLLoh6Q at mail dot gmail dot com>
On 11/30/2015 08:57 PM, Nan Xiao wrote:
> Hi Frank,
>
> I have just tested it:
>
> # dd if=kex of=/dev/null bs=101 count=1
> 0+1 records in
> 0+1 records out
> 100 bytes (100 B) copied, 0.00278675 s, 35.9 kB/s
>
> But still nothing outputs:
> # stap -v -e 'probe
> module("/root/kernel/105.ops/kex.ko").function("*") { printf("%s\n",
> ppfunc()) }'
> Pass 1: parsed user script and 100 library script(s) using
> 210544virt/28008res/3036shr/25484data kb, in 110usr/50sys/162real ms.
> Pass 2: analyzed script: 6 probe(s), 1 function(s), 0 embed(s), 0
> global(s) using 370776virt/29748res/3596shr/26612data kb, in
> 30usr/760sys/802real ms.
> Pass 3: using cached
> /root/.systemtap/cache/5c/stap_5cfec0f637bce0fa61c51d4186192dd5_2853.c
> Pass 4: using cached
> /root/.systemtap/cache/5c/stap_5cfec0f637bce0fa61c51d4186192dd5_2853.ko
> Pass 5: starting run.
>
> Thanks!
> Best Regards
> Nan Xiao
>
>
> On Tue, Dec 1, 2015 at 10:18 AM, Frank Ch. Eigler <fche@redhat.com> wrote:
>> Nan Xiao <xiaonan830818@gmail.com> writes:
>>
>>> [...]
>>> 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.
>>
>> Xan you exercise kex.ko beyond just installing & removing it right
>> away, while the systemtap script is probing it?
>>
>> - FChE
Hmm. OK, let's try a couple more things:
1) It could be that systemtap is missing the module load somehow. So,
try this:
- load the module
- run stap
- exercise the module
- unload the module
- kill stap
2) It looks like you are running the rpm version. Can you install the
systemtap-testsuite rpm and try the following (as root):
# cd /usr/share/systemtap/testsuite
# make installcheck RUNTESTFLAGS="modules_out_of_tree.exp kmodule.exp"
That should run 2 testcases that test out-of-tree modules and in-tree
modules.
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)