summaryrefslogtreecommitdiffstats
path: root/collectors/ebpf.plugin/ebpf_socket.c
diff options
context:
space:
mode:
authorthiagoftsm <thiagoftsm@gmail.com>2022-11-01 12:05:14 +0000
committerGitHub <noreply@github.com>2022-11-01 12:05:14 +0000
commitd4e0f112868da4bd6e1b39bc6fd0abcc154826de (patch)
tree8b5649e9f03fca6194121a5d84402624d26fae90 /collectors/ebpf.plugin/ebpf_socket.c
parent61bdc1c5ab71099d283a2d4865c4faa723933ff3 (diff)
Fix systemd chart update (eBPF) (#13884)
Diffstat (limited to 'collectors/ebpf.plugin/ebpf_socket.c')
-rw-r--r--collectors/ebpf.plugin/ebpf_socket.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/collectors/ebpf.plugin/ebpf_socket.c b/collectors/ebpf.plugin/ebpf_socket.c
index 15a348743c..93d4e83317 100644
--- a/collectors/ebpf.plugin/ebpf_socket.c
+++ b/collectors/ebpf.plugin/ebpf_socket.c
@@ -2709,20 +2709,15 @@ static void ebpf_create_systemd_socket_charts(int update_every)
* Send Systemd charts
*
* Send collected data to Netdata.
- *
- * @return It returns the status for chart creation, if it is necessary to remove a specific dimension, zero is returned
- * otherwise function returns 1 to avoid chart recreation
*/
-static int ebpf_send_systemd_socket_charts()
+static void ebpf_send_systemd_socket_charts()
{
- int ret = 1;
ebpf_cgroup_target_t *ect;
write_begin_chart(NETDATA_SERVICE_FAMILY, NETDATA_NET_APPS_CONNECTION_TCP_V4);
for (ect = ebpf_cgroup_pids; ect ; ect = ect->next) {
if (unlikely(ect->systemd) && unlikely(ect->updated)) {
write_chart_dimension(ect->name, (long long)ect->publish_socket.call_tcp_v4_connection);
- } else if (unlikely(ect->systemd))
- ret = 0;
+ }
}
write_end_chart();
@@ -2730,8 +2725,7 @@ static int ebpf_send_systemd_socket_charts()
for (ect = ebpf_cgroup_pids; ect ; ect = ect->next) {
if (unlikely(ect->systemd) && unlikely(ect->updated)) {
write_chart_dimension(ect->name, (long long)ect->publish_socket.call_tcp_v6_connection);
- } else
- ret = 0;
+ }
}
write_end_chart();
@@ -2739,8 +2733,7 @@ static int ebpf_send_systemd_socket_charts()
for (ect = ebpf_cgroup_pids; ect ; ect = ect->next) {
if (unlikely(ect->systemd) && unlikely(ect->updated)) {
write_chart_dimension(ect->name, (long long)ect->publish_socket.bytes_sent);
- } else
- ret = 0;
+ }
}
write_end_chart();
@@ -2791,8 +2784,6 @@ static int ebpf_send_systemd_socket_charts()
}
}
write_end_chart();
-
- return ret;
}
/**
@@ -2828,12 +2819,10 @@ static void ebpf_socket_send_cgroup_data(int update_every)
int has_systemd = shm_ebpf_cgroup.header->systemd_enabled;
if (has_systemd) {
- static int systemd_charts = 0;
- if (!systemd_charts) {
+ if (send_cgroup_chart) {
ebpf_create_systemd_socket_charts(update_every);
- systemd_charts = 1;
}
- systemd_charts = ebpf_send_systemd_socket_charts();
+ ebpf_send_systemd_socket_charts();
}
for (ect = ebpf_cgroup_pids; ect ; ect = ect->next) {