Skip to content

Commit f4f31a3

Browse files
committed
Make test log more verbose
Change-Id: I867d37a11e26e2cfde9cacda97bdbe51a8905ef1
1 parent f54945e commit f4f31a3

File tree

1 file changed

+32
-6
lines changed

1 file changed

+32
-6
lines changed

tests/test.sh

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,31 @@ export BIN_DIR="build/bin"
44

55
pushd $BIN_DIR
66

7-
# enable NMI watchdog
7+
echo Enable NMI watchdog
88
echo 1 > /proc/sys/kernel/nmi_watchdog
99

10+
echo Testing pcm with PCM_NO_PERF=1
1011
PCM_NO_PERF=1 ./pcm -r -- sleep 1
1112
if [ "$?" -ne "0" ]; then
1213
echo "Error in pcm"
1314
exit 1
1415
fi
1516

17+
echo Testing pcm with PCM_USE_UNCORE_PERF=1
1618
PCM_USE_UNCORE_PERF=1 ./pcm -r -- sleep 1
1719
if [ "$?" -ne "0" ]; then
1820
echo "Error in pcm"
1921
exit 1
2022
fi
2123

24+
echo Testing pcm w/o env vars
2225
./pcm -r -- sleep 1
2326
if [ "$?" -ne "0" ]; then
2427
echo "Error in pcm"
2528
exit 1
2629
fi
2730

31+
echo Testing pcm with -pid
2832
perl -e ' do {} until (0)' &
2933
test_pid="$!"
3034
./pcm -pid $test_pid -- sleep 1
@@ -35,108 +39,126 @@ if [ "$?" -ne "0" ]; then
3539
fi
3640
kill $test_pid
3741

42+
echo Testing pcm with PCM_KEEP_NMI_WATCHDOG=1
3843
PCM_KEEP_NMI_WATCHDOG=1 ./pcm -r -- sleep 1
3944
if [ "$?" -ne "0" ]; then
4045
echo "Error in pcm"
4146
exit 1
4247
fi
4348

49+
echo Testing pcm with -csv
4450
./pcm -r 0.1 -csv=pcm.csv -- sleep 5
4551
if [ "$?" -ne "0" ]; then
4652
echo "Error in pcm"
4753
exit 1
4854
fi
4955

56+
echo Testing pcm-memory
5057
./pcm-memory -- sleep 1
5158
if [ "$?" -ne "0" ]; then
5259
echo "Error in pcm-memory"
5360
exit 1
5461
fi
5562

63+
echo Testing pcm-memory with -rank
5664
./pcm-memory -rank=1 -- sleep 1
5765
if [ "$?" -ne "0" ]; then
5866
echo "Error in pcm-memory"
5967
exit 1
6068
fi
6169

70+
echo Testing pcm-memory with -rank and -csv
6271
./pcm-memory -rank=1 -csv -- sleep 1
6372
if [ "$?" -ne "0" ]; then
6473
echo "Error in pcm-memory"
6574
exit 1
6675
fi
6776

77+
echo Testing pcm-iio
6878
./pcm-iio -i=1
6979
if [ "$?" -ne "0" ]; then
7080
echo "Error in pcm-iio"
7181
exit 1
7282
fi
7383

84+
echo Testing pcm-raw
7485
./pcm-raw -e core/config=0x30203,name=LD_BLOCKS.STORE_FORWARD/ -e cha/config=0,name=UNC_CHA_CLOCKTICKS/ -e imc/fixed,name=DRAM_CLOCKS -e thread_msr/config=0x10,config1=1 -e thread_msr/config=0x19c,config1=0 -- sleep 1
7586
if [ "$?" -ne "0" ]; then
7687
echo "Error in pcm-raw"
7788
exit 1
7889
fi
7990

91+
echo Testing pcm-mmio
8092
./pcm-mmio 0x0
8193
if [ "$?" -ne "0" ]; then
8294
echo "Error in pcm-mmio"
8395
exit 1
8496
fi
8597

98+
echo Testing pcm-pcicfg
8699
./pcm-pcicfg 0 0 0 0 0
87100
if [ "$?" -ne "0" ]; then
88101
echo "Error in pcm-pcicfg"
89102
exit 1
90103
fi
91104

105+
echo Testing pcm-numa
92106
./pcm-numa -- sleep 1
93107
if [ "$?" -ne "0" ]; then
94108
echo "Error in pcm-numa"
95109
exit 1
96110
fi
97111

112+
echo Testing pcm-core
98113
./pcm-core -e cpu/umask=0x01,event=0x0e,name=UOPS_ISSUED.STALL_CYCLES/ -- sleep 1
99114
if [ "$?" -ne "0" ]; then
100115
echo "Error in pcm-core"
101116
exit 1
102117
fi
103118

