Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/vmstat Have vmstat -H report on vcache_hashtab.
details: https://anonhg.NetBSD.org/src/rev/9573e1693197
branches: trunk
changeset: 967792:9573e1693197
user: ad <ad%NetBSD.org@localhost>
date: Sun Dec 22 17:27:53 2019 +0000
description:
Have vmstat -H report on vcache_hashtab.
diffstat:
usr.bin/vmstat/vmstat.c | 31 ++++++++++++++++++++++++++-----
1 files changed, 26 insertions(+), 5 deletions(-)
diffs (97 lines):
diff -r 627a4eadf012 -r 9573e1693197 usr.bin/vmstat/vmstat.c
--- a/usr.bin/vmstat/vmstat.c Sun Dec 22 17:01:15 2019 +0000
+++ b/usr.bin/vmstat/vmstat.c Sun Dec 22 17:27:53 2019 +0000
@@ -1,7 +1,7 @@
-/* $NetBSD: vmstat.c,v 1.228 2019/09/13 13:56:05 christos Exp $ */
+/* $NetBSD: vmstat.c,v 1.229 2019/12/22 17:27:53 ad Exp $ */
/*-
- * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc.
+ * Copyright (c) 1998, 2000, 2001, 2007, 2019 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation by:
@@ -70,7 +70,7 @@
#if 0
static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 3/1/95";
#else
-__RCSID("$NetBSD: vmstat.c,v 1.228 2019/09/13 13:56:05 christos Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.229 2019/12/22 17:27:53 ad Exp $");
#endif
#endif /* not lint */
@@ -96,6 +96,8 @@
#include <sys/time.h>
#include <sys/queue.h>
#include <sys/kernhist.h>
+#include <sys/vnode.h>
+#include <sys/vnode_impl.h>
#include <uvm/uvm_extern.h>
#include <uvm/uvm_stat.h>
@@ -223,7 +225,11 @@
{ .n_name = "_ncvhash" },
#define X_NCVHASHTBL 13
{ .n_name = "_ncvhashtbl" },
-#define X_HASHNL_SIZE 14 /* must be last */
+#define X_NCVCACHEHASH 14
+ { .n_name = "_vcache_hashmask" },
+#define X_NCVCACHETBL 15
+ { .n_name = "_vcache_hashtab" },
+#define X_HASHNL_SIZE 16 /* must be last */
{ .n_name = NULL },
};
@@ -1842,7 +1848,9 @@
enum hashtype { /* from <sys/systm.h> */
HASH_LIST,
- HASH_TAILQ
+ HASH_SLIST,
+ HASH_TAILQ,
+ HASH_PSLIST
};
struct uidinfo { /* XXX: no kernel header file */
@@ -1880,6 +1888,10 @@
X_UIHASH, X_UIHASHTBL,
HASH_LIST, offsetof(struct uidinfo, ui_hash),
}, {
+ "vnode cache hash",
+ X_NCVCACHEHASH, X_NCVCACHETBL,
+ HASH_SLIST, offsetof(struct vnode_impl, vi_hash),
+ }, {
NULL, -1, -1, 0, 0,
}
};
@@ -1888,6 +1900,7 @@
dohashstat(int verbose, int todo, const char *hashname)
{
LIST_HEAD(, generic) *hashtbl_list;
+ SLIST_HEAD(, generic) *hashtbl_slist;
TAILQ_HEAD(, generic) *hashtbl_tailq;
struct kernel_hash *curhash;
void *hashaddr, *hashbuf, *nhashbuf, *nextaddr;
@@ -1969,14 +1982,22 @@
items = maxchain = 0;
if (curhash->type == HASH_LIST) {
hashtbl_list = hashbuf;
+ hashtbl_slist = NULL;
+ hashtbl_tailq = NULL;
+ } else if (curhash->type == HASH_SLIST) {
+ hashtbl_list = NULL;
+ hashtbl_slist = hashbuf;
hashtbl_tailq = NULL;
} else {
hashtbl_list = NULL;
+ hashtbl_slist = NULL;
hashtbl_tailq = hashbuf;
}
for (i = 0; i < hashsize; i++) {
if (curhash->type == HASH_LIST)
nextaddr = LIST_FIRST(&hashtbl_list[i]);
+ else if (curhash->type == HASH_SLIST)
+ nextaddr = SLIST_FIRST(&hashtbl_slist[i]);
else
nextaddr = TAILQ_FIRST(&hashtbl_tailq[i]);
if (nextaddr == NULL)
Home |
Main Index |
Thread Index |
Old Index