summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthiagoftsm <thiagoftsm@gmail.com>2021-06-14 11:44:06 +0000
committerGitHub <noreply@github.com>2021-06-14 11:44:06 +0000
commit086b5b9090f46bff80534119c793f0cd2d423834 (patch)
tree0c883a901bac04b621dfa77913dd82157be86f32
parentf6ec79cfb8e10b421655df5af1336c91cf41ded4 (diff)
Adds xfs filesystem monitoring to eBPF (#11238)
-rw-r--r--collectors/ebpf.plugin/README.md1
-rw-r--r--collectors/ebpf.plugin/ebpf.d/filesystem.conf1
-rw-r--r--collectors/ebpf.plugin/ebpf_filesystem.c15
-rw-r--r--packaging/ebpf.checksums6
-rw-r--r--packaging/ebpf.version2
-rw-r--r--web/gui/dashboard_info.js16
6 files changed, 33 insertions, 8 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);
diff --git a/packaging/ebpf.checksums b/packaging/ebpf.checksums
index e5ad31f908..f731f58911 100644
--- a/packaging/ebpf.checksums
+++ b/packaging/ebpf.checksums
@@ -1,3 +1,3 @@
-30f6be9ac8d62d1fe1e39e8af9a9298ecc72194605be2748be513467ee057cd1 netdata-kernel-collector-glibc-v0.6.9.tar.xz
-c856c7d48a7bb07f9ab3ea2a4bff06742049f106de8b950ce45019d970393fa1 netdata-kernel-collector-musl-v0.6.9.tar.xz
-4aeb5fcf0dde077691a6377bf824cc830d18dd8efbc06842ad47721c380cc211 netdata-kernel-collector-static-v0.6.9.tar.xz
+eb017acc8d05047190c385412b2e17b63d7ea07d7521ac043d32d14802a9c185 netdata-kernel-collector-glibc-v0.7.0.1.tar.xz
+72bbcb55342a162ab3eab27034e52820dd2a4e5d77dd8b1317f6a6b26904ecb8 netdata-kernel-collector-musl-v0.7.0.1.tar.xz
+d70fc36d09b0e49f4db1c8e328a4b516f21f353eb3bfdd190beae5e403f81aa2 netdata-kernel-collector-static-v0.7.0.1.tar.xz
diff --git a/packaging/ebpf.version b/packaging/ebpf.version
index f992d27341..524e0a2d9f 100644
--- a/packaging/ebpf.version
+++ b/packaging/ebpf.version
@@ -1 +1 @@
-v0.6.9
+v0.7.0.1
diff --git a/web/gui/dashboard_info.js b/web/gui/dashboard_info.js
index e40f067db9..8807548bd4 100644
--- a/web/gui/dashboard_info.js
+++ b/web/gui/dashboard_info.js
@@ -3476,6 +3476,22 @@ netdataDashboard.context = {
info: 'Latency is the time it takes for an event to be completed. Netdata is attaching a kprobe for when the function <code>ext4_sync_file</code> is called and another for when it finishes the execution. We calculate the difference between the calling and return times, we get the logarithmic for the final result and we sum one value to the respective bin. Based on the eBPF <a href="http://www.brendangregg.com/blog/2016-10-06/linux-bcc-ext4dist-ext4slower.html" target="_blank">ext4dist</a> from BCC tools.'
},
+ 'filesystem.xfs_read_latency': {
+ info: 'Latency is the time it takes for an event to be completed. Netdata is attaching a kprobe for when the function <code>xfs_file_read_iter</code> is called and another for when it finishes the execution. We calculate the difference between the calling and return times, we get the logarithmic for the final result and we sum one value to the respective bin. Based on the eBPF <a href="https://github.com/iovisor/bcc/blob/master/tools/xfsdist_example.txt" target="_blank">xfsdist</a> from BCC tools.'
+ },
+
+ 'filesystem.xfs_write_latency': {
+ info: 'Latency is the time it takes for an event to be completed. Netdata is attaching a kprobe for when the function <code>xfs_file_write_iter</code> is called and another for when it finishes the execution. We calculate the difference between the calling and return times, we get the logarithmic for the final result and we sum one value to the respective bin. Based on the eBPF <a href="https://github.com/iovisor/bcc/blob/master/tools/xfsdist_example.txt" target="_blank">xfsdist</a> from BCC tools.'
+ },
+
+ 'filesystem.xfs_open_latency': {
+ info: 'Latency is the time it takes for an event to be completed. Netdata is attaching a kprobe for when the function <code>xfs_file_open</code> is called and another for when it finishes the execution. We calculate the difference between the calling and return times, we get the logarithmic for the final result and we sum one value to the respective bin. Based on the eBPF <a href="https://github.com/iovisor/bcc/blob/master/tools/xfsdist_example.txt" target="_blank">xfsdist</a> from BCC tools.'
+ },
+
+ 'filesystem.xfs_sync_latency': {
+ info: 'Latency is the time it takes for an event to be completed. Netdata is attaching a kprobe for when the function <code>xfs_file_sync</code> is called and another for when it finishes the execution. We calculate the difference between the calling and return times, we get the logarithmic for the final result and we sum one value to the respective bin. Based on the eBPF <a href="https://github.com/iovisor/bcc/blob/master/tools/xfsdist_example.txt" target="_blank">xfsdist</a> from BCC tools.'
+ },
+
// ------------------------------------------------------------------------
// eBPF