File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,8 @@ test_cgroup() {
231
231
232
232
test_leader_sampling () {
233
233
echo " Basic leader sampling test"
234
- if ! perf record -o " ${perfdata} " -e " {branches,branches}:Su" perf test -w brstack 2> /dev/null
234
+ if ! perf record -o " ${perfdata} " -e " {instructions,instructions}:Su" -- \
235
+ perf test -w brstack 2> /dev/null
235
236
then
236
237
echo " Leader sampling [Failed record]"
237
238
err=1
@@ -241,16 +242,16 @@ test_leader_sampling() {
241
242
perf script -i " ${perfdata} " > $script_output
242
243
while IFS= read -r line
243
244
do
244
- # Check if the two branches counts are equal in each record
245
- branches =$( echo $line | awk ' {for(i=1;i<=NF;i++) if($i=="branches :") print $(i-1)}' )
246
- if [ $(( $index % 2 )) -ne 0 ] && [ ${branches } x != ${prev_branches } x ]
245
+ # Check if the two instruction counts are equal in each record
246
+ instructions =$( echo $line | awk ' {for(i=1;i<=NF;i++) if($i=="instructions :") print $(i-1)}' )
247
+ if [ $(( $index % 2 )) -ne 0 ] && [ ${instructions } x != ${prev_instructions } x ]
247
248
then
248
- echo " Leader sampling [Failed inconsistent branches count]"
249
+ echo " Leader sampling [Failed inconsistent instructions count]"
249
250
err=1
250
251
return
251
252
fi
252
253
index=$(( $index + 1 ))
253
- prev_branches= $branches
254
+ prev_instructions= $instructions
254
255
done < $script_output
255
256
echo " Basic leader sampling test [Success]"
256
257
}
You can’t perform that action at this time.
0 commit comments