BACKRUSH  À¯´Ð½º¸í·É  ´ÙÀ½  ÀÚ·á½Ç  Ascii Table   ¿ø°ÝÁ¢¼Ó  ´Þ·Â,½Ã°£   ÇÁ·Î¼¼½º   ½©
ÁöÇÏö³ë¼±   RFC¹®¼­   SUN FAQ   SUN FAQ1   C¸Þ´º¾ó   PHP¸Þ´º¾ó   ³Ê±¸¸®   ¾Æ½ºÅ°¿ùµå ¾ÆÀÌÇǼ­Ä¡

±Û¾´ÀÌ: vmcore vmcoreºÐ¼®Åø Á¶È¸¼ö: 8070


#!/bin/sh
#
# iscda -- Script to print out Initial System Crash Dump Analysis
#
# History:
#
# Edit 1 940719 krb First script for Solaris 2.3, Rev 1.0
# Edit 2 960311 df Updated for Solaris 2.4, 2.5, Rev 2.0
#
#
# Files this script creates:
#
# /tmp/iscda.{pid} An adb macro which finds name of process
# running on each CPU.
#
# Notes:
#
# This script must be run on the same kernel architecture and
# under the same OS as the system crash dump we are analyzing.
#
# ----------------------------------------------------------------------

if [ ! $# = 2 ]
then
echo
echo "Usage: iscda unixfile corefile > your-output-file"
echo
echo "Examples: iscda unix.3 vmcore.3"
echo " iscda /dev/ksyms /dev/mem"
echo
exit
fi

#
# Make sure we can see the files.
#
if [ ! -f $1 ] && [ ! $1 = "/dev/ksyms" ]
then
echo; echo "Unable to locate $1. Exiting."
echo; exit
fi
if [ ! -f $2 ] && [ ! $2 = "/dev/mem" ]
then
echo; echo "Unable to locate $2. Exiting."
echo; exit
fi


#
# Okay, we are ready! Create and put some stuff into output file.
#
echo "Working....."
cat <<EOC

******************************************************************************
Initial System Crash Dump Analysis Output iscda Rev 1.0
`date`
******************************************************************************

EOC


#
# We will be creating our own macros for use in adb sessions.
# Odds are we will create a unique filename if we use the PID.
# If it is not unique, let the user do something about it.
#
WHERE=/tmp/iscda.$$
if [ -f $WHERE ]
then
echo; echo "File $WHERE already exists. Exiting."
echo; exit
fi

cat > $WHERE <<EOC
*(<c+0t28)>n
<c+8/X"Thread address"
*(<c+8)>p
<p+a0/X"Proc address"
*(<p+a0)>j
<j+260/s
.,#((*(<c+8))-(*(<c+c)))="This CPU was idle"
0,#(#(<n))&#(#(<n-<e))=n"Next CPU..."n
<n>c
<n,#(#(<n))&#(#(<n-<e))$<$WHERE
EOC


#
# Get initial information from adb
#
cat <<EOC
************************************
** Initial information from adb **
************************************

EOC

adb -k $1 $2 <<EOA
$<utsname
srpc_domain/s16t"Domain name"
lbolt>a
*time-(*<a%0t100)=Y16t"Time of boot"
time/Y16t"Time of crash"
,#(*audit_active)=n"Auditing is not enabled"
,##(*audit_active)=n"Auditing is enabled"
,#(*quotas_initialized)=n"Quotas are not enabled"
,##(*quotas_initialized)=n"Quotas are enabled"
=nn"** Panic String **"
="--------------------"
*panicstr/s
=nn"** Stack Backtrace **"
="-----------------------"
\$c
=nn"** Per CPU information **"
="---------------------------"
ncpus/X"# of CPUs present"
ncpus_online/X"# of CPUs online"
=nn
*cpu_list>c
<c>e
<c,#(<c)="The cpu_list pointer is NULL. Not a good sign."n
<c,#(#(<c))$<$WHERE
=nn"** Calltrace **"
="-----------------"
<sp$<calltrace
=nn
="** CPU structures **"
="--------------------"
$<cpus
=nn
="** Msgbuf **"
="------------"
$<msgbuf
EOA

#
# Get process information by using crash.
#
cat <<EOC


**************************************
** Process information from crash **
**************************************

EOC
crash $2 $1 <<EOC
p -e
EOC


#
#
# Get strings output to capture message buffer.
#
cat <<EOC



******************************************************
** Strings output of complete message ring buffer **
******************************************************

EOC
strings $2 | head -200


#
# Additional adb stuff
#
cat <<EOC

***********************
** Some Statistics **
***********************

EOC
adb -k $1 $2 <<EOA
=nn"** Directory Name Lookup Cache Statistics **"
="----------------------------------------------"
ncsize/D"Directory name cache size"
ncstats/D"# of cache hits that we used"
+/D"# of misses"
+/D"# of enters done"
+/D"# of enters tried when already cached"
+/D"# of long names tried to enter"
+/D"# of long name tried to look up"
+/D"# of times LRU list was empty"
+/D"# of purgesof cache"
0t100-(((*(ncstats+4))*0t100)(*ncstats+(*(ncstats+4))))=D"Hit Rate Percentage"
="(See /usr/include/sys/dnlc.h for more information)"
=nn"** Streams Statistics **"
="--------------------------"
="In use"16t"Total"16t"Maximum"16t"Failures"
strst/4X"Streams"
+/4X"Queues"
+/4X"MsgBlks"
+/4X"LinkBlks"
="(See /usr/include/sys/strstat.h for more information)"
EOA

cat << EOC

** Kernel Memory Statistics **
--------------------------------
EOC

crash $2 $1 <<EOC
kmastat
EOC


#
# Print out some of the tunable variables. Do this via macros
# so that we don't get alot of symbol not found messages if
# the driver was not modloaded for use.
#
cat > $WHERE <<EOC
=nn"** Shared Memory Tuning Variables (if in use) **"
="--------------------------------------------------"
shminfo_shmmax/D"Max segment size"
+/D"Min segment size"
+/D"Max identifiers"
+/D"Max attached shm segs per proc"
EOC

adb -k $1 $2 <<EOA
$<$WHERE
EOA

cat > $WHERE <<EOC
=nn"** Semaphore Tuning Variables (if in use) **"
="----------------------------------------------"
seminfo_semmap/D"Entries per map"
+/D"Max identifiers"
+/D"Max in system"
+/D"Max undos"
+/D"Max sems per id"
+/D"Max ops per semop"
+/D"Max undos per proc"
+/D"Max bytes in undos"
+/D"Max sem value"
+/D"Max adjust on exit"
EOC

adb -k $1 $2 <<EOA
$<$WHERE
EOA

cat > $WHERE <<EOC
=nn"** Message Queue Tuning Variables (if in use) **"
="--------------------------------------------------"
msginfo_msgmap/D"Max entries in map"
+/D"Max message size"
+/D"Max bytes on queue"
+/D"Max msg queue ids"
+/D"Max segment size (word size multiple)"
+/D"Max system message headers"
+/d16t"Max msg segments (must be < 32768)"
EOC

adb -k $1 $2 <<EOA
$<$WHERE
EOA



cat <<EOC


+--------------------------------------------------------------------+
| For more information about system crash dump analysis, refer to |
| the SunSoft Press book, "Panic! System Crash Dump Analysis," |
| ISBN 0-13-149386-8, to be published Winter 1994 by Prentice Hall. |
+--------------------------------------------------------------------+

EOC

rm $WHERE
echo "Done!"
#
# end of iscda
#

°ü·Ã±Û : ¾øÀ½ ±Û¾´½Ã°£ : 2003/01/10 11:26 from 211.108.145.236

  [SUN]openwin ¾È¶ã¶§ ¸ñ·Ïº¸±â »õ±Û ¾²±â Áö¿ì±â ÀÀ´ä±Û ¾²±â ±Û ¼öÁ¤ ¼¼°è IP ºÐÆ÷µµ  
BACKRUSH  À¯´Ð½º¸í·É  ´ÙÀ½  ÀÚ·á½Ç  Ascii Table   ¿ø°ÝÁ¢¼Ó  ´Þ·Â,½Ã°£   ÇÁ·Î¼¼½º   ½©
ÁöÇÏö³ë¼±   RFC¹®¼­   SUN FAQ   SUN FAQ1   C¸Þ´º¾ó   PHP¸Þ´º¾ó   ³Ê±¸¸®   ¾Æ½ºÅ°¿ùµå ¾ÆÀÌÇǼ­Ä¡