From 9dcd5e6d31f1cd93138f3d50b0217db89207b44a Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 16 Oct 2012 10:28:21 -0400 Subject: [PATCH] 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 --- include/lttng/tracepoint.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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__ -- 2.34.1