stat_metrics_values.sh 844 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. # perf metrics value validation
  3. # SPDX-License-Identifier: GPL-2.0
  4. shelldir=$(dirname "$0")
  5. # shellcheck source=lib/setup_python.sh
  6. . "${shelldir}"/lib/setup_python.sh
  7. grep -q GenuineIntel /proc/cpuinfo || { echo Skipping non-Intel; exit 2; }
  8. pythonvalidator=$(dirname $0)/lib/perf_metric_validation.py
  9. rulefile=$(dirname $0)/lib/perf_metric_validation_rules.json
  10. tmpdir=$(mktemp -d /tmp/__perf_test.program.XXXXX)
  11. workload="perf bench futex hash -r 2 -s"
  12. # Add -debug, save data file and full rule file
  13. echo "Launch python validation script $pythonvalidator"
  14. echo "Output will be stored in: $tmpdir"
  15. $PYTHON $pythonvalidator -rule $rulefile -output_dir $tmpdir -wl "${workload}"
  16. ret=$?
  17. rm -rf $tmpdir
  18. if [ $ret -ne 0 ]; then
  19. echo "Metric validation return with erros. Please check metrics reported with errors."
  20. fi
  21. exit $ret