summaryrefslogtreecommitdiffstats
path: root/collectors/ebpf.plugin/ebpf_filesystem.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-05-08 16:27:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-05-08 16:27:08 +0000
commit81581f9719bc56f01d5aa08952671d65fda9867a (patch)
tree0f5c6b6138bf169c23c9d24b1fc0a3521385cb18 /collectors/ebpf.plugin/ebpf_filesystem.c
parentReleasing debian version 1.38.1-1. (diff)
downloadnetdata-81581f9719bc56f01d5aa08952671d65fda9867a.tar.xz
netdata-81581f9719bc56f01d5aa08952671d65fda9867a.zip
Merging upstream version 1.39.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/ebpf.plugin/ebpf_filesystem.c')
-rw-r--r--collectors/ebpf.plugin/ebpf_filesystem.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/collectors/ebpf.plugin/ebpf_filesystem.c b/collectors/ebpf.plugin/ebpf_filesystem.c
index 5250ed8af..f8b28195c 100644
--- a/collectors/ebpf.plugin/ebpf_filesystem.c
+++ b/collectors/ebpf.plugin/ebpf_filesystem.c
@@ -92,7 +92,7 @@ static void ebpf_obsolete_fs_charts(int update_every)
static void ebpf_create_fs_charts(int update_every)
{
static int order = NETDATA_CHART_PRIO_EBPF_FILESYSTEM_CHARTS;
- char chart_name[64], title[256], family[64];
+ char chart_name[64], title[256], family[64], ctx[64];
int i;
uint32_t test = NETDATA_FILESYSTEM_FLAG_CHART_CREATED|NETDATA_FILESYSTEM_REMOVE_CHARTS;
for (i = 0; localfs[i].filesystem; i++) {
@@ -110,7 +110,7 @@ static void ebpf_create_fs_charts(int update_every)
ebpf_create_chart(NETDATA_FILESYSTEM_FAMILY, efp->hread.name,
title,
EBPF_COMMON_DIMENSION_CALL, family,
- NULL, NETDATA_EBPF_CHART_TYPE_STACKED, order, ebpf_create_global_dimension,
+ "filesystem.read_latency", NETDATA_EBPF_CHART_TYPE_STACKED, order, ebpf_create_global_dimension,
filesystem_publish_aggregated, NETDATA_EBPF_HIST_MAX_BINS,
update_every, NETDATA_EBPF_MODULE_NAME_FILESYSTEM);
order++;
@@ -123,7 +123,7 @@ static void ebpf_create_fs_charts(int update_every)
ebpf_create_chart(NETDATA_FILESYSTEM_FAMILY, efp->hwrite.name,
title,
EBPF_COMMON_DIMENSION_CALL, family,
- NULL, NETDATA_EBPF_CHART_TYPE_STACKED, order, ebpf_create_global_dimension,
+ "filesystem.write_latency", NETDATA_EBPF_CHART_TYPE_STACKED, order, ebpf_create_global_dimension,
filesystem_publish_aggregated, NETDATA_EBPF_HIST_MAX_BINS,
update_every, NETDATA_EBPF_MODULE_NAME_FILESYSTEM);
order++;
@@ -136,7 +136,7 @@ static void ebpf_create_fs_charts(int update_every)
ebpf_create_chart(NETDATA_FILESYSTEM_FAMILY, efp->hopen.name,
title,
EBPF_COMMON_DIMENSION_CALL, family,
- NULL, NETDATA_EBPF_CHART_TYPE_STACKED, order, ebpf_create_global_dimension,
+ "filesystem.open_latency", NETDATA_EBPF_CHART_TYPE_STACKED, order, ebpf_create_global_dimension,
filesystem_publish_aggregated, NETDATA_EBPF_HIST_MAX_BINS,
update_every, NETDATA_EBPF_MODULE_NAME_FILESYSTEM);
order++;
@@ -144,12 +144,13 @@ static void ebpf_create_fs_charts(int update_every)
char *type = (efp->flags & NETDATA_FILESYSTEM_ATTR_CHARTS) ? "attribute" : "sync";
snprintfz(title, 255, "%s latency for each %s request.", efp->filesystem, type);
snprintfz(chart_name, 63, "%s_%s_latency", efp->filesystem, type);
+ snprintfz(ctx, 63, "filesystem.%s_latency", type);
efp->hadditional.name = strdupz(chart_name);
efp->hadditional.title = strdupz(title);
efp->hadditional.order = order;
ebpf_create_chart(NETDATA_FILESYSTEM_FAMILY, efp->hadditional.name, title,
EBPF_COMMON_DIMENSION_CALL, family,
- NULL, NETDATA_EBPF_CHART_TYPE_STACKED, order, ebpf_create_global_dimension,
+ ctx, NETDATA_EBPF_CHART_TYPE_STACKED, order, ebpf_create_global_dimension,
filesystem_publish_aggregated, NETDATA_EBPF_HIST_MAX_BINS,
update_every, NETDATA_EBPF_MODULE_NAME_FILESYSTEM);
order++;
@@ -182,6 +183,9 @@ int ebpf_filesystem_initialize_ebpf_data(ebpf_module_t *em)
return -1;
}
efp->flags |= NETDATA_FILESYSTEM_FLAG_HAS_PARTITION;
+ pthread_mutex_lock(&lock);
+ ebpf_update_kernel_memory(&plugin_statistics, &fs_maps[i], EBPF_ACTION_STAT_ADD);
+ pthread_mutex_unlock(&lock);
// Nedeed for filesystems like btrfs
if ((efp->flags & NETDATA_FILESYSTEM_FILL_ADDRESS_TABLE) && (efp->addresses.function)) {
@@ -326,18 +330,16 @@ void ebpf_filesystem_cleanup_ebpf_data()
static void ebpf_filesystem_free(ebpf_module_t *em)
{
pthread_mutex_lock(&ebpf_exit_cleanup);
- em->thread->enabled = NETDATA_THREAD_EBPF_STOPPING;
+ em->enabled = NETDATA_THREAD_EBPF_STOPPING;
pthread_mutex_unlock(&ebpf_exit_cleanup);
- ebpf_cleanup_publish_syscall(filesystem_publish_aggregated);
-
ebpf_filesystem_cleanup_ebpf_data();
if (dimensions)
ebpf_histogram_dimension_cleanup(dimensions, NETDATA_EBPF_HIST_MAX_BINS);
freez(filesystem_hash_values);
pthread_mutex_lock(&ebpf_exit_cleanup);
- em->thread->enabled = NETDATA_THREAD_EBPF_STOPPED;
+ em->enabled = NETDATA_THREAD_EBPF_STOPPED;
pthread_mutex_unlock(&ebpf_exit_cleanup);
}
@@ -567,7 +569,6 @@ void *ebpf_filesystem_thread(void *ptr)
if (em->optional)
info("Netdata cannot monitor the filesystems used on this host.");
- em->thread->enabled = NETDATA_THREAD_EBPF_STOPPED;
goto endfilesystem;
}