Fix: pid tracker should track "pgid" for noargs probes
[lttng-modules.git] / probes / lttng-tracepoint-event-impl.h
index e1c408298fea396ceda470dcc12f8a10a735654d..97f0b3db3add67e7f77ee0b8d6fe4f6ebb85db0c 100644 (file)
@@ -34,6 +34,7 @@
 #include <wrapper/rcu.h>
 #include <lttng-events.h>
 #include <lttng-tracer-core.h>
+#include <lttng-tp-mempool.h>
 
 #define __LTTNG_NULL_STRING    "(null)"
 
@@ -1130,7 +1131,7 @@ static void __event_probe__##_name(void *__data, _proto)                \
        struct lib_ring_buffer_ctx __ctx;                                     \
        ssize_t __event_len;                                                  \
        size_t __event_align;                                                 \
-       size_t __orig_dynamic_len_offset, __dynamic_len_idx;                  \
+       size_t __orig_dynamic_len_offset, __dynamic_len_idx __attribute__((unused)); \
        union {                                                               \
                size_t __dynamic_len_removed[ARRAY_SIZE(__event_fields___##_name)];   \
                char __filter_stack_data[2 * sizeof(unsigned long) * ARRAY_SIZE(__event_fields___##_name)]; \
@@ -1143,14 +1144,14 @@ static void __event_probe__##_name(void *__data, _proto)                      \
                                                                              \
        if (!_TP_SESSION_CHECK(session, __session))                           \
                return;                                                       \
-       if (unlikely(!ACCESS_ONCE(__session->active)))                        \
+       if (unlikely(!READ_ONCE(__session->active)))                          \
                return;                                                       \
-       if (unlikely(!ACCESS_ONCE(__chan->enabled)))                          \
+       if (unlikely(!READ_ONCE(__chan->enabled)))                            \
                return;                                                       \
-       if (unlikely(!ACCESS_ONCE(__event->enabled)))                         \
+       if (unlikely(!READ_ONCE(__event->enabled)))                           \
                return;                                                       \
        __lpf = lttng_rcu_dereference(__session->pid_tracker);                \
-       if (__lpf && likely(!lttng_pid_tracker_lookup(__lpf, current->pid)))  \
+       if (__lpf && likely(!lttng_pid_tracker_lookup(__lpf, current->tgid))) \
                return;                                                       \
        __orig_dynamic_len_offset = this_cpu_ptr(&lttng_dynamic_len_stack)->offset; \
        __dynamic_len_idx = __orig_dynamic_len_offset;                        \
@@ -1204,7 +1205,7 @@ static void __event_probe__##_name(void *__data)                        \
        struct lib_ring_buffer_ctx __ctx;                                     \
        ssize_t __event_len;                                                  \
        size_t __event_align;                                                 \
-       size_t __orig_dynamic_len_offset, __dynamic_len_idx;                  \
+       size_t __orig_dynamic_len_offset, __dynamic_len_idx __attribute__((unused)); \
        union {                                                               \
                size_t __dynamic_len_removed[ARRAY_SIZE(__event_fields___##_name)];   \
                char __filter_stack_data[2 * sizeof(unsigned long) * ARRAY_SIZE(__event_fields___##_name)]; \
@@ -1217,14 +1218,14 @@ static void __event_probe__##_name(void *__data)                              \
                                                                              \
        if (!_TP_SESSION_CHECK(session, __session))                           \
                return;                                                       \
-       if (unlikely(!ACCESS_ONCE(__session->active)))                        \
+       if (unlikely(!READ_ONCE(__session->active)))                          \
                return;                                                       \
-       if (unlikely(!ACCESS_ONCE(__chan->enabled)))                          \
+       if (unlikely(!READ_ONCE(__chan->enabled)))                            \
                return;                                                       \
-       if (unlikely(!ACCESS_ONCE(__event->enabled)))                         \
+       if (unlikely(!READ_ONCE(__event->enabled)))                           \
                return;                                                       \
        __lpf = lttng_rcu_dereference(__session->pid_tracker);                \
-       if (__lpf && likely(!lttng_pid_tracker_lookup(__lpf, current->pid)))  \
+       if (__lpf && likely(!lttng_pid_tracker_lookup(__lpf, current->tgid)))  \
                return;                                                       \
        __orig_dynamic_len_offset = this_cpu_ptr(&lttng_dynamic_len_stack)->offset; \
        __dynamic_len_idx = __orig_dynamic_len_offset;                        \
This page took 0.024899 seconds and 4 git commands to generate.