diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/zpool/zpool_main.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index e00fdb7ae..a13ff5ebd 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -9063,7 +9063,7 @@ print_history_records(nvlist_t *nvhis, hist_cbdata_t *cb) &records, &numrecords) == 0); for (i = 0; i < numrecords; i++) { nvlist_t *rec = records[i]; - char tbuf[30] = ""; + char tbuf[64] = ""; if (nvlist_exists(rec, ZPOOL_HIST_TIME)) { time_t tsec; @@ -9075,6 +9075,14 @@ print_history_records(nvlist_t *nvhis, hist_cbdata_t *cb) (void) strftime(tbuf, sizeof (tbuf), "%F.%T", &t); } + if (nvlist_exists(rec, ZPOOL_HIST_ELAPSED_NS)) { + uint64_t elapsed_ns = fnvlist_lookup_int64(records[i], + ZPOOL_HIST_ELAPSED_NS); + (void) snprintf(tbuf + strlen(tbuf), + sizeof (tbuf) - strlen(tbuf), + " (%lldms)", (long long)elapsed_ns / 1000 / 1000); + } + if (nvlist_exists(rec, ZPOOL_HIST_CMD)) { (void) printf("%s %s", tbuf, fnvlist_lookup_string(rec, ZPOOL_HIST_CMD)); |