]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Seeing negative values for wlentime and rlentime
authorRichard Elling <Richard.Elling@RichardElling.com>
Tue, 11 Dec 2018 21:56:54 +0000 (13:56 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 11 Dec 2018 21:56:54 +0000 (13:56 -0800)
Linux kstat IO and TIMER printed values as signed. However the counters
only increment. Thus humans looking at the data can be confused when
the counters roll over.

Note: The recommended use of these values is to monitor the derivative,
which don't really care about the sign. See explanations related to
non-negative derivatives in the various time-series databases.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Giuseppe Di Natale <guss80@gmail.com>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Richard Elling <Richard.Elling@RichardElling.com>
Closes #8131
Closes #8198

module/spl/spl-kstat.c

index 8683693c8e6735cc047d76a3e1857ff185b60a19..7207a35e04bec2177c55ef71b612cc08f8759884 100644 (file)
@@ -261,9 +261,10 @@ kstat_seq_show_intr(struct seq_file *f, kstat_intr_t *kip)
 static int
 kstat_seq_show_io(struct seq_file *f, kstat_io_t *kip)
 {
+       /* though wlentime & friends are signed, they will never be negative */
        seq_printf(f,
-           "%-8llu %-8llu %-8u %-8u %-8lld %-8lld "
-           "%-8lld %-8lld %-8lld %-8lld %-8u %-8u\n",
+           "%-8llu %-8llu %-8u %-8u %-8llu %-8llu "
+           "%-8llu %-8llu %-8llu %-8llu %-8u %-8u\n",
            kip->nread, kip->nwritten,
            kip->reads, kip->writes,
            kip->wtime, kip->wlentime, kip->wlastupdate,
@@ -277,7 +278,7 @@ static int
 kstat_seq_show_timer(struct seq_file *f, kstat_timer_t *ktp)
 {
        seq_printf(f,
-           "%-31s %-8llu %-8lld %-8lld %-8lld %-8lld %-8lld\n",
+           "%-31s %-8llu %-8llu %-8llu %-8llu %-8llu %-8llu\n",
            ktp->name, ktp->num_events, ktp->elapsed_time,
            ktp->min_time, ktp->max_time,
            ktp->start_time, ktp->stop_time);