"[-R root] [-F [-n]]\n"
"\t <pool | id> [newpool]\n"));
case HELP_IOSTAT:
- return (gettext("\tiostat [-v] [-T d|u] [pool] ... [interval "
- "[count]]\n"));
+ return (gettext("\tiostat [-v] [-T d|u] [-y] [pool] ... "
+ "[interval [count]]\n"));
case HELP_LABELCLEAR:
return (gettext("\tlabelclear [-f] <vdev>\n"));
case HELP_LIST:
unsigned long interval = 0, count = 0;
zpool_list_t *list;
boolean_t verbose = B_FALSE;
+ boolean_t omit_since_boot = B_FALSE;
iostat_cbdata_t cb;
/* check options */
- while ((c = getopt(argc, argv, "T:v")) != -1) {
+ while ((c = getopt(argc, argv, "T:vy")) != -1) {
switch (c) {
case 'T':
get_timestamp_arg(*optarg);
case 'v':
verbose = B_TRUE;
break;
+ case 'y':
+ omit_since_boot = B_TRUE;
+ break;
case '?':
(void) fprintf(stderr, gettext("invalid option '%c'\n"),
optopt);
cb.cb_namewidth = 0;
for (;;) {
- pool_list_update(list);
-
if ((npools = pool_list_count(list)) == 0)
(void) fprintf(stderr, gettext("no pools available\n"));
else {
+ /*
+ * If this is the first iteration and -y was supplied
+ * we skip any printing.
+ */
+ boolean_t skip = (omit_since_boot &&
+ cb.cb_iteration == 0);
+
/*
* Refresh all statistics. This is done as an
* explicit step before calculating the maximum name
print_timestamp(timestamp_fmt);
/*
- * If it's the first time, or verbose mode, print the
- * header.
+ * If it's the first time and we're not skipping it,
+ * or either skip or verbose mode, print the header.
*/
- if (++cb.cb_iteration == 1 || verbose)
+ if ((++cb.cb_iteration == 1 && !skip) ||
+ (skip != verbose))
print_iostat_header(&cb);
+ if (skip) {
+ (void) sleep(interval);
+ continue;
+ }
+
(void) pool_list_iter(list, B_FALSE, print_iostat, &cb);
/*
.LP
.nf
-\fBzpool iostat\fR [\fB-T\fR d | u ] [\fB-v\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]
+\fBzpool iostat\fR [\fB-T\fR d | u ] [\fB-v\fR] [\fB-y\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]
.fi
.LP
.ne 2
.mk
.na
-\fB\fBzpool iostat\fR [\fB-T\fR \fBd\fR | \fBu\fR] [\fB-v\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]\fR
+\fB\fBzpool iostat\fR [\fB-T\fR \fBd\fR | \fBu\fR] [\fB-v\fR] [\fB-y\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]\fR
.ad
.sp .6
.RS 4n
Verbose statistics. Reports usage statistics for individual \fIvdevs\fR within the pool, in addition to the pool-wide statistics.
.RE
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-y\fR\fR
+.ad
+.RS 12n
+.rt
+Omit statistics since boot. Normally the first line of output reports the statistics since boot. This option suppresses that first line of output.
+.RE
+
.RE
.sp