summaryrefslogtreecommitdiffstats
path: root/collectors/ebpf.plugin/ebpf_dcstat.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_dcstat.c
parent61bdc1c5ab71099d283a2d4865c4faa723933ff3 (diff)
Fix systemd chart update (eBPF) (#13884)
Diffstat (limited to 'collectors/ebpf.plugin/ebpf_dcstat.c')
-rw-r--r--collectors/ebpf.plugin/ebpf_dcstat.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/collectors/ebpf.plugin/ebpf_dcstat.c b/collectors/ebpf.plugin/ebpf_dcstat.c
index 43c51a993c..262028f929 100644
--- a/collectors/ebpf.plugin/ebpf_dcstat.c
+++ b/collectors/ebpf.plugin/ebpf_dcstat.c
@@ -893,21 +893,16 @@ static void ebpf_create_systemd_dc_charts(int update_every)
* Send Directory Cache 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_dc_charts()
+static void ebpf_send_systemd_dc_charts()
{
- int ret = 1;
collected_number value;
ebpf_cgroup_target_t *ect;
write_begin_chart(NETDATA_SERVICE_FAMILY, NETDATA_DC_HIT_CHART);
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_dc.ratio);
- } else if (unlikely(ect->systemd))
- ret = 0;
+ }
}
write_end_chart();
@@ -943,8 +938,6 @@ static int ebpf_send_systemd_dc_charts()
}
}
write_end_chart();
-
- return ret;
}
/**
@@ -999,13 +992,11 @@ void ebpf_dc_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_dc_charts(update_every);
- systemd_charts = 1;
}
- systemd_charts = ebpf_send_systemd_dc_charts();
+ ebpf_send_systemd_dc_charts();
}
for (ect = ebpf_cgroup_pids; ect ; ect = ect->next) {