[lttng-dev] tracepoint generation is fragile wrt macro expansion

Sébastien Barthélémy barthelemy at crans.org
Fri Dec 14 11:36:22 EST 2012


Hello,

please find attached a small patch which demonstrates the problem.

The patch simply renames the test file ust_tests_hello.h into
ust_tests-linux-hello.h. The build then fails on linux because the "linux"
in

    #define TRACEPOINT_INCLUDE_FILE ./ust_tests-linux-hello.h

gets expanded to "1", and it then tries to include ust_tests-1-hello.h.

I do not know if this can be fixed, hopefully you'll have a better idea.

I came into the problem because I generate the tracepoint definition file
(à la lttng-gen-tp) but define TRACEPOINT_INCLUDE_FILE to the full path of
the generated file, which happens to be in the build directory, something
like .../build-sys-linux-x86_64/..., So I'm more exposed.

Maybe a possible solution would involve __FILE__?

Cheers

-- Sébastien
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20121214/664293fb/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-make-ust_tests_hello-fail-because-of-macro-expansion.patch
Type: application/octet-stream
Size: 7701 bytes
Desc: not available
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20121214/664293fb/attachment.obj>


More information about the lttng-dev mailing list