diff --git a/src/zfs_arc.c b/src/zfs_arc.c
index 168d566bb47ff406f0deb183c5c9d7550211e969..f0d23239a82ab158c03c669f9a96cf2fc7f8dd24 100644 (file)
--- a/src/zfs_arc.c
+++ b/src/zfs_arc.c
{
llentry_t *e;
llvalues = malloc(sizeof(long long int) * i);
- i = 0;
+ int j = 0;
pnl = file_contents;
while (pnl != NULL)
numfields = strsplit (pnl, fields, 4);
if (numfields == 3)
{
- llvalues[i] = atoll (fields[2]);
+ llvalues[j] = atoll (fields[2]);
- e = llentry_create (fields[0], &llvalues[i]);
+ e = llentry_create (fields[0], &llvalues[j]);
if (e == NULL)
{
ERROR ("zfs_arc plugin: `llentry_create' failed.");
{
llist_append (ksp, e);
}
+ j++;
}
pnl = pnnl;
if (pnl != NULL)
/* 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");