[lttng-dev] Making 32-bit user-space events on a 64-bit Linux system

Woegerer, Paul Paul_Woegerer at mentor.com
Wed Oct 2 11:46:13 EDT 2013


ling On 10/02/2013 04:35 PM, Thibault, Daniel wrote:
> -----Message d'origine-----
> De : Woegerer, Paul [mailto:Paul_Woegerer at mentor.com] 
> Envoyé : 2 octobre 2013 03:38
>
>> The 64-bit version of lttng-tools works just fine with both, 32-bit and 64-bit userspace applications. No need to compile it as 32-bit variant.
>> Instrumented 32-bit applications automatically use the 32-bit lttng-consumerd (from the lttng-ust 32-bit build), instrumented 64-bit 
>> applications automatically use the 64-bit lttng-consumerd (from the lttng-ust 64-bit build).
>    But lttng-consumerd is in the lttng-tools package, not lttng-ust ?!  This prevents my lttng-sessiond from using a 32-bit lttng-consumerd, as you'll see below.

Right. Now that you say it, I DO remember compiling lttng-tools twice. I
took only the lttng-consumerd from the 32-bit variant and copied it over
into the 64-bit install tree and recompiled for 64-bit with
--with-consumerd32-bin=<lttng_install_root>/lib/lttng/libexec/lttng-consumerd
--with-consumerd64-bin=<lttng_install_root>/lib64/lttng/libexec/lttng-consumerd.
I think, this did the trick (if I remember correctly).

--
Paul

>
>> BTW, when you compile for the "-m32" multilib, it's better to use the following:
>> $ ./configure CC="gcc -m32"
>> This way also the linking steps (performed by libtool) of your build will know that you are building for m32 (on your x86_64 system) and you don't need e.g. "--libdir ....".
>    That's what I did, but I still felt I needed to specify libdir so the install did not overwrite the 64-bit libraries (liblttng-ctl.so, liblttng-ust.so, etc.).
>
>> For more information see:
>> http://doc.opensuse.org/documentation/html/openSUSE/opensuse-reference/cha.64bit.html#sec.64bit.biarch
>> or
>> https://developer.mozilla.org/en/docs/Compiling_32-bit_Firefox_on_a_Linux_64-bit_OS
>    I have seen the second one, which was moderately useul.  I'll look into the first one, thanks.
>
>>> More generally, how does one add tracepoints to a 32-bit application running on a 64-bit system?
>> You simply compile your instrumented application to 32-bit the same way you did it for the lttng-ust package (CC="gcc -m32").
>>
>> Paul Woegerer, SW Development Engineer
>    Indeed, once lttng-ust has been done in 32-bits, I can use the 'make static32' I quoted at the beginning of the thread like this:
>
> $ LDFLAGS=-L/usr/local/lib32 make static 32
>
>    And then run the sample app like this:
>
> $ LD_PRELOAD=/usr/local/lib32/liblttng-ust.so ./sample_static32
>
>    (I could dump the LD_PRELOAD by adding /usr/local/lib32 to my PATH)
>
>    But my running lttng-sessiond (enable-event -u -a) complains:
>
> Error: Consumer socket fd -1 not found in consumer obj 0x7ffd4000b650
>
>    My guess is I'll need to launch lttng-sessiond with the -u and -U options to point it to the 32-bit lttng-consumerd...Once I can get the 32-bit lttng-tools to compile and install it.
>
> Daniel U. Thibault
> Protection des systèmes et contremesures (PSC) | Systems Protection & Countermeasures (SPC)
> Cyber sécurité pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS)
> R & D pour la défense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier)
> 2459 route de la Bravoure
> Québec QC  G3J 1X5
> CANADA
> Vox : (418) 844-4000 x4245
> Fax : (418) 844-4538
> NAC : 918V QSDJ <http://www.travelgis.com/map.asp?addr=918V%20QSDJ>
> Gouvernement du Canada | Government of Canada
> <http://www.valcartier.drdc-rddc.gc.ca/>


-- 
Paul Woegerer, SW Development Engineer
Sourcery Analyzer <http://go.mentor.com/sourceryanalyzer>
Mentor Graphics, Embedded Software Division




More information about the lttng-dev mailing list