From: Mathieu Desnoyers Date: Tue, 16 Oct 2012 14:28:21 +0000 (-0400) Subject: callsite: move after the call X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=9dcd5e6d31f1cd93138f3d50b0217db89207b44a;p=lttng-ust.git callsite: move after the call move after the call so that the address sampled matches, typically, the return address of the tracepoint callee. Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/tracepoint.h b/include/lttng/tracepoint.h index 61d227d5..8e4704c4 100644 --- a/include/lttng/tracepoint.h +++ b/include/lttng/tracepoint.h @@ -35,12 +35,13 @@ extern "C" { #endif -#define tracepoint(provider, name, ...) \ - do { \ - TRACEPOINT_CALLSITE(provider, name); \ - STAP_PROBEV(provider, name, ## __VA_ARGS__); \ - if (caa_unlikely(__tracepoint_##provider##___##name.state)) \ - __tracepoint_cb_##provider##___##name(__VA_ARGS__); \ +#define tracepoint(provider, name, ...) \ + do { \ + STAP_PROBEV(provider, name, ## __VA_ARGS__); \ + if (caa_unlikely(__tracepoint_##provider##___##name.state)) { \ + __tracepoint_cb_##provider##___##name(__VA_ARGS__); \ + TRACEPOINT_CALLSITE(provider, name); \ + } \ } while (0) #define TP_ARGS(...) __VA_ARGS__