From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56633 invoked by alias); 3 Dec 2015 01:13:44 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 56537 invoked by uid 89); 3 Dec 2015 01:13:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wm0-f51.google.com Received: from mail-wm0-f51.google.com (HELO mail-wm0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 03 Dec 2015 01:13:42 +0000 Received: by wmec201 with SMTP id c201so2053304wme.1 for ; Wed, 02 Dec 2015 17:13:39 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.28.51.83 with SMTP id z80mr9639375wmz.54.1449105219302; Wed, 02 Dec 2015 17:13:39 -0800 (PST) Received: by 10.194.109.6 with HTTP; Wed, 2 Dec 2015 17:13:39 -0800 (PST) In-Reply-To: <565F65D4.4050005@redhat.com> References: <564B5A4C.1080302@redhat.com> <564CD3C1.2090900@redhat.com> <564DE376.3020104@redhat.com> <565CC50B.90104@redhat.com> <565DCA83.6040102@redhat.com> <565F65D4.4050005@redhat.com> Date: Thu, 03 Dec 2015 01:13:00 -0000 Message-ID: Subject: Re: How to track the functions in self-written module using SystemTap? From: Nan Xiao To: David Smith Cc: "Frank Ch. Eigler" , systemtap@sourceware.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-q4/txt/msg00226.txt.bz2 Hi David, (1) >>> 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. > Can you do the same thing here and add '-DDEBUG_KPROBES' to the stap > command and show us the output? After adding '-DDEBUG_KPROBES', the stap command still outputs nothing. (2) The output of executing "# make installcheck RUNTESTFLAGS="modules_out_of_tree.exp kmodule.exp"": # make installcheck RUNTESTFLAGS="modules_out_of_tree.exp kmodule.exp" make: *** No rule to make target `installcheck'. Stop. [root@localhost yum.repos.d]# cd /usr/share/systemtap/testsuite [root@localhost testsuite]# make installcheck RUNTESTFLAGS="modules_out_of_tree.exp kmodule.exp" 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 spawn -ignore SIGHUP g++ hello.cxx -g -m64 -lm -o hello-m64 spawn -ignore SIGHUP g++ hello.cxx -g -m32 -lm -o hello-m32 Test Run By root on Wed Dec 2 20:08:12 2015 Native configuration is x86_64-unknown-linux-gnu === systemtap tests === Schedule of variations: unix Running target unix Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target. Using /usr/share/dejagnu/config/unix.exp as generic interface file for target. Using ./config/unix.exp as tool-and-target-specific interface file. Host: Linux localhost.localdomain 3.10.0-123.el7.x86_64.debug #1 SMP Mon May 5 11:24:18 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux Snapshot: version 2.4/0.158, rpm 2.4-14.el7 GCC: 4.8.2 [gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-16)] Distro: Red Hat Enterprise Linux Server release 7.0 (Maipo) SElinux: Enforcing Running ./systemtap.base/kmodule.exp ... === systemtap Summary === # of expected passes 7 make[1]: Leaving directory `/usr/share/systemtap/testsuite' if test -n ""; then mail < systemtap.sum; fi Thanks! Best Regards Nan Xiao On Thu, Dec 3, 2015 at 5:42 AM, David Smith wrote: > On 12/01/2015 08:22 PM, Nan Xiao wrote: >>> 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. > > Can you do the same thing here and add '-DDEBUG_KPROBES' to the stap > command and show us the output? > >>> 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" > > ... stuff deleted ... > >> 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 > > The testsuite checks a few things before starting, one of them being > that gcc can create 32-bit executables on an x86_64 system. If you want > to proceed further here, you'll have to do the following: > > # yum install glibc.i686 libgcc.i686 glibc-devel.i686 libstdc++-devel.i686 > > -- > David Smith > dsmith@redhat.com > Red Hat > http://www.redhat.com > 256.217.0141 (direct) > 256.837.0057 (fax)