diff options
author | thiagoftsm <thiagoftsm@gmail.com> | 2021-06-14 11:44:06 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-14 11:44:06 +0000 |
commit | 086b5b9090f46bff80534119c793f0cd2d423834 (patch) | |
tree | 0c883a901bac04b621dfa77913dd82157be86f32 /collectors | |
parent | f6ec79cfb8e10b421655df5af1336c91cf41ded4 (diff) |
Adds xfs filesystem monitoring to eBPF (#11238)
Diffstat (limited to 'collectors')
-rw-r--r-- | collectors/ebpf.plugin/README.md | 1 | ||||
-rw-r--r-- | collectors/ebpf.plugin/ebpf.d/filesystem.conf | 1 | ||||
-rw-r--r-- | collectors/ebpf.plugin/ebpf_filesystem.c | 15 |
3 files changed, 13 insertions, 4 deletions
diff --git a/collectors/ebpf.plugin/README.md b/collectors/ebpf.plugin/README.md index 8c4754820a..839c6ab721 100644 --- a/collectors/ebpf.plugin/README.md +++ b/collectors/ebpf.plugin/README.md @@ -325,6 +325,7 @@ filesystems are monitored. ```conf [filesystem] ext4dist = yes + xfsdist = yes ``` ## Troubleshooting diff --git a/collectors/ebpf.plugin/ebpf.d/filesystem.conf b/collectors/ebpf.plugin/ebpf.d/filesystem.conf index 9d3b0233db..38b6de30d4 100644 --- a/collectors/ebpf.plugin/ebpf.d/filesystem.conf +++ b/collectors/ebpf.plugin/ebpf.d/filesystem.conf @@ -14,3 +14,4 @@ # All filesystems are named as 'NAMEdist' where NAME is the filesystem name while 'dist' is a reference for distribution. [filesystem] ext4dist = yes + xfsdist = yes diff --git a/collectors/ebpf.plugin/ebpf_filesystem.c b/collectors/ebpf.plugin/ebpf_filesystem.c index 68521c07a6..92ef08f660 100644 --- a/collectors/ebpf.plugin/ebpf_filesystem.c +++ b/collectors/ebpf.plugin/ebpf_filesystem.c @@ -16,6 +16,13 @@ ebpf_filesystem_partitions_t localfs[] = .flags = NETDATA_FILESYSTEM_FLAG_NO_PARTITION, .enabled = CONFIG_BOOLEAN_YES, .addresses = {.function = NULL, .addr = 0}}, + {.filesystem = "xfs", + .family = "XFS", + .objects = NULL, + .probe_links = NULL, + .flags = NETDATA_FILESYSTEM_FLAG_NO_PARTITION, + .enabled = CONFIG_BOOLEAN_YES, + .addresses = {.function = NULL, .addr = 0}}, {.filesystem = NULL, .family = NULL, .objects = NULL, @@ -317,9 +324,6 @@ void ebpf_filesystem_cleanup_ebpf_data() j++; } bpf_object__close(efp->objects); - - ebpf_histogram_dimension_cleanup(dimensions, NETDATA_FILESYSTEM_MAX_BINS); - freez(filesystem_hash_values); } } } @@ -347,6 +351,8 @@ static void ebpf_filesystem_cleanup(void *ptr) ebpf_cleanup_publish_syscall(filesystem_publish_aggregated); ebpf_filesystem_cleanup_ebpf_data(); + ebpf_histogram_dimension_cleanup(dimensions, NETDATA_FILESYSTEM_MAX_BINS); + freez(filesystem_hash_values); } /***************************************************************** @@ -507,9 +513,10 @@ static void write_histogram_chart(char *family, char *name, const netdata_idx_t static void ebpf_histogram_send_data() { uint32_t i; + uint32_t test = NETDATA_FILESYSTEM_FLAG_HAS_PARTITION | NETDATA_FILESYSTEM_REMOVE_CHARTS; for (i = 0; localfs[i].filesystem; i++) { ebpf_filesystem_partitions_t *efp = &localfs[i]; - if (efp->flags & NETDATA_FILESYSTEM_FLAG_HAS_PARTITION) { + if ((efp->flags & test) == NETDATA_FILESYSTEM_FLAG_HAS_PARTITION) { write_histogram_chart(NETDATA_FILESYSTEM_FAMILY, efp->hread.name, efp->hread.histogram, NETDATA_FILESYSTEM_MAX_BINS); |