summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/alpha/include/param.h4
-rw-r--r--sys/amd64/amd64/mp_machdep.c10
-rw-r--r--sys/amd64/amd64/mptable.c10
-rw-r--r--sys/amd64/include/mptable.h10
-rw-r--r--sys/i386/i386/mp_machdep.c10
-rw-r--r--sys/i386/i386/mptable.c10
-rw-r--r--sys/i386/include/mptable.h10
-rw-r--r--sys/i386/include/param.h4
-rw-r--r--sys/kern/kern_clock.c10
-rw-r--r--sys/kern/kern_tc.c10
-rw-r--r--sys/kern/subr_smp.c10
-rw-r--r--sys/kern/tty.c3
12 files changed, 52 insertions, 49 deletions
diff --git a/sys/alpha/include/param.h b/sys/alpha/include/param.h
index c07ff73..8bed423 100644
--- a/sys/alpha/include/param.h
+++ b/sys/alpha/include/param.h
@@ -1,4 +1,4 @@
-/* $Id: param.h,v 1.6 1998/07/30 08:12:14 dfr Exp $ */
+/* $Id: param.h,v 1.7 1998/09/09 01:21:25 jdp Exp $ */
/* From: NetBSD: param.h,v 1.20 1997/09/19 13:52:53 leo Exp */
/*
@@ -167,6 +167,8 @@
#define alpha_btop(x) ((unsigned long)(x) >> PAGE_SHIFT)
#define alpha_ptob(x) ((unsigned long)(x) << PAGE_SHIFT)
+#define pgtok(x) ((x) * (PAGE_SIZE / 1024))
+
#ifdef _KERNEL
#ifndef _LOCORE
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c
index e353284..7785052 100644
--- a/sys/amd64/amd64/mp_machdep.c
+++ b/sys/amd64/amd64/mp_machdep.c
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.89 1999/01/28 01:59:50 dillon Exp $
+ * $Id: mp_machdep.c,v 1.90 1999/02/19 14:25:32 luoqi Exp $
*/
#include "opt_smp.h"
@@ -2387,10 +2387,10 @@ forwarded_statclock(int id, int pscnt, int *astmap)
if ((pstats = p->p_stats) != NULL &&
(ru = &pstats->p_ru) != NULL &&
(vm = p->p_vmspace) != NULL) {
- ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024;
- ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024;
- ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024;
- rss = vmspace_resident_count(vm) * PAGE_SIZE / 1024;
+ ru->ru_ixrss += pgtok(vm->vm_tsize);
+ ru->ru_idrss += pgtok(vm->vm_dsize);
+ ru->ru_isrss += pgtok(vm->vm_ssize);
+ rss = pgtok(vmspace_resident_count(vm));
if (ru->ru_maxrss < rss)
ru->ru_maxrss = rss;
}
diff --git a/sys/amd64/amd64/mptable.c b/sys/amd64/amd64/mptable.c
index e353284..7785052 100644
--- a/sys/amd64/amd64/mptable.c
+++ b/sys/amd64/amd64/mptable.c
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.89 1999/01/28 01:59:50 dillon Exp $
+ * $Id: mp_machdep.c,v 1.90 1999/02/19 14:25:32 luoqi Exp $
*/
#include "opt_smp.h"
@@ -2387,10 +2387,10 @@ forwarded_statclock(int id, int pscnt, int *astmap)
if ((pstats = p->p_stats) != NULL &&
(ru = &pstats->p_ru) != NULL &&
(vm = p->p_vmspace) != NULL) {
- ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024;
- ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024;
- ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024;
- rss = vmspace_resident_count(vm) * PAGE_SIZE / 1024;
+ ru->ru_ixrss += pgtok(vm->vm_tsize);
+ ru->ru_idrss += pgtok(vm->vm_dsize);
+ ru->ru_isrss += pgtok(vm->vm_ssize);
+ rss = pgtok(vmspace_resident_count(vm));
if (ru->ru_maxrss < rss)
ru->ru_maxrss = rss;
}
diff --git a/sys/amd64/include/mptable.h b/sys/amd64/include/mptable.h
index e353284..7785052 100644
--- a/sys/amd64/include/mptable.h
+++ b/sys/amd64/include/mptable.h
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.89 1999/01/28 01:59:50 dillon Exp $
+ * $Id: mp_machdep.c,v 1.90 1999/02/19 14:25:32 luoqi Exp $
*/
#include "opt_smp.h"
@@ -2387,10 +2387,10 @@ forwarded_statclock(int id, int pscnt, int *astmap)
if ((pstats = p->p_stats) != NULL &&
(ru = &pstats->p_ru) != NULL &&
(vm = p->p_vmspace) != NULL) {
- ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024;
- ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024;
- ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024;
- rss = vmspace_resident_count(vm) * PAGE_SIZE / 1024;
+ ru->ru_ixrss += pgtok(vm->vm_tsize);
+ ru->ru_idrss += pgtok(vm->vm_dsize);
+ ru->ru_isrss += pgtok(vm->vm_ssize);
+ rss = pgtok(vmspace_resident_count(vm));
if (ru->ru_maxrss < rss)
ru->ru_maxrss = rss;
}
diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c
index e353284..7785052 100644
--- a/sys/i386/i386/mp_machdep.c
+++ b/sys/i386/i386/mp_machdep.c
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.89 1999/01/28 01:59:50 dillon Exp $
+ * $Id: mp_machdep.c,v 1.90 1999/02/19 14:25:32 luoqi Exp $
*/
#include "opt_smp.h"
@@ -2387,10 +2387,10 @@ forwarded_statclock(int id, int pscnt, int *astmap)
if ((pstats = p->p_stats) != NULL &&
(ru = &pstats->p_ru) != NULL &&
(vm = p->p_vmspace) != NULL) {
- ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024;
- ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024;
- ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024;
- rss = vmspace_resident_count(vm) * PAGE_SIZE / 1024;
+ ru->ru_ixrss += pgtok(vm->vm_tsize);
+ ru->ru_idrss += pgtok(vm->vm_dsize);
+ ru->ru_isrss += pgtok(vm->vm_ssize);
+ rss = pgtok(vmspace_resident_count(vm));
if (ru->ru_maxrss < rss)
ru->ru_maxrss = rss;
}
diff --git a/sys/i386/i386/mptable.c b/sys/i386/i386/mptable.c
index e353284..7785052 100644
--- a/sys/i386/i386/mptable.c
+++ b/sys/i386/i386/mptable.c
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.89 1999/01/28 01:59:50 dillon Exp $
+ * $Id: mp_machdep.c,v 1.90 1999/02/19 14:25:32 luoqi Exp $
*/
#include "opt_smp.h"
@@ -2387,10 +2387,10 @@ forwarded_statclock(int id, int pscnt, int *astmap)
if ((pstats = p->p_stats) != NULL &&
(ru = &pstats->p_ru) != NULL &&
(vm = p->p_vmspace) != NULL) {
- ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024;
- ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024;
- ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024;
- rss = vmspace_resident_count(vm) * PAGE_SIZE / 1024;
+ ru->ru_ixrss += pgtok(vm->vm_tsize);
+ ru->ru_idrss += pgtok(vm->vm_dsize);
+ ru->ru_isrss += pgtok(vm->vm_ssize);
+ rss = pgtok(vmspace_resident_count(vm));
if (ru->ru_maxrss < rss)
ru->ru_maxrss = rss;
}
diff --git a/sys/i386/include/mptable.h b/sys/i386/include/mptable.h
index e353284..7785052 100644
--- a/sys/i386/include/mptable.h
+++ b/sys/i386/include/mptable.h
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.89 1999/01/28 01:59:50 dillon Exp $
+ * $Id: mp_machdep.c,v 1.90 1999/02/19 14:25:32 luoqi Exp $
*/
#include "opt_smp.h"
@@ -2387,10 +2387,10 @@ forwarded_statclock(int id, int pscnt, int *astmap)
if ((pstats = p->p_stats) != NULL &&
(ru = &pstats->p_ru) != NULL &&
(vm = p->p_vmspace) != NULL) {
- ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024;
- ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024;
- ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024;
- rss = vmspace_resident_count(vm) * PAGE_SIZE / 1024;
+ ru->ru_ixrss += pgtok(vm->vm_tsize);
+ ru->ru_idrss += pgtok(vm->vm_dsize);
+ ru->ru_isrss += pgtok(vm->vm_ssize);
+ rss = pgtok(vmspace_resident_count(vm));
if (ru->ru_maxrss < rss)
ru->ru_maxrss = rss;
}
diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h
index ce00439..41034f2 100644
--- a/sys/i386/include/param.h
+++ b/sys/i386/include/param.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)param.h 5.8 (Berkeley) 6/28/91
- * $Id: param.h,v 1.47 1998/10/13 08:24:37 dg Exp $
+ * $Id: param.h,v 1.48 1999/01/07 06:35:18 peter Exp $
*/
#ifndef _MACHINE_PARAM_H_
@@ -147,4 +147,6 @@
#define i386_btop(x) ((unsigned)(x) >> PAGE_SHIFT)
#define i386_ptob(x) ((unsigned)(x) << PAGE_SHIFT)
+#define pgtok(x) ((x) * (PAGE_SIZE / 1024))
+
#endif /* !_MACHINE_PARAM_H_ */
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c
index cda072a..0b35622 100644
--- a/sys/kern/kern_clock.c
+++ b/sys/kern/kern_clock.c
@@ -37,7 +37,7 @@
* SUCH DAMAGE.
*
* @(#)kern_clock.c 8.5 (Berkeley) 1/21/94
- * $Id: kern_clock.c,v 1.86 1998/11/29 20:31:02 phk Exp $
+ * $Id: kern_clock.c,v 1.87 1999/02/19 14:25:34 luoqi Exp $
*/
#include <sys/param.h>
@@ -469,10 +469,10 @@ statclock(frame)
if ((pstats = p->p_stats) != NULL &&
(ru = &pstats->p_ru) != NULL &&
(vm = p->p_vmspace) != NULL) {
- ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024;
- ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024;
- ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024;
- rss = vmspace_resident_count(vm) * PAGE_SIZE / 1024;
+ ru->ru_ixrss += pgtok(vm->vm_tsize);
+ ru->ru_idrss += pgtok(vm->vm_dsize);
+ ru->ru_isrss += pgtok(vm->vm_ssize);
+ rss = pgtok(vmspace_resident_count(vm));
if (ru->ru_maxrss < rss)
ru->ru_maxrss = rss;
}
diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c
index cda072a..0b35622 100644
--- a/sys/kern/kern_tc.c
+++ b/sys/kern/kern_tc.c
@@ -37,7 +37,7 @@
* SUCH DAMAGE.
*
* @(#)kern_clock.c 8.5 (Berkeley) 1/21/94
- * $Id: kern_clock.c,v 1.86 1998/11/29 20:31:02 phk Exp $
+ * $Id: kern_clock.c,v 1.87 1999/02/19 14:25:34 luoqi Exp $
*/
#include <sys/param.h>
@@ -469,10 +469,10 @@ statclock(frame)
if ((pstats = p->p_stats) != NULL &&
(ru = &pstats->p_ru) != NULL &&
(vm = p->p_vmspace) != NULL) {
- ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024;
- ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024;
- ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024;
- rss = vmspace_resident_count(vm) * PAGE_SIZE / 1024;
+ ru->ru_ixrss += pgtok(vm->vm_tsize);
+ ru->ru_idrss += pgtok(vm->vm_dsize);
+ ru->ru_isrss += pgtok(vm->vm_ssize);
+ rss = pgtok(vmspace_resident_count(vm));
if (ru->ru_maxrss < rss)
ru->ru_maxrss = rss;
}
diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c
index e353284..7785052 100644
--- a/sys/kern/subr_smp.c
+++ b/sys/kern/subr_smp.c
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.89 1999/01/28 01:59:50 dillon Exp $
+ * $Id: mp_machdep.c,v 1.90 1999/02/19 14:25:32 luoqi Exp $
*/
#include "opt_smp.h"
@@ -2387,10 +2387,10 @@ forwarded_statclock(int id, int pscnt, int *astmap)
if ((pstats = p->p_stats) != NULL &&
(ru = &pstats->p_ru) != NULL &&
(vm = p->p_vmspace) != NULL) {
- ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024;
- ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024;
- ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024;
- rss = vmspace_resident_count(vm) * PAGE_SIZE / 1024;
+ ru->ru_ixrss += pgtok(vm->vm_tsize);
+ ru->ru_idrss += pgtok(vm->vm_dsize);
+ ru->ru_isrss += pgtok(vm->vm_ssize);
+ rss = pgtok(vmspace_resident_count(vm));
if (ru->ru_maxrss < rss)
ru->ru_maxrss = rss;
}
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 3b79a98..0f3b365 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)tty.c 8.8 (Berkeley) 1/21/94
- * $Id: tty.c,v 1.113 1999/01/30 12:17:36 phk Exp $
+ * $Id: tty.c,v 1.114 1999/02/19 14:25:34 luoqi Exp $
*/
/*-
@@ -2269,7 +2269,6 @@ ttyinfo(tp)
ttyprintf(tp, "%ld.%02lds ",
stime.tv_sec, stime.tv_usec / 10000);
-#define pgtok(a) (((a) * PAGE_SIZE) / 1024)
/* Print percentage cpu, resident set size. */
tmp = (pick->p_pctcpu * 10000 + FSCALE / 2) >> FSHIFT;
ttyprintf(tp, "%d%% %ldk\n",
OpenPOWER on IntegriCloud