From: Simon Marchi Date: Wed, 13 Aug 2014 23:10:41 +0000 (-0400) Subject: Rename public structure to avoid collisions X-Git-Tag: v2.6.0-rc1~8 X-Git-Url: http://git.lttng.org./?a=commitdiff_plain;h=1a20609484df56e378318d65f07f39dcd8ec1db2;hp=1a20609484df56e378318d65f07f39dcd8ec1db2;p=lttng-ust.git Rename public structure to avoid collisions Since nobody raised any concern about this, I submit the patch for merging. You can find the original discussion here: http://lists.lttng.org/pipermail/lttng-dev/2014-July/023364.html (the rest of the message is identical to the RFC post) When trying to use lttng-ust with a program that defines its own struct tracepoint, a name collision arises and compilation fails (see example lower). I suggest the following renames (the problem only showed up with struct tracepoint in my case, but let's be proactive): * struct tracepoint -> struct lttng_ust_tracepoint * struct tracepoint_probe -> struct lttng_ust_tracepoint_probe * struct tracepoint_dlopen -> struct lttng_ust_tracepoint_dlopen Strictly speaking, those names are part of the public API of LTTng, so I understand that it would be a felony to rename it, since it breaks the holy API. However, those structures are only used through some macros, and I am not aware of any sensible use case where a user of lttng-ust would directly reference those structures. Therefore, it should not break any existing code. If you do have such a use case, where it would break your code, please jump in the discussion. This should not break any application instrumented and built before the change. Tested by building "hello" before and tracing it after the change. Here is an example of error due to the name collision. This is when building gdb, which I try to instrument with lttng-ust. In file included from /usr/local/include/lttng/tracepoint.h:28:0, from ust_tracepoints.h:15, from inf-ptrace.c:38: /usr/local/include/lttng/tracepoint-types.h:32:8: error: redefinition of ‘struct tracepoint’ struct tracepoint { ^ In file included from inferior.h:37:0, from inf-ptrace.c:22: breakpoint.h:817:8: note: originally defined here struct tracepoint ^ Makefile:1088: recipe for target 'inf-ptrace.o' failed make: *** [inf-ptrace.o] Error 1 Signed-off-by: Mathieu Desnoyers ---