summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorrsc <rsc>2006-09-07 15:45:38 +0000
committerrsc <rsc>2006-09-07 15:45:38 +0000
commitab17e3198be3ae4bf50bf02241c5c1abb3128915 (patch)
tree6603025b78e908076ab4fc89a5e4167bcf8f94f2 /proc.c
parent1542186378ba1c53744d19b3f2c8382976bd5d21 (diff)
downloadxv6-labs-ab17e3198be3ae4bf50bf02241c5c1abb3128915.tar.gz
xv6-labs-ab17e3198be3ae4bf50bf02241c5c1abb3128915.tar.bz2
xv6-labs-ab17e3198be3ae4bf50bf02241c5c1abb3128915.zip
debugging prints
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/proc.c b/proc.c
index 3b7843f..37fd768 100644
--- a/proc.c
+++ b/proc.c
@@ -403,3 +403,19 @@ proc_wait(void)
}
}
+// Print a process listing to console. For debugging.
+// Runs when user types ^P on console.
+// No lock to avoid wedging a stuck machine further.
+void
+procdump(void)
+{
+ int i;
+ struct proc *p;
+
+ for(i = 0; i < NPROC; i++) {
+ p = &proc[i];
+ if(p->state == UNUSED)
+ continue;
+ cprintf("%d %d %p\n", p->pid, p->state);
+ }
+}