Skip to content

Commit

Permalink
Sync branches (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagoftsm authored Feb 5, 2024
1 parent 2be8700 commit bb106a4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion kernel-collector
4 changes: 2 additions & 2 deletions src/socket.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static __always_inline void update_socket_stats(netdata_socket_t *ptr,
int state)
{
ptr->ct = bpf_ktime_get_ns();
ptr->tcp.state = (state > 0) ? state : 0;
ptr->tcp.state = state;

if (sent) {
if (protocol == IPPROTO_TCP) {
Expand Down Expand Up @@ -340,7 +340,7 @@ static __always_inline int netdata_common_tcp_set_state(struct inet_sock *is, in
{
libnetdata_update_global(&tbl_global_sock, NETDATA_KEY_CALLS_TCP_SET_STATE, 1);

update_socket_table(NULL, 0, 0, 0, IPPROTO_TCP, state);
update_socket_table(is, 0, 0, 0, IPPROTO_TCP, state);

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions src/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static int ebpf_attach_probes(struct socket_bpf *obj)
return -1;

obj->links.netdata_tcp_set_state_kprobe = bpf_program__attach_kprobe(obj->progs.netdata_tcp_set_state_kprobe,
true, function_list[NETDATA_SOCKET_FCNT_END]);
true, function_list[NETDATA_FCNT_TCP_SET_STATE]);
ret = libbpf_get_error(obj->links.netdata_tcp_set_state_kprobe);
if (ret)
return -1;
Expand Down Expand Up @@ -211,7 +211,7 @@ static void ebpf_set_trampoline_target(struct socket_bpf *obj)
function_list[NETDATA_FCNT_UDP_SENDMSG]);

bpf_program__set_attach_target(obj->progs.netdata_tcp_set_state_fentry, 0,
function_list[NETDATA_SOCKET_FCNT_END]);
function_list[NETDATA_FCNT_TCP_SET_STATE]);
}

static inline int ebpf_load_and_attach(struct socket_bpf *obj, int selector)
Expand Down

0 comments on commit bb106a4

Please sign in to comment.