summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_sysctl.c16
-rw-r--r--sys/sys/sysctl.h6
2 files changed, 15 insertions, 7 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 8a52dbc9ebf..6da91c97b05 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.69 2002/06/09 04:27:25 angelos Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.70 2002/06/09 05:46:15 art Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -960,11 +960,9 @@ again:
* Fill in an eproc structure for the specified process.
*/
void
-fill_eproc(p, ep)
- register struct proc *p;
- register struct eproc *ep;
+fill_eproc(struct proc *p, struct eproc *ep)
{
- register struct tty *tp;
+ struct tty *tp;
ep->e_paddr = p;
ep->e_sess = p->p_pgrp->pg_session;
@@ -975,13 +973,19 @@ fill_eproc(p, ep)
ep->e_vm.vm_tsize = 0;
ep->e_vm.vm_dsize = 0;
ep->e_vm.vm_ssize = 0;
+ bzero(&ep->e_pstats, sizeof(ep->e_pstats));
+ ep->e_pstats_valid = 0;
} else {
- register struct vmspace *vm = p->p_vmspace;
+ struct vmspace *vm = p->p_vmspace;
+ PHOLD(p); /* need for pstats */
ep->e_vm.vm_rssize = vm_resident_count(vm);
ep->e_vm.vm_tsize = vm->vm_tsize;
ep->e_vm.vm_dsize = vm->vm_dsize;
ep->e_vm.vm_ssize = vm->vm_ssize;
+ ep->e_pstats = *p->p_stats;
+ ep->e_pstats_valid = 1;
+ PRELE(p);
}
if (p->p_pptr)
ep->e_ppid = p->p_pptr->p_pid;
diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h
index b7672171c7b..6bd31f08e3b 100644
--- a/sys/sys/sysctl.h
+++ b/sys/sys/sysctl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysctl.h,v 1.53 2002/06/09 04:26:40 angelos Exp $ */
+/* $OpenBSD: sysctl.h,v 1.54 2002/06/09 05:46:15 art Exp $ */
/* $NetBSD: sysctl.h,v 1.16 1996/04/09 20:55:36 cgd Exp $ */
/*
@@ -51,6 +51,8 @@
#include <sys/proc.h>
#endif
+#include <sys/resourcevar.h> /* XXX */
+
#include <uvm/uvm_extern.h>
/*
@@ -276,6 +278,8 @@ struct kinfo_proc {
struct pcred e_pcred; /* process credentials */
struct ucred e_ucred; /* current credentials */
struct vmspace e_vm; /* address space */
+ struct pstats e_pstats; /* process stats */
+ int e_pstats_valid; /* pstats valid? */
pid_t e_ppid; /* parent process id */
pid_t e_pgid; /* process group id */
short e_jobc; /* job control counter */