From mboxrd@z Thu Jan 1 00:00:00 1970 From: douglas.santos@polymtl.ca (Douglas Santos) Date: Tue, 09 Feb 2010 16:25:51 -0500 Subject: [ltt-dev] UST - Problems in recording trace on a current process In-Reply-To: <19fa8ef31002091240s57b513e0v81f524795b0f77ac@mail.gmail.com> References: <19fa8ef31002081349v36a13174m1a031048048fd45c@mail.gmail.com> <201002091142.33606.pierre-marc.fournier@polymtl.ca> <19fa8ef31002090911x67b99823v54f0e423ff6ea121@mail.gmail.com> <201002091225.13893.pierre-marc.fournier@polymtl.ca> <19fa8ef31002091240s57b513e0v81f524795b0f77ac@mail.gmail.com> Message-ID: <1265750750.4b71d2df012a0@www.imp.polymtl.ca> Quoting Naren : > The program i want to trace is firefox with pid 1684. > > Here are the results of ldd'ing firefox > > *root at naren-laptop:/tmp# ldd /usr/lib/firefox-3.5.7/firefox-3.5* > * **linux-gate.so.1 => (0xb7f27000)* > * **libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7efc000)* > * **libasound.so.2 => /usr/lib/libasound.so.2 (0xb7e35000)* > * **libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7e30000)* > * **libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7d3e000)* > * **libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7d18000)* > * **libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7cfa000)* > * **libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7bb5000)* > * **/lib/ld-linux.so.2 (0xb7f28000)* > * **librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0xb7bab000)* You need to instrument the code and link it with libust. Which seems isn't the case here. http://lttng.org/files/ust/manual/ust.html#Instrumenting-an-application here's an ldd example of a instrumented and linked prog. $ ldd ../test/mk linux-vdso.so.1 => (0x00007fff919ff000) libust.so.0 => /usr/local/lib/libust.so.0 (0x00007fe81031d000) libc.so.6 => /lib/libc.so.6 (0x00007fe80ffae000) /lib64/ld-linux-x86-64.so.2 (0x00007fe810542000) liburcu-bp.so.0 => /usr/local/lib/liburcu-bp.so.0 (0x00007fe80fdab000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007fe80fb8f000) > In the manual http://lttng.org/files/ust/manual/ust.html, under section "5.2 > Setting up the recording manually", the command given to enable markers "$ > ustctl --enable-marker 1234 ust/mymark" . However, after some reverse > engineering, i found out that "parse_opts_long" function "ustctl.c" file > expects pid to be the last argument and it is giving > "*ustctl[1813/1813]: Error: The pid "ust/1" is invalid. (in > parse_opts_long() at ustctl.c:159)*" error. Hence it would be "$ ustctl > --enable-marker ust/mymark 1234". I am not sure of this though. Can you > clarify? The correct order is ustctl COMMAND PID