Skip to content

Commit

Permalink
tgid2nv: Add Task ID to create conditions to match charts that only u…
Browse files Browse the repository at this point in the history
…se /proc (#376)
  • Loading branch information
thiagoftsm authored Apr 3, 2024
1 parent 1cd2e6b commit 0d1ad64
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions includes/netdata_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ typedef struct netdata_nv_data {
int state;

__u32 pid;
__u32 tgid;
__u32 uid;
__u64 ts;

Expand Down
2 changes: 2 additions & 0 deletions kernel/network_viewer_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ static __always_inline void set_common_tcp_nv_data(netdata_nv_data_t *data,

__u32 tgid = 0;
data->pid = netdata_get_pid(&nv_ctrl, &tgid);
data->tgid = tgid;
data->uid = bpf_get_current_uid_gid();
// Only update this data when it is a new value
if (!data->ts)
Expand All @@ -214,6 +215,7 @@ static __always_inline void set_common_udp_nv_data(netdata_nv_data_t *data,
NETDATA_SOCKET_DIRECTION direction) {
__u32 tgid = 0;
data->pid = netdata_get_pid(&nv_ctrl, &tgid);
data->tgid = 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 0d1ad64

Please sign in to comment.