Skip to content

Commit

Permalink
zpool iostat tells which rotor vector each vdev is part of.
Browse files Browse the repository at this point in the history
  • Loading branch information
inkdot7 committed Sep 26, 2016
1 parent b5e27a7 commit 717adea
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/zpool/zpool_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2786,6 +2786,8 @@ print_iostat_dashes(iostat_cbdata_t *cb, unsigned int force_column_width,
(void) printf("-");
}

if (!(cb->cb_flags & IOS_ANYHISTO_M))
printf(" -");
if (!(cb->cb_flags & IOS_ANYHISTO_M))
printf(" -");

Expand Down Expand Up @@ -2847,6 +2849,8 @@ print_iostat_header_impl(iostat_cbdata_t *cb, unsigned int force_column_width,
else
printf("%*s", namewidth, "");

if (!(cb->cb_flags & IOS_ANYHISTO_M))
printf(" ");
if (!(cb->cb_flags & IOS_ANYHISTO_M))
printf(" ");

Expand All @@ -2856,6 +2860,8 @@ print_iostat_header_impl(iostat_cbdata_t *cb, unsigned int force_column_width,

if (!(cb->cb_flags & IOS_ANYHISTO_M))
printf("ssd");
if (!(cb->cb_flags & IOS_ANYHISTO_M))
printf(" RV");

print_iostat_labels(cb, force_column_width, iostat_bottom_labels);

Expand Down Expand Up @@ -3374,6 +3380,10 @@ print_vdev_stats(zpool_handle_t *zhp, const char *name, nvlist_t *oldnv,
(void) printf("?");
break;
}
if (newvs->vs_nrotor != (uint64_t) -1)
(void) printf(" %d", (int) newvs->vs_nrotor);
else
(void) printf(" -");
}

/* Calculate our scaling factor */
Expand Down
1 change: 1 addition & 0 deletions include/sys/fs/zfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,7 @@ typedef struct vdev_stat {
uint64_t vs_state; /* vdev state */
uint64_t vs_aux; /* see vdev_aux_t */
uint64_t vs_nonrotational; /* nonrotational */
uint64_t vs_nrotor; /* allocation rotor */
uint64_t vs_alloc; /* space allocated */
uint64_t vs_space; /* total capacity */
uint64_t vs_dspace; /* deflated capacity */
Expand Down
4 changes: 4 additions & 0 deletions module/zfs/vdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2922,6 +2922,10 @@ vdev_get_stats_ex(vdev_t *vd, vdev_stat_t *vs, vdev_stat_ex_t *vsx)
vs->vs_nonrotational = VDEV_NONROTATIONAL_YES;
else
vs->vs_nonrotational = VDEV_NONROTATIONAL_NO;
if (vd->vdev_mg)
vs->vs_nrotor = vd->vdev_mg->mg_nrot;
else
vs->vs_nrotor = -1;
}

ASSERT(spa_config_held(vd->vdev_spa, SCL_ALL, RW_READER) != 0);
Expand Down

0 comments on commit 717adea

Please sign in to comment.