#!/bin/ksh -p
# $Id: //depot/dev/proactive/explorer3/tools/proc#1 $
#
# Explorer Version:
EXP_VERSION=4.0
#

# Source tools functions
. ${EXP_LIB}/exp_tools

# Run if specified to do so
script=${0##*/}
which_gate_exit $script

# Gather pstack and pfiles for each PID on the system
PIDLIST=`echo /proc/*|sed -e "s,/proc/,,g"`;
for PID in $PIDLIST; do
	if [[ `ps -p ${PID} -o fname=` != "dtlogin" ]]
	then
		get_cmd "/usr/bin/pstack $PID"         proc/pstacks/stack.$PID
		get_cmd "/usr/bin/pfiles $PID"         proc/pfiles/files.$PID
	fi
done

