• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh -x
2
3conf=${1}; shift
4vmcore=${1}; shift
5crash=${1}; shift
6
7. "${conf}"
8
9echo ""
10echo "----------------------------------------------------------"
11echo "                        VMCORE SIZE                       "
12echo "----------------------------------------------------------"
13echo ""
14
15ls -lh "${vmcore}"
16
17echo ""
18echo "----------------------------------------------------------"
19echo "                        READELF                           "
20echo "----------------------------------------------------------"
21echo ""
22
23readelf -a "${vmcore}"
24
25if [ "${crash}" -eq 1 ]; then
26    echo ""
27    echo "----------------------------------------------------------"
28    echo "                        CRASH                             "
29    echo "----------------------------------------------------------"
30    echo ""
31
32    cat <<EOF >crash_cmd
33mod
34mod -S
35runq
36foreach bt
37foreach files
38mount
39mount -f
40mount -i
41vm
42ascii
43net
44set
45set -v
46bt
47bt -a
48bt -f
49bt -e
50bt -E
51ps
52ps -k
53ps -u
54ps -s
55dev
56dev -p
57kmem -i
58kmem -s
59task
60exit
61EOF
62
63    crash -i crash_cmd "${VMLINUX}" "${vmcore}"
64    rm -f crash_cmd
65fi
66