Fix: pid tracker should track "pgid" for noargs probes
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 15 May 2018 21:51:24 +0000 (17:51 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 15 May 2018 21:51:24 +0000 (17:51 -0400)
The "pid" notion exposed by LTTng translates to the "pgid" notion in the
Linux kernel. Therefore using "current->pid" as argument to the PID
tracker actually ends up behaving as a "tid" tracker, which does not
match the intent nor the user-space tracer behavior.

The probes taking arguments were fixed by a prior commit, but it missed
probes without arguments.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
probes/lttng-tracepoint-event-impl.h

index 0842dcc0e210e491a92eb91a8739748460003d5b..97f0b3db3add67e7f77ee0b8d6fe4f6ebb85db0c 100644 (file)
@@ -1225,7 +1225,7 @@ static void __event_probe__##_name(void *__data)                        \
        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.02579 seconds and 4 git commands to generate.