From: Nan Xiao <xiaonan830818@gmail.com>
To: David Smith <dsmith@redhat.com>
Cc: "Frank Ch. Eigler" <fche@redhat.com>, systemtap@sourceware.org
Subject: Re: How to track the functions in self-written module using SystemTap?
Date: Wed, 02 Dec 2015 02:22:00 -0000 [thread overview]
Message-ID: <CA+MhoaOc18xQ0aa4e7uiKwVy6oEwHs-1GuP3pPPLyNtXyQA2nQ@mail.gmail.com> (raw)
In-Reply-To: <565DCA83.6040102@redhat.com>
> 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
Still outputs nothing.
> 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.
The output likes this:
# make installcheck RUNTESTFLAGS="modules_out_of_tree.exp kmodule.exp"
Making a new site.exp file ...
rmmod uprobes 2>/dev/null
make: [installcheck] Error 1 (ignored)
make check-DEJAGNU RUNTESTFLAGS="modules_out_of_tree.exp kmodule.exp
--tool_opts \'install \'"
make[1]: Entering directory `/usr/share/systemtap/testsuite'
srcdir='.'; export srcdir; \
EXPECT=expect; export EXPECT; \
if /bin/sh -c "env XDG_DATA_DIRS= SYSTEMTAP_SYNC=1 LANG=C
SYSTEMTAP_TESTREMOTES= SYSTEMTAP_TESTAPPS=
SYSTEMTAP_RUNTIME=/usr/share/systemtap/runtime
SYSTEMTAP_TAPSET=/usr/share/systemtap/tapset
LD_LIBRARY_PATH=/usr/lib64/systemtap CRASH_LIBDIR=/usr/lib64/systemtap
PATH=/usr/bin:$PATH SYSTEMTAP_PATH=/usr/bin
SYSTEMTAP_INCLUDES=/usr/include PKGLIBDIR=/usr/libexec/systemtap
./execrc runtest --version" > /dev/null 2>&1; then \
exit_status=0; l='systemtap'; for tool in $l; do \
if env XDG_DATA_DIRS= SYSTEMTAP_SYNC=1 LANG=C
SYSTEMTAP_TESTREMOTES= SYSTEMTAP_TESTAPPS=
SYSTEMTAP_RUNTIME=/usr/share/systemtap/runtime
SYSTEMTAP_TAPSET=/usr/share/systemtap/tapset
LD_LIBRARY_PATH=/usr/lib64/systemtap CRASH_LIBDIR=/usr/lib64/systemtap
PATH=/usr/bin:$PATH SYSTEMTAP_PATH=/usr/bin
SYSTEMTAP_INCLUDES=/usr/include PKGLIBDIR=/usr/libexec/systemtap
./execrc runtest --tool $tool --tool_opts \'\' --srcdir $srcdir
modules_out_of_tree.exp kmodule.exp --tool_opts \'install \'; \
then :; else exit_status=1; fi; \
done; \
else echo "WARNING: could not find 'env XDG_DATA_DIRS=
SYSTEMTAP_SYNC=1 LANG=C SYSTEMTAP_TESTREMOTES= SYSTEMTAP_TESTAPPS=
SYSTEMTAP_RUNTIME=/usr/share/systemtap/runtime
SYSTEMTAP_TAPSET=/usr/share/systemtap/tapset
LD_LIBRARY_PATH=/usr/lib64/systemtap CRASH_LIBDIR=/usr/lib64/systemtap
PATH=/usr/bin:$PATH SYSTEMTAP_PATH=/usr/bin
SYSTEMTAP_INCLUDES=/usr/include PKGLIBDIR=/usr/libexec/systemtap
./execrc runtest'" 1>&2; :;\
fi; \
exit $exit_status
WARNING: Couldn't find the global config file.
kernel location: /usr/lib/debug/lib/modules/3.10.0-123.el7.x86_64.debug/vmlinux
kernel version: 3.10.0-123.el7.x86_64.debug
systemtap location: /usr/bin/stap
systemtap version: version 2.4/0.158, rpm 2.4-14.el7
gcc location: /usr/bin/gcc
gcc version: gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-16)
spawn -ignore SIGHUP gcc hello.c -g -m64 -lm -o hello-m64
spawn -ignore SIGHUP gcc hello.c -g -m32 -lm -o hello-m32
/usr/bin/ld: skipping incompatible
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/libgcc_s.so when searching for
-lgcc_s
/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status
**** failed gcc m32 smoke test:
/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status
Please install libgcc and glibc development packages for m32
**** aborting testing.
make[1]: Leaving directory `/usr/share/systemtap/testsuite'
if test -n ""; then mail < systemtap.sum; fi
Thanks!
Best Regards
Nan Xiao
On Wed, Dec 2, 2015 at 12:27 AM, David Smith <dsmith@redhat.com> wrote:
> 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)
next prev parent reply other threads:[~2015-12-02 2:22 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-17 7:14 Nan Xiao
2015-11-17 16:48 ` David Smith
2015-11-18 3:39 ` Nan Xiao
2015-11-18 19:38 ` David Smith
2015-11-19 0:49 ` Nan Xiao
2015-11-19 8:33 ` Nan Xiao
2015-11-19 14:58 ` David Smith
2015-11-26 6:10 ` Nan Xiao
2015-11-30 21:52 ` David Smith
2015-11-30 23:45 ` Nan Xiao
2015-12-01 2:18 ` Frank Ch. Eigler
2015-12-01 2:57 ` Nan Xiao
2015-12-01 16:27 ` David Smith
2015-12-02 2:22 ` Nan Xiao [this message]
2015-12-02 21:42 ` David Smith
2015-12-03 1:13 ` Nan Xiao
2015-12-03 17:04 ` David Smith
2015-12-04 9:56 ` Nan Xiao
2015-12-04 12:15 ` David Smith
2015-12-06 8:53 ` Nan Xiao
2015-12-07 19:53 ` David Smith
2015-12-08 1:05 ` Nan Xiao
2015-12-08 19:41 ` Frank Ch. Eigler
2016-10-06 22:05 ` Martin Cermak
2016-10-07 17:59 ` David Smith
2016-10-12 17:02 ` Martin Cermak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA+MhoaOc18xQ0aa4e7uiKwVy6oEwHs-1GuP3pPPLyNtXyQA2nQ@mail.gmail.com \
--to=xiaonan830818@gmail.com \
--cc=dsmith@redhat.com \
--cc=fche@redhat.com \
--cc=systemtap@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).