author | darcy |
Wed, 18 Jan 2012 16:43:59 -0800 | |
changeset 11553 | 4389b722f8dc |
parent 9990 | c8683968c01b |
child 12729 | 684b5857e506 |
permissions | -rw-r--r-- |
9990
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
1 |
## |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
2 |
## @test @(#)test6941923.sh |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
3 |
## @bug 6941923 |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
4 |
## @summary test new added flags for gc log rotation |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
5 |
## @author yqi |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
6 |
## @run shell test6941923.sh |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
7 |
## |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
8 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
9 |
## skip on windows |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
10 |
OS=`uname -s` |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
11 |
case "$OS" in |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
12 |
SunOS | Linux ) |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
13 |
NULL=/dev/null |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
14 |
PS=":" |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
15 |
FS="/" |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
16 |
;; |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
17 |
Windows_* ) |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
18 |
echo "Test skipped for Windows" |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
19 |
exit 0 |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
20 |
;; |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
21 |
* ) |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
22 |
echo "Unrecognized system!" |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
23 |
exit 1; |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
24 |
;; |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
25 |
esac |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
26 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
27 |
if [ "${JAVA_HOME}" = "" ] |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
28 |
then |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
29 |
echo "JAVA_HOME not set" |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
30 |
exit 0 |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
31 |
fi |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
32 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
33 |
$JAVA_HOME/bin/java -version > $NULL 2>&1 |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
34 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
35 |
if [ $? != 0 ]; then |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
36 |
echo "Wrong JAVA_HOME? JAVA_HOME: $JAVA_HOME" |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
37 |
exit $? |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
38 |
fi |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
39 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
40 |
# create a small test case |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
41 |
testname="Test" |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
42 |
if [ -e ${testname}.java ]; then |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
43 |
rm -rf ${testname}.* |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
44 |
fi |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
45 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
46 |
cat >> ${testname}.java << __EOF__ |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
47 |
import java.util.Vector; |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
48 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
49 |
public class Test implements Runnable |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
50 |
{ |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
51 |
private boolean _should_stop = false; |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
52 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
53 |
public static void main(String[] args) throws Exception { |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
54 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
55 |
long limit = Long.parseLong(args[0]) * 60L * 1000L; // minutes |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
56 |
Test t = new Test(); |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
57 |
t.set_stop(false); |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
58 |
Thread thr = new Thread(t); |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
59 |
thr.start(); |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
60 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
61 |
long time1 = System.currentTimeMillis(); |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
62 |
long time2 = System.currentTimeMillis(); |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
63 |
while (time2 - time1 < limit) { |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
64 |
try { |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
65 |
Thread.sleep(2000); // 2 seconds |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
66 |
} |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
67 |
catch(Exception e) {} |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
68 |
time2 = System.currentTimeMillis(); |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
69 |
System.out.print("\r... " + (time2 - time1)/1000 + " seconds"); |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
70 |
} |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
71 |
System.out.println(); |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
72 |
t.set_stop(true); |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
73 |
} |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
74 |
public void set_stop(boolean value) { _should_stop = value; } |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
75 |
public void run() { |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
76 |
int cap = 20000; |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
77 |
int fix_size = 2048; |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
78 |
int loop = 0; |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
79 |
Vector< byte[] > v = new Vector< byte[] >(cap); |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
80 |
while(!_should_stop) { |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
81 |
byte[] g = new byte[fix_size]; |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
82 |
v.add(g); |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
83 |
loop++; |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
84 |
if (loop > cap) { |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
85 |
v = null; |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
86 |
cap *= 2; |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
87 |
if (cap > 80000) cap = 80000; |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
88 |
v = new Vector< byte[] >(cap); |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
89 |
} |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
90 |
} |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
91 |
} |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
92 |
} |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
93 |
__EOF__ |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
94 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
95 |
msgsuccess="succeeded" |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
96 |
msgfail="failed" |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
97 |
gclogsize="16K" |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
98 |
filesize=$((16*1024)) |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
99 |
$JAVA_HOME/bin/javac ${testname}.java > $NULL 2>&1 |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
100 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
101 |
if [ $? != 0 ]; then |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
102 |
echo "$JAVA_HOME/bin/javac ${testname}.java $fail" |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
103 |
exit -1 |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
104 |
fi |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
105 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
106 |
# test for 2 minutes, it will complete circulation of gc log rotation |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
107 |
tts=2 |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
108 |
logfile="test.log" |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
109 |
hotspotlog="hotspot.log" |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
110 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
111 |
if [ -e $logfile ]; then |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
112 |
rm -rf $logfile |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
113 |
fi |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
114 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
115 |
#also delete $hotspotlog if it exists |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
116 |
if [ -f $hotspotlog ]; then |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
117 |
rm -rf $hotspotlog |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
118 |
fi |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
119 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
120 |
options="-Xloggc:$logfile -XX:+UseConcMarkSweepGC -XX:+PrintGC -XX:+PrintGCDetails -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=1 -XX:GCLogFileSize=$gclogsize" |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
121 |
echo "Test gc log rotation in same file, wait for $tts minutes ...." |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
122 |
$JAVA_HOME/bin/java $options $testname $tts |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
123 |
if [ $? != 0 ]; then |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
124 |
echo "$msgfail" |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
125 |
exit -1 |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
126 |
fi |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
127 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
128 |
# rotation file will be $logfile.0 |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
129 |
if [ -f $logfile.0 ]; then |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
130 |
outfilesize=`ls -l $logfile.0 | awk '{print $5 }'` |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
131 |
if [ $((outfilesize)) -ge $((filesize)) ]; then |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
132 |
echo $msgsuccess |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
133 |
else |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
134 |
echo $msgfail |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
135 |
fi |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
136 |
else |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
137 |
echo $msgfail |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
138 |
exit -1 |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
139 |
fi |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
140 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
141 |
# delete log file |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
142 |
rm -rf $logfile.0 |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
143 |
if [ -f $hotspotlog ]; then |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
144 |
rm -rf $hotspotlog |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
145 |
fi |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
146 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
147 |
#multiple log files |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
148 |
numoffiles=3 |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
149 |
options="-Xloggc:$logfile -XX:+UseConcMarkSweepGC -XX:+PrintGC -XX:+PrintGCDetails -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=$numoffiles -XX:GCLogFileSize=$gclogsize" |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
150 |
echo "Test gc log rotation in $numoffiles files, wait for $tts minutes ...." |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
151 |
$JAVA_HOME/bin/java $options $testname $tts |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
152 |
if [ $? != 0 ]; then |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
153 |
echo "$msgfail" |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
154 |
exit -1 |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
155 |
fi |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
156 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
157 |
atleast=0 # at least size of numoffile-1 files >= $gclogsize |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
158 |
tk=0 |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
159 |
while [ $(($tk)) -lt $(($numoffiles)) ] |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
160 |
do |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
161 |
if [ -f $logfile.$tk ]; then |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
162 |
outfilesize=`ls -l $logfile.$tk | awk '{ print $5 }'` |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
163 |
if [ $(($outfilesize)) -ge $(($filesize)) ]; then |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
164 |
atleast=$((atleast+1)) |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
165 |
fi |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
166 |
fi |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
167 |
tk=$((tk+1)) |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
168 |
done |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
169 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
170 |
rm -rf $logfile.* |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
171 |
rm -rf $testname.* |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
172 |
rm -rf $hotspotlog |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
173 |
|
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
174 |
if [ $(($atleast)) -ge $(($numoffiles-1)) ]; then |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
175 |
echo $msgsuccess |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
176 |
else |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
177 |
echo $msgfail |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
178 |
exit -1 |
c8683968c01b
6941923: RFE: Handling large log files produced by long running Java Applications
minqi
parents:
diff
changeset
|
179 |
fi |