119+
echo Testing c_example
104120
./examples/c_example
105121
if [ "$?" -ne "0" ]; then
106122
echo "Error in c_example"
107123
exit 1
108124
fi
109125

126+
echo Testing c_example_shlib
110127
./examples/c_example_shlib
111128
if [ "$?" -ne "0" ]; then
112129
echo "Error in c_example_shlib"
113130
exit 1
114131
fi
115132

133+
echo Testing pcm-msr \(read only\)
116134
./pcm-msr -a 0x30A
117135
if [ "$?" -ne "0" ]; then
118136
echo "Error in pcm-msr"
119137
exit 1
120138
fi
121139

140+
echo Testing pcm-power
122141
./pcm-power -- sleep 1
123142
if [ "$?" -ne "0" ]; then
124143
echo "Error in pcm-power"
125144
exit 1
126145
fi
127146

147+
echo Testing pcm-pcie
128148
./pcm-pcie -- sleep 1
129149
if [ "$?" -ne "0" ]; then
130150
echo "Error in pcm-pcie"
131151
exit 1
132152
fi
133153

154+
echo Testing pcm-latency
134155
./pcm-latency -i=1
135156
if [ "$?" -ne "0" ]; then
136157
echo "Error in pcm-latency"
137158
exit 1
138159
fi
139160

161+
echo Testing pcm-tsx
140162
./pcm-tsx -- sleep 1
141163
if [ "$?" -ne "0" ]; then
142164
echo "Error in pcm-tsx"
@@ -146,15 +168,16 @@ fi
146168
# TODO add more tests
147169
# e.g for ./pcm-sensor-server, ./pcm-sensor, ...
148170

171+
echo Testing urltest
149172
./tests/urltest
150173
# We have 2 expected errors, anything else is a bug
151174
if [ "$?" != 2 ]; then
152175
echo "Error in urltest, 2 expected errors but found $?!"
153176
exit 1
154177
fi
155178

156-
### Check pcm-raw with event files
157-
# Download necessary files
179+
echo Testing pcm-raw with event files
180+
echo Download necessary files
158181
if [ ! -f "mapfile.csv" ]; then
159182
echo "Downloading https://download.01.org/perfmon/mapfile.csv"
160183
wget -q --timeout=10 https://download.01.org/perfmon/mapfile.csv
@@ -202,15 +225,15 @@ do
202225
fi
203226
done
204227

205-
# Now check pcm-raw with JSON files from mapFile.csv
228+
echo Now check pcm-raw with JSON files from mapFile.csv
206229
./pcm-raw -r -e LD_BLOCKS.STORE_FORWARD -e CPU_CLK_UNHALTED.THREAD_ANY -e INST_RETIRED.ANY -e UNC_CHA_CLOCKTICKS -- sleep 1
207230

208231
if [ "$?" -ne "0" ]; then
209232
echo "Error in pcm-raw"
210233
exit 1
211234
fi
212235

213-
# Now get corresponding TSV files and replace JSON files in mapFile.csv with them
236+
echo Now get corresponding TSV files and replace JSON files in mapFile.csv with them
214237
cp "mapfile.csv" "mapfile.csv_orig"
215238
for FILE in $FILES
216239
do
@@ -229,7 +252,7 @@ do
229252
done
230253

231254

232-
# Check pcm-raw with TSV files
255+
# echo Test pcm-raw with TSV files
233256
#./pcm-raw -r -e LD_BLOCKS.STORE_FORWARD -e CPU_CLK_UNHALTED.THREAD_ANY -e INST_RETIRED.ANY -e UNC_CHA_CLOCKTICKS -- sleep 1
234257

235258
#if [ "$?" -ne "0" ]; then
@@ -283,18 +306,21 @@ EOF
283306

284307
fi
285308

309+
echo Testing pcm-raw with -el event_file_test.txt -tr -csv
286310
./pcm-raw -el event_file_test.txt -tr -csv=raw_tr_wo_ext.csv -i=4 0.25
287311
if [ "$?" -ne "0" ]; then
288312
echo "Error in pcm-raw"
289313
exit 1
290314
fi
291315

316+
echo Testing pcm-raw with -el event_file_test.txt -tr -ext -csv
292317
./pcm-raw -el event_file_test.txt -tr -ext -csv=raw_tr_wi_ext.csv -i=4 0.25
293318
if [ "$?" -ne "0" ]; then
294319
echo "Error in pcm-raw"
295320
exit 1
296321
fi
297322

323+
echo Testing pcm-raw with -el event_file_test.txt -tr -ext -single-header -csv
298324
./pcm-raw -el event_file_test.txt -tr -ext -single-header -csv=raw_tr_wi_ext_single_header.csv -i=4 0.25
299325
if [ "$?" -ne "0" ]; then
300326
echo "Error in pcm-raw"

0 commit comments

Comments
 (0)