2003-02-27 00:36:14 +03:00
|
|
|
# $NetBSD: xps,v 1.4 2003/02/26 21:36:14 lha Exp $
|
1997-02-13 02:35:06 +03:00
|
|
|
|
1997-02-13 01:09:45 +03:00
|
|
|
# xps
|
|
|
|
# kernel ps
|
|
|
|
#
|
|
|
|
# @(#)xps 8.3 (Berkeley) 8/22/94
|
|
|
|
|
|
|
|
define xps
|
|
|
|
|
|
|
|
set $i = 0
|
|
|
|
|
|
|
|
while ($i < 2)
|
|
|
|
|
|
|
|
if ($i == 0)
|
|
|
|
set $p = allproc.lh_first
|
|
|
|
end
|
|
|
|
if ($i == 1)
|
|
|
|
set $p = zombproc.lh_first
|
|
|
|
end
|
|
|
|
|
2003-02-27 00:36:14 +03:00
|
|
|
printf " proc pid flag nlwps comm\n"
|
|
|
|
printf "\t flag wchan\n"
|
1997-02-13 01:09:45 +03:00
|
|
|
while ($p)
|
2003-02-27 00:36:14 +03:00
|
|
|
printf "%#18lx %5d %8x %2x %d %s", \
|
|
|
|
$p, $p->p_pid, \
|
|
|
|
$p->p_flag, $p->p_stat, $p->p_nlwps, \
|
1997-02-13 01:09:45 +03:00
|
|
|
(char *) $p->p_comm
|
|
|
|
printf "\n"
|
2003-02-27 00:36:14 +03:00
|
|
|
set $l = $p->p_lwps.lh_first
|
|
|
|
set $j = 0
|
|
|
|
while ($j < $p->p_nlwps)
|
|
|
|
printf "\t%3x %#18xl", $l->l_flag, $l->l_wchan
|
|
|
|
if ($l->l_wmesg)
|
|
|
|
printf " (%s)", (char *)$l->l_wmesg
|
|
|
|
end
|
|
|
|
set $l = $l->l_list.le_next
|
|
|
|
printf "\n"
|
|
|
|
set $j++
|
|
|
|
end
|
1997-02-13 01:09:45 +03:00
|
|
|
set $p = $p->p_list.le_next
|
|
|
|
end
|
|
|
|
set $i++
|
|
|
|
end
|
|
|
|
end
|