From 510108ba3eb7ef594ec35c4d4cf1d816522a86fd Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 19 Aug 2013 17:04:11 +0200 Subject: [PATCH] zfs_arc plugin: Collect "allocated" and "stolen" on FreeBSD only. The appropriate log messages have been demoted to WARNING. Github: #305 --- src/zfs_arc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/zfs_arc.c b/src/zfs_arc.c index aa900193..cc988625 100644 --- a/src/zfs_arc.c +++ b/src/zfs_arc.c @@ -63,7 +63,7 @@ static int za_read_derive (kstat_t *ksp, const char *kstat_value, tmp = get_kstat_value (ksp, (char *)kstat_value); if (tmp == -1LL) { - ERROR ("zfs_arc plugin: Reading kstat value \"%s\" failed.", kstat_value); + WARNING ("zfs_arc plugin: Reading kstat value \"%s\" failed.", kstat_value); return (-1); } @@ -81,7 +81,7 @@ static int za_read_gauge (kstat_t *ksp, const char *kstat_value, tmp = get_kstat_value (ksp, (char *)kstat_value); if (tmp == -1LL) { - ERROR ("zfs_arc plugin: Reading kstat value \"%s\" failed.", kstat_value); + WARNING ("zfs_arc plugin: Reading kstat value \"%s\" failed.", kstat_value); return (-1); } @@ -123,9 +123,11 @@ static int za_read (void) za_read_gauge (ksp, "l2_size", "cache_size", "L2"); /* Operations */ - za_read_derive (ksp, "allocated","cache_operation", "allocated"); za_read_derive (ksp, "deleted", "cache_operation", "deleted"); +#if __FreeBSD__ + za_read_derive (ksp, "allocated","cache_operation", "allocated"); za_read_derive (ksp, "stolen", "cache_operation", "stolen"); +#endif /* Issue indicators */ za_read_derive (ksp, "mutex_miss", "mutex_operations", "miss"); -- 2.30.2