Skip to content

Commit

Permalink
Sync branches (#67)
Browse files Browse the repository at this point in the history
* sync_branches: Sync kernel-collector

* sync_branches: Update algorithm
  • Loading branch information
thiagoftsm authored Feb 28, 2024
1 parent e5e3e43 commit 2c26e4a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kernel-collector
10 changes: 8 additions & 2 deletions src/networkviewer.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ static __always_inline void set_common_tcp_nv_data(netdata_nv_idx_t *idx,

data->pid = bpf_get_current_pid_tgid() >> 32;
data->uid = bpf_get_current_uid_gid();
data->ts = bpf_ktime_get_ns();
// Only update this data when it is a new value
if (!data->ts)
data->ts = bpf_ktime_get_ns();

data->timer = 0;
bpf_probe_read(&data->retransmits, sizeof(data->retransmits), &icsk->icsk_retransmits);
data->expires = 0;
Expand All @@ -168,7 +171,10 @@ static __always_inline void set_common_udp_nv_data(netdata_nv_idx_t *idx,
__u16 family) {
data->pid = bpf_get_current_pid_tgid() >> 32;
data->uid = bpf_get_current_uid_gid();
data->ts = bpf_ktime_get_ns();
// Only update this data when it is a new value
if (!data->ts)
data->ts = bpf_ktime_get_ns();

data->protocol = IPPROTO_UDP;
data->family = family;
unsigned char udp_state;
Expand Down

0 comments on commit 2c26e4a

Please sign in to comment.