From 3980750d0727154b271c416f562782ffd8710c84 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 15 May 2018 17:51:24 -0400 Subject: [PATCH] Fix: pid tracker should track "pgid" for noargs probes 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 --- probes/lttng-tracepoint-event-impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/probes/lttng-tracepoint-event-impl.h b/probes/lttng-tracepoint-event-impl.h index 0842dcc0..97f0b3db 100644 --- a/probes/lttng-tracepoint-event-impl.h +++ b/probes/lttng-tracepoint-event-impl.h @@ -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(<tng_dynamic_len_stack)->offset; \ __dynamic_len_idx = __orig_dynamic_len_offset; \ -- 2.34.1