#!/bin/ksh #set -xv # Author: Gopinath Rao # Developer Technical Support # Sun Microsystems Inc # # Description: # adv_analysis() called when the advanced analysis option is chosen # on startup # Function performs advanced crash dump analysis # It calls basic_analysis() to do a basic analysis first adv_analysis() { basic_analysis mdb -k $g <memleaks.txt =nn"Findleaks output" ="-----------------" ::findleaks EOA fi fi panicstring=`echo "*panicstr/s" | mdb -k unix.$g vmcore.$g | cut -f2 -d":"` if [ "$panicstring" = "zero" ] then mdb -k $g <threadlist.txt =nn"Threadlist output" ="------------------" \$ outfile.`date |cut -f4 -d" "` } # # Description: # basic_analysis() called when the advanced analysis option is chosen # on startup # Function performs basic crash dump analysis basic_analysis() { echo "Working....." cat < outfile.`date |cut -f4 -d" "` echo "" echo "Done!" elif [ "$n" = "a" ] then special_cases echo "" echo "Done!" fi ;; 2) echo -n "Enter the binary name which generated the core:" read bin echo -n "Enter the core file name:" read cor if [ `uname -r | cut -f2 -d"."` -lt 9 ] then echo "OS release needs to be Solaris 5.9 to use this option, Aborting !" exit fi appcore_analysis > outfile.appcore thr_model=`echo "::status" | mdb $bin $cor | grep thread | cut -f2 -d":"` if [ "$thr_model" = " multi-threaded" ] then mdb $bin $cor <>outfile.appcore =nn"Thread stack for MT app" ="------------------------" ::walk thread | ::findstack EOA fi echo "Done!" ;; 3) echo "Bye !" exit;; *) echo "Invalid selection - Aborting !" ;; esac else # Take parameters from command-line case "$1" in 2) bin=$2 cor=$3 appcore_analysis thr_model=`echo "::status" | mdb $bin $cor | grep thread | cut -f2 -d":"` if [ "$thr_model" = " multi-threaded" ] then mdb $bin $cor 2>/dev/null <