diff --git a/src/zfs_arc.c b/src/zfs_arc.c
index 96ffc54957aae84a8fb548e3df352307a9a9d168..65a50b4e0986b6fc92a123b1dedeaf2cf0484f2c 100644 (file)
--- a/src/zfs_arc.c
+++ b/src/zfs_arc.c
/* 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");
#if __FreeBSD__
za_read_derive (ksp, "allocated","cache_operation", "allocated");
+#if defined(__FreeBSD_version) && (__FreeBSD_version < 1002501)
+ /* stolen removed from sysctl kstat.zfs.misc.arcstats on FreeBSD 10.2+ */
za_read_derive (ksp, "stolen", "cache_operation", "stolen");
+#endif
#endif
/* Issue indicators */