Module Name: src
Committed By: christos
Date: Sat Dec 25 20:50:36 UTC 2010
Modified Files:
src/usr.bin/vmstat: vmstat.c
Log Message:
use a local definition of cpu_info if we have __HAVE_CPU_DATA_FIRST
To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/usr.bin/vmstat/vmstat.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.173 src/usr.bin/vmstat/vmstat.c:1.174
--- src/usr.bin/vmstat/vmstat.c:1.173 Sat Dec 25 09:18:37 2010
+++ src/usr.bin/vmstat/vmstat.c Sat Dec 25 15:50:36 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.173 2010/12/25 14:18:37 christos Exp $ */
+/* $NetBSD: vmstat.c,v 1.174 2010/12/25 20:50:36 christos Exp $ */
/*-
* Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@@ -70,13 +70,14 @@
#if 0
static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 3/1/95";
#else
-__RCSID("$NetBSD: vmstat.c,v 1.173 2010/12/25 14:18:37 christos Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.174 2010/12/25 20:50:36 christos Exp $");
#endif
#endif /* not lint */
#define __POOL_EXPOSE
#include <sys/param.h>
+#include <sys/types.h>
#include <sys/mount.h>
#include <sys/uio.h>
@@ -130,6 +131,18 @@
#include "drvstats.h"
/*
+ * All this mess will go away once everything is converted.
+ */
+#ifdef __HAVE_CPU_DATA_FIRST
+#include <sys/cpu_data.h>
+struct xcpu_info {
+ struct cpu_data ci_data;
+};
+# define CPU_INFO xcpu_info
+#else
+# define CPU_INFO cpu_info
+#endif
+/*
* General namelist
*/
struct nlist namelist[] =
@@ -247,6 +260,7 @@
kvm_t *kd;
+
#define FORKSTAT 1<<0
#define INTRSTAT 1<<1
#define MEMSTAT 1<<2
@@ -975,10 +989,10 @@
void
cpucounters(struct cpu_counter *cc)
{
- struct cpu_info *ci;
+ struct CPU_INFO *ci;
(void)memset(cc, 0, sizeof(*cc));
CIRCLEQ_FOREACH(ci, &cpu_queue, ci_data.cpu_qchain) {
- struct cpu_info tci;
+ struct CPU_INFO tci;
if ((size_t)kvm_read(kd, (u_long)ci, &tci, sizeof(tci))
!= sizeof(tci)) {
warnx("Can't read cpu info from %p (%s)",