<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;color:rgb(51,51,51)"><div class="gmail_quote"><div dir="ltr"><div style="font-family:tahoma,sans-serif;color:rgb(51,51,51)"><div style="font-family:tahoma,sans-serif;color:rgb(51,51,51)">
Hello everyone,<br>I have been trying to instrument the Apache web server, the latest version (2.4.7 from the URL <a href="http://httpd.apache.org/download.cgi#apache24" target="_blank">http://httpd.apache.org/download.cgi#apache24</a>) for LTTng UST tracing<br>
1. To start with the simplest case, I created a *.tp file named <i>smallestTracePoint.tp</i> with the content below<br> <span style="font-family:courier new,monospace">TRACEPOINT_EVENT(<br> mk,<div class="gmail_default" style="font-family:tahoma,sans-serif;color:rgb(51,51,51);display:inline">
</div><br> apache_process_entry,<br>
TP_ARGS(),<br> TP_FIELDS() <br> )</span><br></div><div style="font-family:tahoma,sans-serif;color:rgb(51,51,51)">2. Then I ran the following <br> <span style="font-family:courier new,monospace">lttng-gen-tp smallestTracePoint.tp -o smallestTracePoint.h -o smallestTracePoint.c<br>
</span></div><div style="font-family:tahoma,sans-serif;color:rgb(51,51,51)"><span style="font-family:courier new,monospace"> <font face="tahoma,sans-serif"><br>which generated the files </font></span><span style="font-family:courier new,monospace">smallestTracePoint.c <font face="tahoma,sans-serif">and </font></span><span style="font-family:courier new,monospace"><font face="tahoma,sans-serif"><span style="font-family:courier new,monospace">smallestTracePoint.h <br>
<br></span></font></span></div><div style="font-family:tahoma,sans-serif;color:rgb(51,51,51)"><span style="font-family:courier new,monospace"><font face="tahoma,sans-serif"><span style="font-family:courier new,monospace"><font face="tahoma,sans-serif">3. Then, I put the </font></span></font></span><span style="font-family:courier new,monospace"><font face="tahoma,sans-serif"><span style="font-family:courier new,monospace"><i>smallestTracePoint.h</i> <span style="font-family:tahoma,sans-serif">and</span> </span></font></span><span style="font-family:courier new,monospace"><i>smallestTracePoint.c</i> <font face="tahoma,sans-serif">in </font><i>httpd-2.4.7/server</i></span> directory,<br>
</div><div style="font-family:tahoma,sans-serif;color:rgb(51,51,51)">included <span style="font-family:courier new,monospace"><font face="tahoma,sans-serif"><span style="font-family:courier new,monospace"><i>smallestTracePoint.h </i><font face="tahoma,sans-serif">in the <i>main.c </i>file and added trace points in </font>the int <i>main(int argc, const char * const argv[])</i> and <i>*init_process(int *argc, const char * const * *argv)</i> <span style="font-family:tahoma,sans-serif">functions.</span> <br>
<br></span></font></span></div><div style="font-family:tahoma,sans-serif;color:rgb(51,51,51)"><span style="font-family:courier new,monospace"><font face="tahoma,sans-serif"><span style="font-family:courier new,monospace"><font face="tahoma,sans-serif">4. Then I added <font face="courier new,monospace"><i>-finstrument-functions</i><font face="tahoma,sans-serif"> </font></font>in the <i>configure</i> file (Line number 2830) in the extracted <i>httpd-2.4.7</i> directory, full line below</font><br>
ac_compile='$CC -c $CFLAGS -finstrument-functions $CPPFLAGS conftest.$ac_ext >&5'<br></span></font></span></div><div style="font-family:tahoma,sans-serif;color:rgb(51,51,51)"> <br>
</div><div style="font-family:tahoma,sans-serif;color:rgb(51,51,51)">5.
Then, from the /httpd-2.4.7 directory, I ran the following command to
configure the installation, it completed without any error. <br>
<span style="font-family:courier new,monospace"> ./configure --libdir=/usr/lib/usr/lib/liblttng-ust.so --with-included-apr</span><br><br></div><div style="font-family:tahoma,sans-serif;color:rgb(51,51,51)">
6. When I ran the command 'make', I get the following error after a while<br>...<br><span style="font-family:courier new,monospace">make[1]: Entering directory `/root/httpd-2.4.7'<br>/root/httpd-2.4.7/srclib/apr/libtool
--silent --mode=compile gcc -std=gnu99 -g -O2 -pthread -DLINUX
-D_REENTRANT -D_GNU_SOURCE -I. -I/root/httpd-2.4.7/os/unix
-I/root/httpd-2.4.7/include -I/root/httpd-2.4.7/srclib/apr/include -I/root/httpd-2.4.7/srclib/apr-util/include -I/root/httpd-2.4.7/srclib/apr-util/xml/expat/lib -I/root/httpd-2.4.7/modules/aaa -I/root/httpd-2.4.7/modules/cache -I/root/httpd-2.4.7/modules/core -I/root/httpd-2.4.7/modules/database -I/root/httpd-2.4.7/modules/filters -I/root/httpd-2.4.7/modules/ldap -I/root/httpd-2.4.7/modules/loggers -I/root/httpd-2.4.7/modules/lua -I/root/httpd-2.4.7/modules/proxy -I/root/httpd-2.4.7/modules/session -I/root/httpd-2.4.7/modules/ssl -I/root/httpd-2.4.7/modules/test -I/root/httpd-2.4.7/server -I/root/httpd-2.4.7/modules/arch/unix -I/root/httpd-2.4.7/modules/dav/main -I/root/httpd-2.4.7/modules/generators -I/root/httpd-2.4.7/modules/mappers -prefer-non-pic -static -c modules.c && touch modules.lo<br>
gcc -std=gnu99 -g -O2 -pthread -DLINUX -D_REENTRANT
-D_GNU_SOURCE -I. -I/root/httpd-2.4.7/os/unix
-I/root/httpd-2.4.7/include -I/root/httpd-2.4.7/srclib/apr/include -I/root/httpd-2.4.7/srclib/apr-util/include -I/root/httpd-2.4.7/srclib/apr-util/xml/expat/lib -I/root/httpd-2.4.7/modules/aaa -I/root/httpd-2.4.7/modules/cache -I/root/httpd-2.4.7/modules/core -I/root/httpd-2.4.7/modules/database -I/root/httpd-2.4.7/modules/filters -I/root/httpd-2.4.7/modules/ldap -I/root/httpd-2.4.7/modules/loggers -I/root/httpd-2.4.7/modules/lua -I/root/httpd-2.4.7/modules/proxy -I/root/httpd-2.4.7/modules/session -I/root/httpd-2.4.7/modules/ssl -I/root/httpd-2.4.7/modules/test -I/root/httpd-2.4.7/server -I/root/httpd-2.4.7/modules/arch/unix -I/root/httpd-2.4.7/modules/dav/main -I/root/httpd-2.4.7/modules/generators -I/root/httpd-2.4.7/modules/mappers -c /root/httpd-2.4.7/server/buildmark.c<br>
/root/httpd-2.4.7/srclib/apr/libtool --silent --mode=link gcc -std=gnu99 -g -O2 -pthread -o httpd modules.lo buildmark.o -export-dynamic server/<a href="http://libmain.la" target="_blank">libmain.la</a> modules/core/<a href="http://libmod_so.la" target="_blank">libmod_so.la</a> modules/http/<a href="http://libmod_http.la" target="_blank">libmod_http.la</a> server/mpm/event/<a href="http://libevent.la" target="_blank">libevent.la</a> os/unix/<a href="http://libos.la" target="_blank">libos.la</a> -L/usr/lib/x86_64-linux-gnu -lpcre /root/httpd-2.4.7/srclib/apr-util/<a href="http://libaprutil-1.la" target="_blank">libaprutil-1.la</a> /root/httpd-2.4.7/srclib/apr-util/xml/expat/<a href="http://libexpat.la" target="_blank">libexpat.la</a> /root/httpd-2.4.7/srclib/apr/<a href="http://libapr-1.la" target="_blank">libapr-1.la</a> -luuid -lrt -lcrypt -lpthread -ldl <br>
server/.libs/libmain.a(main.o): In function `main':<br>/root/httpd-2.4.7/server/main.c:443: undefined reference to `__tracepoint_mk___apache_process_entry'<br>server/.libs/libmain.a(main.o): In function `init_process':<br>
/root/httpd-2.4.7/server/main.c:284: undefined reference to `__tracepoint_mk___apache_process_entry'<br>server/.libs/libmain.a(main.o): In function `__tracepoint_cb_mk___apache_process_entry':<br>/root/httpd-2.4.7/server/smallestTracePoint.h:13: undefined reference to `tracepoint_dlopen'<br>
/root/httpd-2.4.7/server/smallestTracePoint.h:13: undefined reference to `__tracepoint_mk___apache_process_entry'<br>/root/httpd-2.4.7/server/smallestTracePoint.h:13: undefined reference to `tracepoint_dlopen'<br>
/root/httpd-2.4.7/server/smallestTracePoint.h:13: undefined reference to `tracepoint_dlopen'<br>/root/httpd-2.4.7/server/smallestTracePoint.h:13: undefined reference to `tracepoint_dlopen'<br>/root/httpd-2.4.7/server/smallestTracePoint.h:13: undefined reference to `__tracepoint_mk___apache_process_entry'<br>
/root/httpd-2.4.7/server/smallestTracePoint.h:13: undefined reference to `tracepoint_dlopen'<br>/root/httpd-2.4.7/server/smallestTracePoint.h:13: undefined reference to `tracepoint_dlopen'<br>collect2: ld returned 1 exit status<br>
make[1]: *** [httpd] Error 1<br>make[1]: Leaving directory `/root/httpd-2.4.7'<br>make: *** [all-recursive] Error 1</span><br><br>I have tried including the <i>smallestTracePoint.c</i> file in the local makefile (<i>/root/httpd-2.4.7/MakeFile)</i>... didn't do me any good.<br>
</div>Any idea what I am doing wrong ?</div><br><br><div style="font-family:tahoma,sans-serif;color:rgb(51,51,51);display:inline">LTTng version on the instance: 2.4.0-rc2 - Époque Opaque</div><br>
<div style="font-family:tahoma,sans-serif;color:rgb(51,51,51);display:inline">Linux Distribution: Ubuntu 12.04.3 LTS</div><br><br><div style="font-family:tahoma,sans-serif;color:rgb(51,51,51);display:inline">
Thanks,</div><span><font color="#888888"><br><br>-- <br><div dir="ltr"><div style="font-family:tahoma,sans-serif;color:rgb(51,51,51)">Mehran</div><br></div></font></span></div></div></div>
</div>