This repository has been archived by the owner on Nov 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmemory_nfs_afterbuild.sh
104 lines (85 loc) · 2.29 KB
/
memory_nfs_afterbuild.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash -x
hostname
pwd
### ZIP all the memory report files
if [ -e about-memory.zip ];then
echo "Removing Old Memory Report Files"
rm -f about-memory.zip
fi
cd mtbf_driver
echo "Creating all-about-memory Folder"
mkdir -p all-about-memory
if [ -e about-memory-0 ];then
echo "Moving All The Memory Status Files"
mv about-memory-* all-about-memory
fi
echo "Ziping All The Memory Status File And Removing Folders"
zip -r -9 -u about-memory.zip all-about-memory
rm -rf about-memory-*
rm -rf all-about-memory
pwd
ls
echo "Trying to search for all information needed for zip"
if [ -e b2ginfo0 ];then
rm -f result_b2ginfo.zip
echo "zipping b2ginfo"
zip result_b2ginfo.zip b2ginfo*
rm -f b2ginfo*
fi
if [ -e b2gprocrank0 ];then
rm -f result_b2gprocrank.zip
echo "zipping b2gprocrank"
zip result_b2gprocrank.zip b2gprocrank*
rm -f b2gprocrank*
fi
if [ -e b2gps0 ];then
rm -f result_b2gps.zip
echo "zipping b2gps"
zip result_b2gps.zip b2gps*
rm -f b2gps*
fi
if [ -e bugreport0 ];then
rm -f result_bugreport.zip
echo "zipping bugreport"
zip result_bugreport.zip bugreport*
rm -f bugreport*
fi
if [ -e dmesg0 ];then
rm -f result_dmesg.zip
echo "zipping dmesg"
zip result_dmesg.zip dmesg*
rm -f dmesg*
fi
if [ -e getevent0 ];then
rm -f result_getevent.zip
echo "zipping getevent"
zip result_getevent.zip getevent*
rm -f getevent*
fi
if [ -e logcat0 ];then
rm -f result_logcat.zip
echo "zipping logcat"
zip result_logcat.zip logcat*
rm -f logcat*
fi
### check if we need to kill to get minidump
if [ -z "$GET_MINIDUMP" ] || [ $GET_MINIDUMP ];then
rm *.dmp
### kill b2g to get its crash report
echo "Killing B2G For Getting DMP Files"
B2G_PID=$(adb shell b2g-ps | grep b2g -m 1 | awk -F" " '{print $3}')
echo "B2G pid: $B2G_PID"
adb shell kill -11 $B2G_PID
sleep 30
adb pull /data/b2g/mozilla/Crash\ Reports/pending/ . || echo 0
unzip $WORKSPACE/symbols.zip -d symbols/
### get minidump from minidump_stackwalk
cp /mnt/mtbf_shared/memory_tools/minidump_stackwalk .
for dmpfile in *.dmp
do
adb shell rm /data/b2g/mozilla/Crash\ Reports/pending/$dmpfile
./minidump_stackwalk $dmpfile symbols/ > minidmp_result_$dmpfile.txt
done
rm -rf symbols/
fi
exit $EXIT_STAT