Skip to content

Commit

Permalink
address_comments: Get different PIDs levels (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagoftsm authored Mar 29, 2024
1 parent 791490f commit 1cd2e6b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kernel/network_viewer_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 1cd2e6b

Please sign in to comment.