[ltt-dev] UST __trace_mark_tp_counter

Nils Carlson nils.carlson at ericsson.com
Tue Oct 12 10:27:00 EDT 2010


I was doing some minor fixes in UST today when I came across a small 
phenomenon. Since including Davids testcase for trae_mark_tp I cannot
compile with -Wall. The compiler throws out a

tracepoint_test.o: In function `__check_tp_type':
/home/nils/devel/ust/tests/tracepoint/tracepoint_test.c:64: undefined 
reference to `register_trace_ust_event_msg'
collect2: ld returned 1 exit status


Looking at the macros in include/ust/marker.h I find the function

void __check_tp_type(void)				\
 		{							\
 			register_trace_##tp_name(tp_cb, call_private); 
\
 		}							\

defined inside the __trace_mark_tp_counter function.

In the case of _DEFINE_MARKER_TP we don't create the register and 
unregister functions as far as I can tell. And the error only occurs when 
compiling with -Wall which I'm guessing is because __check_tp_type is 
never called and is optimised out completely normally? If I create a void 
pointer and assign the function address to it I get the error when 
compiling without -Wall as well.

Mathieu: What do you think of this, does it seem reasonable? How do you 
think we should fix it? Simplest would be to remove the check, I don't 
know if the register and unregister functions will be used for anything?

/Nils




More information about the lttng-dev mailing list