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 12, 2016
1 parent 0e98d5d commit 73fd7f8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd/zpool/zpool_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2780,6 +2780,7 @@ print_iostat_dashes(iostat_cbdata_t *cb, unsigned int force_column_width,
for (i = 0; i < namewidth; i++)
(void) printf("-");
printf(" -");
printf(" -");
}

/* For each bit in flags */
Expand Down Expand Up @@ -2838,15 +2839,15 @@ print_iostat_header_impl(iostat_cbdata_t *cb, unsigned int force_column_width,
if (histo_vdev_name)
printf("%-*s", namewidth, histo_vdev_name);
else
printf("%*s ", namewidth, "");
printf("%*s ", namewidth, "");


print_iostat_labels(cb, force_column_width, iostat_top_labels);

if (histo_vdev_name)
printf("%-*s", namewidth, title);
else
printf("%-*sssd", namewidth, title);
printf("%-*sssd RV", namewidth, title);

print_iostat_labels(cb, force_column_width, iostat_bottom_labels);

Expand Down Expand Up @@ -3361,6 +3362,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 @@ -819,6 +819,7 @@ typedef struct vdev_stat {
uint64_t vs_state; /* vdev state */
uint64_t vs_aux; /* see vdev_aux_t */
uint64_t vs_nonrotary; /* nonrotary */
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 @@ -2907,6 +2907,10 @@ vdev_get_stats_ex(vdev_t *vd, vdev_stat_t *vs, vdev_stat_ex_t *vsx)
vs->vs_nonrotary = VDEV_NONROTARY_YES;
else
vs->vs_nonrotary = VDEV_NONROTARY_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 73fd7f8

Please sign in to comment.