2003-04-28 05:43:48 +04:00
|
|
|
# $NetBSD: xps,v 1.5 2003/04/28 01:43:48 briggs 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
|
2003-04-28 05:43:48 +04:00
|
|
|
if ($p != 0)
|
|
|
|
printf "Zombies:\n"
|
|
|
|
end
|
1997-02-13 01:09:45 +03:00
|
|
|
end
|
|
|
|
|
2003-04-28 05:43:48 +04:00
|
|
|
if ($p)
|
|
|
|
printf " proc pid flag nlwps comm\n"
|
|
|
|
printf "\t\t lwp flag wchan\n"
|
|
|
|
end
|
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)
|
2003-04-28 05:43:48 +04:00
|
|
|
printf "\t\t%#08lx %3x %#18lx", \
|
|
|
|
$l, $l->l_flag, $l->l_wchan
|
2003-02-27 00:36:14 +03:00
|
|
|
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
|