[lttng-dev] (no subject)

Suchakrapani Datt Sharma suchakrapani.sharma at polymtl.ca
Tue Jan 21 21:30:01 EST 2014


Hi,

I did not try to look into httpd as you require but here are some pointers.

Quoting Mehran Khan <i at mehrankhan.com>:

---------------- SNIP ------------------
>
> 3. Then, I put the *smallestTracePoint.h* and *smallestTracePoint.c* in
> *httpd-2.4.7/server* directory,
> included  *smallestTracePoint.h *in the *main.c  *file and added trace
> points in the int *main(int argc, const char * const argv[])* and
> **init_process(int
> *argc, const char * const * *argv)* functions.

Did you do a #define TRACEPOINT_DEFINE in main.c and also include your
smallestTracePoint.h?

> 4. Then I added *-finstrument-functions* in the *configure* file (Line
> number 2830) in the extracted *httpd-2.4.7* directory, full line below
>   ac_compile='$CC -c $CFLAGS -finstrument-functions $CPPFLAGS
> conftest.$ac_ext >&5'

I do not know why -finstrument-functions is required here. Its independent of
lttng tracepoints afaik.

> 5. Then, from the /httpd-2.4.7 directory, I ran the following command to
> configure the installation, it completed without any error.
>     ./configure --libdir=/usr/lib/usr/lib/liblttng-ust.so
> --with-included-apr

Why not export LDFLAGS='-llttng-ust' before configure or maybe add it in the
Makefile/Makefile.in whatever httpd uses.

> 6. When I ran the command 'make', I get the following error after a while
> ...
> make[1]: Entering directory `/root/httpd-2.4.7'
> /root/httpd-2.4.7/srclib/apr/libtool --silent --mode=compile gcc

---------------- SNIP ------------------

> /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/libmain.la modules/core/libmod_so.la
> modules/http/libmod_http.laserver/mpm/event/
> libevent.la os/unix/libos.la -L/usr/lib/x86_64-linux-gnu -lpcre
>
/root/httpd-2.4.7/srclib/apr-util/libaprutil-1.la/root/httpd-2.4.7/srclib/apr-util/xml/expat/
> libexpat.la /root/httpd-2.4.7/srclib/apr/libapr-1.la -luuid -lrt -lcrypt
> -lpthread -ldl

I can't see -llttng-ust in the build command.

> I have tried including the *smallestTracePoint.c* file in the local
> makefile (*/root/httpd-2.4.7/MakeFile)*... didn't do me any good.
> Any idea what I am doing wrong ?

You definitely need to include this in the build but I don't think an auto
generated Makefile is a good place.

For your convenience, I instrumented thttpd here [1]. Its a tiny and fast web
server. There is 1 tracepoint in handle_newconnect() Have a look at
Makefile.in, thttpd_tp.c and thttpd_tp_provider.h

If you want generated traces, do let me know.

[1] http://suchakra.fedorapeople.org/lttng/thttpd-instrumented.tar.gz

--
Suchakra



More information about the lttng-dev mailing list