summaryrefslogtreecommitdiffstats
path: root/usr.bin/vmstat
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2014-08-19 06:50:54 +0000
committersjg <sjg@FreeBSD.org>2014-08-19 06:50:54 +0000
commitd7cd1d425cc1ea9451fa235e3af9b6625c3e0de2 (patch)
treeb04f4bd7cd887f50e7d98af35f46b9834ff86c80 /usr.bin/vmstat
parent3c8e37b1d04827f33c0c9a7594bd1b1ef7cdb3d3 (diff)
parent4fbde208c6460d576f64d6dc3cdc6cab085a4283 (diff)
downloadFreeBSD-src-d7cd1d425cc1ea9451fa235e3af9b6625c3e0de2.zip
FreeBSD-src-d7cd1d425cc1ea9451fa235e3af9b6625c3e0de2.tar.gz
Merge head from 7/28
Diffstat (limited to 'usr.bin/vmstat')
-rw-r--r--usr.bin/vmstat/vmstat.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
index c089dbf..67f438e 100644
--- a/usr.bin/vmstat/vmstat.c
+++ b/usr.bin/vmstat/vmstat.c
@@ -80,7 +80,7 @@ static char da[] = "da";
static struct nlist namelist[] = {
#define X_SUM 0
- { "_cnt" },
+ { "_vm_cnt" },
#define X_HZ 1
{ "_hz" },
#define X_STATHZ 2
@@ -259,8 +259,18 @@ main(int argc, char *argv[])
errx(1, "kvm_openfiles: %s", errbuf);
}
+retry_nlist:
if (kd != NULL && (c = kvm_nlist(kd, namelist)) != 0) {
if (c > 0) {
+ /*
+ * 'cnt' was renamed to 'vm_cnt'. If 'vm_cnt' is not
+ * found try looking up older 'cnt' symbol.
+ * */
+ if (namelist[X_SUM].n_type == 0 &&
+ strcmp(namelist[X_SUM].n_name, "_vm_cnt") == 0) {
+ namelist[X_SUM].n_name = "_cnt";
+ goto retry_nlist;
+ }
warnx("undefined symbols:");
for (c = 0;
c < (int)(sizeof(namelist)/sizeof(namelist[0]));
OpenPOWER on IntegriCloud