source: gpfs_3.1_ker2.6.20/lpp/mmfs/bin/mmdumpkthreads @ 16

Last change on this file since 16 was 16, checked in by rock, 16 years ago
  • Property svn:executable set to *
File size: 3.5 KB
Line 
1#!/bin/ksh
2# IBM_PROLOG_BEGIN_TAG
3# This is an automatically generated prolog.
4
5
6
7# Licensed Materials - Property of IBM
8
9# (C) COPYRIGHT International Business Machines Corp. 2001,2006
10# All Rights Reserved
11
12# US Government Users Restricted Rights - Use, duplication or
13# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
14
15# IBM_PROLOG_END_TAG
16# @(#)20 1.6.1.2 src/avs/fs/mmfs/ts/admin/mmdumpkthreads.sh, mmfs, avs_rgpfs24, rgpfs24s007a 10/19/06 18:09:18
17##########################################################################
18#
19#  Dump information about the kernel threads.
20#
21#  Usage:  mmdumpkthreads [dump [kernelfile]]
22#
23#  where
24#    dump         is the system image file.
25#
26#    kernelfile   is a file with the kernel symbol definititions.
27#
28##########################################################################
29
30sourceFile="mmdumpkthreads.sh"
31[[ -n $DEBUG || -n $DEBUGmmdumpkthreads ]] && set -x
32
33crash=/usr/sbin/crash
34kdb=/usr/sbin/kdb
35lcrash=/sbin/lcrash
36osName=$(/bin/uname -s)
37if [[ -x $SHARKCLONEROOT/kernext/gpl-linux/kdump ]]
38then
39  kdump=$SHARKCLONEROOT/kernext/gpl-linux/kdump
40elif [[ -x /usr/lpp/mmfs/src/gpl-linux/kdump ]]
41then
42  kdump=/usr/lpp/mmfs/src/gpl-linux/kdump
43elif [[ -x /usr/lpp/mmfs/kernext/gpl-linux/kdump ]]
44then
45  kdump=/usr/lpp/mmfs/kernext/gpl-linux/kdump
46fi
47
48if [[ $1 = '-?' || $1 = '-h' || $1 = '--help' || $1 = '--' ]]
49then
50  print -u2 "Usage:  mmdumpkthreads [dump [kernelfile]]"
51  exit 1
52fi
53
54if [[ -x $lcrash ]]
55then                               # Linux lcrash debugger
56
57  print "task"  |  $lcrash                                 |      \
58    /bin/awk '                                                    \
59      /^\s*0x[a-f0-9]+/ {                                         \
60        print "task ", $1;                                        \
61        print "bt ", $1;                                          \
62      }                                                           \
63      END {                                                       \
64        print "quit";                                             \
65      }                                                           \
66    '                                                      |      \
67    $lcrash
68
69elif [[ $osName = Linux ]]
70then
71  ps axuwww
72  [[ $kdump != "" ]] && print "bta" | $kdump /var/mmfs/tmp/complete.map.latest
73elif [[ -x $crash ]]
74then                               # AIX pre-rel5 crash debugger
75
76  print "th"  |  $crash $1 $2 2>/dev/null                  |      \
77    /usr/bin/awk '                                                \
78      /^[ ]*[0-9]+ / {                                            \
79        print "th", $1;                                           \
80        print "t -k", $1;                                         \
81      }                                                           \
82    '                                                      |      \
83    $crash $1 $2 2> /dev/null
84
85else                               # AIX rel5 kdb debugger
86
87  print "th *"  |  $kdb $1 $2 2>/dev/null  |
88    /usr/bin/awk '{
89      if ($1=="SLOT") {
90        ok=1;
91        getline;
92      } else if (ok==1 && $2 != "") {
93        print "th", $2+0;
94        print "where", $2+0;
95      }
96    }'                                     |
97
98    $kdb $1 $2 2> /dev/null                |
99
100    /usr/bin/awk ' /SLOT NAME/ {
101      print ""; print $0; getline; if (NF==0) getline; print $0
102      while (getline && index($0,"> where ") <= 0) x++
103      print $0; getline
104      while (getline && index($0,"> th ") <= 0) print $0
105    }'
106
107fi
108
109exit 0
110
Note: See TracBrowser for help on using the repository browser.