[ltt-dev] Problem when compiling UST from git

christian.charreyre at free.fr christian.charreyre at free.fr
Mon Dec 7 13:40:46 EST 2009


----- "Mathieu Desnoyers" <compudj at krystal.dyndns.org> a écrit :

> * Pierre-Marc Fournier (pierre-marc.fournier at polymtl.ca) wrote:
> > 
> > 
> > christian.charreyre at free.fr wrote:
> > > Hello all,
> > > 
> > > I'm trying to use LTTng for kernelspace and userspace tracing.
> > > 
> > > I've success compiled kernel 2.6.32-rc8 with LTTng patches,
> libkcompat, userspace-rcu, all from git
> (http://git.dorsal.polymtl.ca/).
> > > 
> > > I can't compile UST picked at
> http://git.dorsal.polymtl.ca/?p=ust.git.
> > > 
> > > Precisely, after bootstraping and configuring, I get an error in
> file marker.c in libust, and the error is :
> > > 
> > > marker.c:1462: error: impossible constraint in ‘asm’
> > > 
> > > 
> > > I'm working with gcc 4.4.1 from Ubuntu 9.10.
> > > It seems that the asm behing __trace_mark can't be successfully
> compiled on my distro (macro _DEFINE_MARKER).
> > > As I don't understand this asm directives, can anyone give me a
> hint so I can correct what is necessary to use UST.
> > 
> > Are you using a 32 bit arch? The git tree is currently broken for
> 32
> > bits precisely because of this asm stuff. It is very high in my
> > priorities to fix this.
> > 
> > You can temporarily fix this by simply removing the asm() and the
> > save_registers() in _DEFINE_MARKER(). You don't need it, as it is
> only
> > for gdb integration, which is not released yet. The asm is a trick
> to
> > save the current code address.
> 
> pmf, you could probably work-around this issue by using a #ifdef to
> define out this code for 32-bit x86 in the meantime so it works out
> of
> the box for users.
> 
> Thanks,
> 
> Mathieu
> 

If I comment the 2 lines of _DEFINE_MARKER() as suggested by Pierre-Marc, marker.c compiles well on x86 arch.

Nevertheless, there is 2 additional problems on such environment :

1/ in libust/buffers.c, there is a struct ltt_channel_buf_struct in save_last_tsc (line 253) and last_tsc_overflow (line 258) that generates an error because this type is not defined.

I've replaced them by struct ust_buffer as in the other case of the #if (BITS_PER_LONG == 32) test, and it seems to compile well. 

Is it ok ?


2/ at the final link of the library, there is an undefined reference :

libtool: link: gcc -shared  .libs/libust_la-marker.o .libs/libust_la-tracepoint.o .libs/libust_la-channels.o .libs/libust_la-marker-control.o .libs/libust_la-buffers.o .libs/libust_la-tracer.o .libs/libust_la-tracercore.o .libs/libust_la-serialize.o .libs/libust_la-tracectl.o .libs/libust_la-ustcomm.o   -lpthread -lurcu-bp    -Wl,-soname -Wl,libust.so.0 -o .libs/libust.so.0.0.0
.libs/libust_la-marker.o: In function `init_markers':
/media/cio-linux/LTTng/ust/libust/marker.c:1548: undefined reference to `__start___marker_addr'
/usr/bin/ld: .libs/libust_la-marker.o: relocation R_386_GOTOFF against undefined hidden symbol `__start___marker_addr' can not be used when making a shared object
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make[2]: *** [libust.la] Erreur 1
make[2]: quittant le répertoire « /media/cio-linux/LTTng/ust/libust »
make[1]: *** [all-recursive] Erreur 1
make[1]: quittant le répertoire « /media/cio-linux/LTTng/ust »
make: *** [all] Erreur 2

I've tried to understand but didn't : __start___marker_addr is defined the same way than __start___markers in the following code :

extern struct marker __start___markers[] __attribute__((visibility("hidden")));
extern struct marker __stop___markers[] __attribute__((visibility("hidden")));
extern struct marker_addr __start___marker_addr[] __attribute__((visibility("hidden")));
extern struct marker_addr __stop___marker_addr[] __attribute__((visibility("hidden")));

but it seems that __start___markers doesn't cause problems as __start___marker_addr does.

Any hint on this last point ?


Thanks.

> > 
> > Thanks.
> > 
> > pmf
> > 
> > > 
> > > Thanks for answers.
> > > 
> > > _______________________________________________
> > > ltt-dev mailing list
> > > ltt-dev at lists.casi.polymtl.ca
> > > http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> > > 
> > 
> > 
> > _______________________________________________
> > ltt-dev mailing list
> > ltt-dev at lists.casi.polymtl.ca
> > http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> 
> -- 
> Mathieu Desnoyers
> OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE
> 9A68




More information about the lttng-dev mailing list