From 1cd2e6bd224fa3078fd1a4c2e3944789d046aafa Mon Sep 17 00:00:00 2001 From: thiagoftsm Date: Fri, 29 Mar 2024 23:57:55 +0000 Subject: [PATCH] address_comments: Get different PIDs levels (#375) --- kernel/network_viewer_kern.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/network_viewer_kern.c b/kernel/network_viewer_kern.c index 8c5ff7b8..cda56aa7 100644 --- a/kernel/network_viewer_kern.c +++ b/kernel/network_viewer_kern.c @@ -190,7 +190,8 @@ static __always_inline void set_common_tcp_nv_data(netdata_nv_data_t *data, data->name[0] = '\0'; #endif - data->pid = bpf_get_current_pid_tgid() >> 32; + __u32 tgid = 0; + data->pid = netdata_get_pid(&nv_ctrl, &tgid); data->uid = bpf_get_current_uid_gid(); // Only update this data when it is a new value if (!data->ts) @@ -211,7 +212,8 @@ static __always_inline void set_common_udp_nv_data(netdata_nv_data_t *data, struct sock *sk, __u16 family, NETDATA_SOCKET_DIRECTION direction) { - data->pid = bpf_get_current_pid_tgid() >> 32; + __u32 tgid = 0; + data->pid = netdata_get_pid(&nv_ctrl, &tgid); data->uid = bpf_get_current_uid_gid(); // Only update this data when it is a new value if (!data->ts)