summaryrefslogtreecommitdiffstats
path: root/collectors/proc.plugin/proc_spl_kstat_zfs.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-09 04:52:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-09 04:52:57 +0000
commit00151562145df50cc65e9902d52d5fa77f89fe50 (patch)
tree2737716802f6725a5074d606ec8fe5422c58a83c /collectors/proc.plugin/proc_spl_kstat_zfs.c
parentReleasing debian version 1.34.1-1. (diff)
downloadnetdata-00151562145df50cc65e9902d52d5fa77f89fe50.tar.xz
netdata-00151562145df50cc65e9902d52d5fa77f89fe50.zip
Merging upstream version 1.35.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/proc.plugin/proc_spl_kstat_zfs.c')
-rw-r--r--collectors/proc.plugin/proc_spl_kstat_zfs.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/collectors/proc.plugin/proc_spl_kstat_zfs.c b/collectors/proc.plugin/proc_spl_kstat_zfs.c
index fedc03436..fae112249 100644
--- a/collectors/proc.plugin/proc_spl_kstat_zfs.c
+++ b/collectors/proc.plugin/proc_spl_kstat_zfs.c
@@ -11,6 +11,8 @@
extern struct arcstats arcstats;
+unsigned long long zfs_arcstats_shrinkable_cache_size_bytes = 0;
+
int do_proc_spl_kstat_zfs_arcstats(int update_every, usec_t dt) {
(void)dt;
@@ -190,6 +192,12 @@ int do_proc_spl_kstat_zfs_arcstats(int update_every, usec_t dt) {
if(unlikely(arl_check(arl_base, key, value))) break;
}
+ if (arcstats.size > arcstats.c_min) {
+ zfs_arcstats_shrinkable_cache_size_bytes = arcstats.size - arcstats.c_min;
+ } else {
+ zfs_arcstats_shrinkable_cache_size_bytes = 0;
+ }
+
if(unlikely(arcstats.l2exist == -1))
arcstats.l2exist = 0;
@@ -244,7 +252,7 @@ void disable_zfs_pool_state(struct zfs_pool *pool)
pool->disabled = 1;
}
-int update_zfs_pool_state_chart(char *name, void *pool_p, void *update_every_p)
+int update_zfs_pool_state_chart(const char *name, void *pool_p, void *update_every_p)
{
struct zfs_pool *pool = (struct zfs_pool *)pool_p;
int update_every = *(int *)update_every_p;
@@ -290,7 +298,7 @@ int update_zfs_pool_state_chart(char *name, void *pool_p, void *update_every_p)
}
} else {
disable_zfs_pool_state(pool);
- struct deleted_zfs_pool *new = calloc(1, sizeof(struct deleted_zfs_pool));
+ struct deleted_zfs_pool *new = callocz(1, sizeof(struct deleted_zfs_pool));
new->name = strdupz(name);
new->next = deleted_zfs_pools;
deleted_zfs_pools = new;
@@ -400,7 +408,7 @@ int do_proc_spl_kstat_zfs_pool_state(int update_every, usec_t dt)
}
if (do_zfs_pool_state)
- dictionary_get_all_name_value(zfs_pools, update_zfs_pool_state_chart, &update_every);
+ dictionary_walkthrough_read(zfs_pools, update_zfs_pool_state_chart, &update_every);
while (deleted_zfs_pools) {
struct deleted_zfs_pool *current_pool = deleted_zfs_pools;