4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2016 by Delphix. All rights reserved.
24 */
25
26 #include <assert.h>
27 #include <sys/zfs_context.h>
28 #include <sys/avl.h>
29 #include <string.h>
30 #include <stdio.h>
31 #include <stdlib.h>
32 #include <sys/spa.h>
33 #include <sys/fs/zfs.h>
34 #include <sys/refcount.h>
35 #include <dlfcn.h>
36
37 /*
38 * Routines needed by more than one client of libzpool.
39 */
40
41 static void
42 show_vdev_stats(const char *desc, const char *ctype, nvlist_t *nv, int indent)
43 {
44 vdev_stat_t *vs;
45 vdev_stat_t v0 = { 0 };
46 uint64_t sec;
47 uint64_t is_log = 0;
48 nvlist_t **child;
49 uint_t c, children;
50 char used[6], avail[6];
51 char rops[6], wops[6], rbytes[6], wbytes[6], rerr[6], werr[6], cerr[6];
52 char *prefix = "";
53
54 if (indent == 0 && desc != NULL) {
55 (void) printf(" "
56 " capacity operations bandwidth ---- errors ----\n");
|
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2016 by Delphix. All rights reserved.
24 * Copyright 2017 RackTop Systems.
25 */
26
27 #include <assert.h>
28 #include <sys/zfs_context.h>
29 #include <sys/avl.h>
30 #include <string.h>
31 #include <stdio.h>
32 #include <stdlib.h>
33 #include <sys/spa.h>
34 #include <sys/fs/zfs.h>
35 #include <sys/refcount.h>
36 #include <dlfcn.h>
37
38 extern void nicenum(uint64_t num, char *buf, size_t);
39
40 /*
41 * Routines needed by more than one client of libzpool.
42 */
43
44 static void
45 show_vdev_stats(const char *desc, const char *ctype, nvlist_t *nv, int indent)
46 {
47 vdev_stat_t *vs;
48 vdev_stat_t v0 = { 0 };
49 uint64_t sec;
50 uint64_t is_log = 0;
51 nvlist_t **child;
52 uint_t c, children;
53 char used[6], avail[6];
54 char rops[6], wops[6], rbytes[6], wbytes[6], rerr[6], werr[6], cerr[6];
55 char *prefix = "";
56
57 if (indent == 0 && desc != NULL) {
58 (void) printf(" "
59 " capacity operations bandwidth ---- errors ----\n");
|