[ltt-dev] ust tracepoint test failure on powerpc

Jon Bernard jbernard at debian.org
Mon Dec 6 11:30:08 EST 2010


While preparing ust 0.9 for debian, I noticed on powerpc that the
tracepoint test was failing to compile:

    $ make
    CC     tracepoint_test.o
    CCLD   tracepoint_test
    tracepoint_test.o: In function `__check_tp_type.4232':
    tracepoint_test.c:(.text+0x104): undefined reference to `register_trace_ust_event_msg'
    collect2: ld returned 1 exit status
    make: *** [tracepoint_test] Error 1

Upon inspection, I see that trace_mark_tp() eventually defines a routine
that makes a call to register_trace_use_event_msg(). As far as I can
tell, the only way for that symbol to be defined is through a call to
DECLARE_TRACE(). So the following diff allows the code to compile and
the test appears to run successfully:

    diff --git a/tests/tracepoint/tracepoint_test.h b/tests/tracepoint/tracepoint_test.h
    index 6b4dcdb..200cdd1 100644
    --- a/tests/tracepoint/tracepoint_test.h
    +++ b/tests/tracepoint/tracepoint_test.h
    @@ -2,6 +2,7 @@
    
    DECLARE_TRACE(ust_event, TP_PROTO(unsigned int v), TP_ARGS(v));
    DECLARE_TRACE(ust_event2, TP_PROTO(unsigned int v), TP_ARGS(v));
    +DECLARE_TRACE(ust_event_msg, TP_PROTO(unsigned int v), TP_ARGS(v));
    
    struct message {
            char *payload;

So my question is, how is this compiling for non-powerpc architectures?
It isn't clear to me how register_trace_ust_event_msg() would be defined
without the call to DECLARE_TRACE(). What am I missing?

Thanks

-- 
Jon




More information about the lttng-dev mailing list