Skip to content

Commit

Permalink
perf test: test_intel_pt.sh: Fix return checking again
Browse files Browse the repository at this point in the history
count_result() does not always reset ret=0 which means the value can spill
into the next test result.

Fix by explicitly setting it to zero between tests.

Committer testing:

  # perf test "Miscellaneous Intel PT testing"
  110: Miscellaneous Intel PT testing               : Ok
  #

Tested as well with:

  # perf test -v "Miscellaneous Intel PT testing"

Fixes: fd9b45e ("perf test: test_intel_pt.sh: Fix return checking")
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20221014170905.64069-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
ahunter6 authored and acmel committed Oct 15, 2022
1 parent e552b7b commit e408049
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tools/perf/tests/shell/test_intel_pt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,12 @@ count_result()
return
fi
err_cnt=$((err_cnt + 1))
ret=0
}

ret=0
test_system_wide_side_band || ret=$? ; count_result $ret
test_per_thread "" "" || ret=$? ; count_result $ret
test_per_thread "k" "(incl. kernel) " || ret=$? ; count_result $ret
test_system_wide_side_band || ret=$? ; count_result $ret ; ret=0
test_per_thread "" "" || ret=$? ; count_result $ret ; ret=0
test_per_thread "k" "(incl. kernel) " || ret=$? ; count_result $ret ; ret=0

cleanup

Expand Down

0 comments on commit e408049

Please sign in to comment.