[ltt-dev] UST __trace_mark_tp_counter

David Goulet david.goulet at polymtl.ca
Tue Oct 12 10:38:49 EDT 2010

Hash: SHA1

The register and unregister function a created with DECLARE_TRACE macro.

For the test case, event_msg is a "dummy" tracepoint NOT declared to test this
particular case where no trace declaration is done (hence the check_type
function utility).


On 10-10-12 10:27 AM, Nils Carlson wrote:
> 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

- -- 
David Goulet
LTTng project, DORSAL Lab.

BE3C 672B 9331 9796 291A  14C6 4AF7 C14B 16BD 8563
Version: GnuPG v1.4.10 (GNU/Linux)


More information about the lttng-dev mailing list