Actions
Bug #1273
closedCannot use a #defined TRACEPOINT_PROVIDER name with TRACEPOINT_EVENT_{CLASS,INSTANCE}() macros
Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
06/14/2020
Due date:
% Done:
100%
Estimated time:
Description
It doesn't seem to be possible to use a provider name that was #defined if using the TRACEPOINT_EVENT_{CLASS,INSTANCE}() macros, e.g.:
// + all the boilerplate code
#define TRACEPOINT_PROVIDER my_provider
TRACEPOINT_EVENT_CLASS(
TRACEPOINT_PROVIDER,
my_class,
TP_ARGS(
const void *, some_arg
),
TP_FIELDS(
ctf_integer_hex(const void *, whatever, some_arg)
)
)
TRACEPOINT_EVENT_INSTANCE(
TRACEPOINT_PROVIDER,
my_class,
my_tracepoint_does_not_work,
TP_ARGS(
const void *, some_arg
)
)
In my case, I had:
- a shared lib providing the tracepoints
- an application linking against the above lib
When compiling, it fails on the app and not the lib.
It expected this to work because it works when using the simpler TRACEPOINT_EVENT() macro. However, if I use my_provider directly instead of TRACEPOINT_PROVIDER, it works.
I've reproduced this on master.
Here's a MWE: https://github.com/christophebedard/lttng-tracepoint-provider-name-define-mwe
Actions