Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [lttng-dev] -warn-common with lttng-ust 2.0.2
@ 2012-06-07 21:26 Hollis Blanchard
  2012-06-08 17:17 ` Mathieu Desnoyers
  0 siblings, 1 reply; 2+ messages in thread
From: Hollis Blanchard @ 2012-06-07 21:26 UTC (permalink / raw)


Hi, I was adding an LTTng UST 2.0 tracepoint to an application that uses 
-warn-common (see http://www.math.utah.edu/docs/info/ld_2.html). I 
created a simple tracepoint, had lttng-gen-tp produce tracepoints.o, 
then linked that to the application, along with -llttng-ust. This 
results in some warnings:

tracepoints.o: warning: common of `handle' overridden by definition
/usr/local/lib/liblttng-ust.so: warning: defined here
tracepoints.o: warning: common of `lttng_client_callbacks_overwrite' overridden by definition
/usr/local/lib/liblttng-ust.so: warning: defined here
tracepoints.o: warning: common of `lttng_client_callbacks_discard' overridden by definition
/usr/local/lib/liblttng-ust.so: warning: defined here
tracepoints.o: warning: common of `lttng_client_callbacks_metadata' overridden by definition
/usr/local/lib/liblttng-ust.so: warning: defined here
/usr/local/lib/liblttng-ust-tracepoint.so.0: warning: multiple common of `handle'
tracepoints.o: warning: previous common is here

This seems to be a valid warning. The LTTng UST headers contain 
definitions like this in include/lttng/ringbuffer-config.h:
struct lttng_ust_shm_handle *handle;

If two objects use that header, each will get a copy of "handle", right?

-- 
Hollis Blanchard
Mentor Graphics, Embedded Systems Division




^ permalink raw reply	[flat|nested] 2+ messages in thread

* [lttng-dev] -warn-common with lttng-ust 2.0.2
  2012-06-07 21:26 [lttng-dev] -warn-common with lttng-ust 2.0.2 Hollis Blanchard
@ 2012-06-08 17:17 ` Mathieu Desnoyers
  0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Desnoyers @ 2012-06-08 17:17 UTC (permalink / raw)


* Hollis Blanchard (hollis_blanchard at mentor.com) wrote:
> Hi, I was adding an LTTng UST 2.0 tracepoint to an application that uses  
> -warn-common (see http://www.math.utah.edu/docs/info/ld_2.html). I  
> created a simple tracepoint, had lttng-gen-tp produce tracepoints.o,  
> then linked that to the application, along with -llttng-ust. This  
> results in some warnings:
>
> tracepoints.o: warning: common of `handle' overridden by definition
> /usr/local/lib/liblttng-ust.so: warning: defined here
> tracepoints.o: warning: common of `lttng_client_callbacks_overwrite' overridden by definition
> /usr/local/lib/liblttng-ust.so: warning: defined here
> tracepoints.o: warning: common of `lttng_client_callbacks_discard' overridden by definition
> /usr/local/lib/liblttng-ust.so: warning: defined here
> tracepoints.o: warning: common of `lttng_client_callbacks_metadata' overridden by definition
> /usr/local/lib/liblttng-ust.so: warning: defined here
> /usr/local/lib/liblttng-ust-tracepoint.so.0: warning: multiple common of `handle'
> tracepoints.o: warning: previous common is here
>
> This seems to be a valid warning. The LTTng UST headers contain  
> definitions like this in include/lttng/ringbuffer-config.h:
> struct lttng_ust_shm_handle *handle;
>
> If two objects use that header, each will get a copy of "handle", right?

Thanks for reporting, fixed by master commit:


commit 5a821cd6258af4b44aac352bd89b715377cee7d2
Author: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
Date:   Fri Jun 8 13:17:05 2012 -0400

    Fix: don't define variables in headers
    
    From Hollis Blanchard <hollis_blanchard at mentor.com>:
    > Hi, I was adding an LTTng UST 2.0 tracepoint to an application that uses
    > -warn-common (see http://www.math.utah.edu/docs/info/ld_2.html). I created
    > a simple tracepoint, had lttng-gen-tp produce tracepoints.o, then linked
    > that to the application, along with -llttng-ust. This results in some
    > warnings:
    >
    > tracepoints.o: warning: common of `handle' overridden by definition
    > /usr/local/lib/liblttng-ust.so: warning: defined here
    > tracepoints.o: warning: common of `lttng_client_callbacks_overwrite' overridden
    > +by definition
    > /usr/local/lib/liblttng-ust.so: warning: defined here
    > tracepoints.o: warning: common of `lttng_client_callbacks_discard' overridden by
    > +definition
    > /usr/local/lib/liblttng-ust.so: warning: defined here
    > tracepoints.o: warning: common of `lttng_client_callbacks_metadata' overridden
    > +by definition
    > /usr/local/lib/liblttng-ust.so: warning: defined here
    > /usr/local/lib/liblttng-ust-tracepoint.so.0: warning: multiple common of
    > +`handle'
    > tracepoints.o: warning: previous common is here
    >
    > This seems to be a valid warning. The LTTng UST headers contain
    > definitions like this in include/lttng/ringbuffer-config.h:
    > struct lttng_ust_shm_handle *handle;
    >
    > If two objects use that header, each will get a copy of "handle", right?
    
    handle: This was meant to be a forward declaration of
    
      struct lttng_ust_shm_handle
    
    so just removing the "*handle" part. This can be considered as a
    cleanup (or a fix without actual runtime effect).
    
    lttng_client_callbacks_*: if the cb values would have been used in the
    consumer daemon, this would have caused an issue: these would be set to
    NULL instead of the actual callback pointers. So in a way this is a fix,
    but it does not have any runtime impact at this point.
    
    Reported-by: Hollis Blanchard <hollis_blanchard at mentor.com>
    Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>



-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-08 17:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-07 21:26 [lttng-dev] -warn-common with lttng-ust 2.0.2 Hollis Blanchard
2012-06-08 17:17 ` Mathieu Desnoyers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox