Skip to content

Commit

Permalink
Update libbpf version (1.2.2) (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagoftsm authored Jul 15, 2023
1 parent cc03239 commit 12c2709
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ You can also get everything for glibc [here](UPLOAD FILE WITH ALL BINARIES TO SI

This PR was tested on:

| Linux Distribution | kernel version | real parent | parent | all |
|--------------------|----------------|-------------|--------|------|
| LINUX DISTRIBUION | uname -r | | | |
| Linux Distribution | Environment |Kernel Version | Real Parent | Parent | All |
|--------------------|----------------|---------------|-------------|--------|------|
| LINUX DISTRIBUION | Bare metal/VM | uname -r | | | |
8 changes: 6 additions & 2 deletions kernel/socket_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,12 @@ static __always_inline void update_pid_connection(__u8 version)
data.ipv6_connect = 1;

bpf_map_update_elem(&tbl_bandwidth, &key, &data, BPF_ANY);

libnetdata_update_global(&socket_ctrl, NETDATA_CONTROLLER_PID_TABLE_ADD, 1);
}
}

static __always_inline void update_pid_cleanup(__u16 family)
static __always_inline void update_pid_cleanup()
{
netdata_bandwidth_t *b;
netdata_bandwidth_t data = { };
Expand Down Expand Up @@ -376,6 +378,8 @@ int netdata_inet_csk_accept(struct pt_regs* ctx)
data.pid = pid;
data.counter = 1;
bpf_map_update_elem(&tbl_lports, &idx, &data, BPF_ANY);

libnetdata_update_global(&socket_ctrl, NETDATA_CONTROLLER_PID_TABLE_ADD, 1);
}

return 0;
Expand Down Expand Up @@ -466,7 +470,7 @@ int netdata_tcp_close(struct pt_regs* ctx)
if (family == AF_UNSPEC)
return 0;

update_pid_cleanup(family);
update_pid_cleanup();

netdata_socket_t *val = (netdata_socket_t *) bpf_map_lookup_elem(&tbl_nd_socket, &idx);
if (val) {
Expand Down
2 changes: 1 addition & 1 deletion libbpf

0 comments on commit 12c2709

Please sign in to comment.