From: Jan Andres Date: Wed, 28 Jan 2015 14:06:04 +0000 (+0100) Subject: zfs_arc: Don't spam the log if we fail to read the "l2_size" kstat value. X-Git-Tag: collectd-5.5.0~12^2~4^2~5 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=0ae43c418801b406f08de47fb467223cf5781669;p=collectd.git zfs_arc: Don't spam the log if we fail to read the "l2_size" kstat value. The value got lost with some patch to Solaris 10 and has only reappeared recently in 11.2. If we ever fail to read this value, stop trying, so we don't report an error on every interval. --- diff --git a/src/zfs_arc.c b/src/zfs_arc.c index cc988625..311a7181 100644 --- a/src/zfs_arc.c +++ b/src/zfs_arc.c @@ -120,7 +120,14 @@ static int za_read (void) /* Sizes */ za_read_gauge (ksp, "size", "cache_size", "arc"); - za_read_gauge (ksp, "l2_size", "cache_size", "L2"); + + /* The "l2_size" value has disappeared from Solaris some time in + * early 2013, and has only reappeared recently in Solaris 11.2. + * Stop trying if we ever fail to read it, so we don't spam the log. + */ + static int l2_size_avail = 1; + if (l2_size_avail && za_read_gauge (ksp, "l2_size", "cache_size", "L2") != 0) + l2_size_avail = 0; /* Operations */ za_read_derive (ksp, "deleted", "cache_operation", "deleted");