FreeBSD/Linux Kernel Cross Reference
sys/gdbscripts/xps
1 # $NetBSD: xps,v 1.5 2003/04/28 01:43:48 briggs Exp $
2
3 # xps
4 # kernel ps
5 #
6 # @(#)xps 8.3 (Berkeley) 8/22/94
7
8 define xps
9
10 set $i = 0
11
12 while ($i < 2)
13
14 if ($i == 0)
15 set $p = allproc.lh_first
16 end
17 if ($i == 1)
18 set $p = zombproc.lh_first
19 if ($p != 0)
20 printf "Zombies:\n"
21 end
22 end
23
24 if ($p)
25 printf " proc pid flag nlwps comm\n"
26 printf "\t\t lwp flag wchan\n"
27 end
28 while ($p)
29 printf "%#18lx %5d %8x %2x %d %s", \
30 $p, $p->p_pid, \
31 $p->p_flag, $p->p_stat, $p->p_nlwps, \
32 (char *) $p->p_comm
33 printf "\n"
34 set $l = $p->p_lwps.lh_first
35 set $j = 0
36 while ($j < $p->p_nlwps)
37 printf "\t\t%#08lx %3x %#18lx", \
38 $l, $l->l_flag, $l->l_wchan
39 if ($l->l_wmesg)
40 printf " (%s)", (char *)$l->l_wmesg
41 end
42 set $l = $l->l_list.le_next
43 printf "\n"
44 set $j++
45 end
46 set $p = $p->p_list.le_next
47 end
48 set $i++
49 end
50 end
Cache object: cf574cbe2927bc2341e4a518e7137072
|