[lttng-dev] undefined reference to `tracepoint_dlopen_ptr'

Chris Cole ccole at juniper.net
Wed Jan 11 22:04:57 UTC 2017


Greetings.

Summary of what I'm trying to do:

• Define one or more tracepoints
• Link the tracepoints into a shared library so that multiple applications can use the common tracepoints
• Have the applications include the generated header file in order to use the tracepoint(s)

What I'm seeing:

example-main.o: In function `__tracepoint_cb_LIBLOGTRACE_GENERIC_TRACEPOINTS___LIBLOGTRACE_GENERIC_EMERG':
/home/ccole/public/pr1244864/./generic_tracepoints.hpp:13: undefined reference to `tracepoint_dlopen_ptr'

Does this ring a bell? Is this use case supported? Please advise.

Cordialement,
Chris

example-main.cpp:

#include <example-lib.h> /* declares the "foo" function */
#include <generic_tracepoints.hpp> /* the generated tracepoint header */

static void bar() {
    tracepoint(LIBLOGTRACE_GENERIC_TRACEPOINTS, LIBLOGTRACE_GENERIC_EMERG, "bar");
}

int
main(int argc, char *argv[])
{
    foo();
    bar();

    return 0;
}

example-lib.cpp:

#include <example-lib.h>
#include <generic_tracepoints.hpp>

#include <stdio.h>

void foo() {
    tracepoint(LIBLOGTRACE_GENERIC_TRACEPOINTS, LIBLOGTRACE_GENERIC_EMERG, "foo");
    printf("foo\n");
}





More information about the lttng-dev mailing list