This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Trouble compiling with embedded C


Thank you for the answers to previous questions.  I have been able to set up some basic probes to explore SystemTap functionality.

I am starting to toy with the option of using embedded C.  I tried compiling one of the provided examples and got the output below.  I got the same errors when trying to do my own script.  The example script I tried is the one provided at: http://sourceware.org/systemtap/tutorial/node18.html.  My tapsets are installed under the default /usr/share/systemtap/tapset and I have been able to use one of the /*pure*/ C functions from the vfs.stp without problems.  Am I missing an environment or config setting to tell stap where to get the function definition of kread from?  I have tried this on RHEL4 (2.6.9) and RHEL5 (2.6.18) with the same results.


 $ stap -vv -g files_open_by_pid.stp 
SystemTap translator/driver (version 0.5.12 built 2007-01-01)
(Using Red Hat elfutils 0.125 libraries.)
Copyright (C) 2005-2006 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
Created temporary directory "/tmp/stapV1hPi5"
Searched '/usr/share/systemtap/tapset/2.6.18-8.el5/i686/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/2.6.18-8.el5/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/2.6.18/i686/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/2.6.18/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/2.6/i686/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/2.6/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/i686/*.stp', match count 1
Searched '/usr/share/systemtap/tapset/*.stp', match count 33
Searched '/usr/share/systemtap/tapset/LKET/2.6.18-8.el5/i686/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/LKET/2..6.18-8.el5/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/LKET/2.6.18/i686/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/LKET/2.6.18/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/LKET/2.6/i686/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/LKET/2.6/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/LKET/i686/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/LKET/*.stp', match count 19
Pass 1: parsed user script and 53 library script(s) in 220usr/0sys/512real ms.
Pass 2: analyzed script: 3 probe(s), 5 function(s), 2 embed(s), 2 global(s) in 0usr/0sys/5real ms.
probe_1509 locks task_name[r] traced_pid[r] 
probe_1510 locks task_name[rw] traced_pid[rw] 
probe_1511 locks task_name[rw] traced_pid[rw] 
Pass 3: translated to C into "/tmp/stapV1hPi5/stap_e64e09f00709e61f00e5224726ac05d4_2192.c" in 0usr/0sys/1real ms.
Running make -C "/lib/modules/2.6.18-8.el5/build" M="/tmp/stapV1hPi5" modules V=1
make: Entering directory `/usr/src/kernels/2.6.18-8.el5-i686'
test -e include/linux/autoconf.h -a -e include/config/auto.conf || (            \
        echo;                                                           \
        echo "  ERROR: Kernel configuration is invalid.";               \
        echo "         include/linux/autoconf.h or include/config/auto.conf are missing.";      \
        echo "         Run 'make oldconfig && make prepare' on kernel src to fix it.";  \
        echo;                                                           \
        /bin/false)
mkdir -p /tmp/stapV1hPi5/.tmp_versions
rm -f /tmp/stapV1hPi5/.tmp_versions/*
make -f scripts/Makefile.build obj=/tmp/stapV1hPi5
  gcc -m32 -Wp,-MD,/tmp/stapV1hPi5/.stap_e64e09f00709e61f00e5224726ac05d4_2192.o.d  -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.1/include -D__KERNEL__ -Iinclude  -include include/linux/autoconf.h  -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Wstrict-prototypes -Wundef -Werror-implicit-function-declaration -Os -pipe -msoft-float -fno-builtin-sprintf -fno-builtin-log2 -fno-builtin-puts  -mpreferred-stack-boundary=2  -march=i686 -mtune=generic -mtune=generic -mregparm=3 -ffreestanding -Iinclude/asm-i386/mach-generic -Iinclude/asm-i386/mach-default -fomit-frame-pointer -g  -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -freorder-blocks -Wno-unused -Werror -I"/usr/share/systemtap/runtime"   -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(stap_e64e09f00709e61f00e5224726ac05d4_2192)"  -D"KBUILD_MODNAME=KBUILD_STR(stap_e64e09f00709e61f00e5224726ac05d4_2192)" -c -o
 /tmp/stapV1hPi5/.tmp_stap_e64e09f00709e61f00e5224726ac05d4_2192.o /tmp/stapV1hPi5/stap_e64e09f00709e61f00e5224726ac05d4_2192.c
/tmp/stapV1hPi5/stap_e64e09f00709e61f00e5224726ac05d4_2192.c: In function 'function___get_task_name':
/tmp/stapV1hPi5/stap_e64e09f00709e61f00e5224726ac05d4_2192.c:213: error: implicit declaration of function 'CATCH_DEREF_FAULT'
/tmp/stapV1hPi5/stap_e64e09f00709e61f00e5224726ac05d4_2192.c: In function 'function___get_open_file':
/tmp/stapV1hPi5/stap_e64e09f00709e61f00e5224726ac05d4_2192.c:250: error: implicit declaration of function 'kread'
cc1: warnings being treated as errors
/tmp/stapV1hPi5/stap_e64e09f00709e61f00e5224726ac05d4_2192.c:250: warning: pointer/integer type mismatch in conditional expression
make[1]: *** [/tmp/stapV1hPi5/stap_e64e09f00709e61f00e5224726ac05d4_2192.o] Error 1
make: *** [_module_/tmp/stapV1hPi5] Error 2
make: Leaving directory `/usr/src/kernels/2.6.18-8.el5-i686'
Pass 4: compiled C into "stap_e64e09f00709e61f00e5224726ac05d4_2192.ko" in 240usr/60sys/335real ms.
Pass 4: compilation failed.  Try again with more '-v' (verbose) options.
Running rm -rf /tmp/stapV1hPi5




Haley Thrapp



      ____________________________________________________________________________________
Shape Yahoo! in your own image.  Join our Network Research Panel today!   http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]