From: Richard Elling Date: Tue, 11 Dec 2018 21:56:54 +0000 (-0800) Subject: Seeing negative values for wlentime and rlentime X-Git-Tag: zfs-0.8.0-rc3~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a48cd034c8df96ab751179b0c15bf84c6e178967;p=zfs Seeing negative values for wlentime and rlentime 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 Reviewed-by: Giuseppe Di Natale Reviewed-by: Tony Hutter Signed-off-by: Richard Elling Closes #8131 Closes #8198 --- diff --git a/module/spl/spl-kstat.c b/module/spl/spl-kstat.c index 8683693c8..7207a35e0 100644 --- a/module/spl/spl-kstat.c +++ b/module/spl/spl-kstat.c @@ -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);