automated: linux: pi-stress: add pthreashold variable

Adds a `pthreshold` field to the pi-stress test
configuration.  The `pthreshold` parameter allows users to define a
performance threshold for the maximum acceptable latency, enabling more
flexible validation criteria.

If the maximum latency exceeds the configured `pthreshold`, the test
will fail, providing an additional mechanism for automated performance
evaluation.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
diff --git a/automated/linux/pi-stress/pi-stress.sh b/automated/linux/pi-stress/pi-stress.sh
index 892be6e..43234c1 100755
--- a/automated/linux/pi-stress/pi-stress.sh
+++ b/automated/linux/pi-stress/pi-stress.sh
@@ -17,19 +17,21 @@
 RR="false"
 BACKGROUND_CMD=""
 ITERATIONS=1
+PTHRESHOLD="10"
 
 usage() {
-    echo "Usage: $0 [-D runtime] [-m <true|false>] [-r <true|false>] [-w background_cmd] [-i iterations]" 1>&2
+    echo "Usage: $0 [-D runtime] [-m <true|false>] [-r <true|false>] [-w background_cmd] [-i iterations] [-p procent threshold]" 1>&2
     exit 1
 }
 
-while getopts ":D:m:r:w:i:" opt; do
+while getopts ":D:m:r:w:i:p:" opt; do
     case "${opt}" in
         D) DURATION="${OPTARG}" ;;
         m) MLOCKALL="${OPTARG}" ;;
         r) RR="${OPTARG}" ;;
         w) BACKGROUND_CMD="${OPTARG}" ;;
         i) ITERATIONS="${OPTARG}" ;;
+        p) PTHRESHOLD="${OPTARG}" ;;
         *) usage ;;
     esac
 done
@@ -92,10 +94,11 @@
     # Find the minimum inversion
     min_inversion=$(sort -n "${max_inversions_file}" | head -n1)
 
-    threshold=$(echo "$min_inversion * 1.10" | bc -l)
+    echo "PTHRESHOLD: ${PTHRESHOLD}"
+    threshold=$(echo "$min_inversion * (1.${PTHRESHOLD})" | bc -l)
 
     echo "Minimum max inversion: $min_inversion"
-    echo "Threshold (min * 1.10): $threshold"
+    echo "Threshold: $threshold in procent 1.$PTHRESHOLD"
 
     # Count how many inversions exceed threshold
     fail_count=0
@@ -110,7 +113,7 @@
 
     echo "Max allowed failures: $fail_limit"
     echo "Actual failures: $fail_count"
-    echo "Number of max inversions above 110% of min: $fail_count"
+    echo "Number of max inversions above 1.${PTHRESHOLD}% of min: $fail_count"
 
     if [ "$fail_count" -ge "$fail_limit" ]; then
         report_fail "rt-tests-pi-stress"
diff --git a/automated/linux/pi-stress/pi-stress.yaml b/automated/linux/pi-stress/pi-stress.yaml
index 2c553ca..3081844 100644
--- a/automated/linux/pi-stress/pi-stress.yaml
+++ b/automated/linux/pi-stress/pi-stress.yaml
@@ -41,10 +41,11 @@
     ARTIFACTORIAL_URL: "https://archive.validation.linaro.org/artifacts/team/qa/"
     ARTIFACTORIAL_TOKEN: ""
     ITERATIONS: 1
+    PTHRESHOLD: "10"
 
 run:
     steps:
         - cd automated/linux/pi-stress
-        - ./pi-stress.sh -D "${DURATION}" -m "${MLOCKALL}" -r "${RR}" -i "${ITERATIONS}" -w "${BACKGROUND_CMD}"
+        - ./pi-stress.sh -D "${DURATION}" -m "${MLOCKALL}" -r "${RR}" -i "${ITERATIONS}" -w "${BACKGROUND_CMD}" -p "${PTHRESHOLD}"
         - ../../utils/upload-to-artifactorial.sh -a "output/pi-stress.json" -u "${ARTIFACTORIAL_URL}" -t "${ARTIFACTORIAL_TOKEN}"
         - ../../utils/send-to-lava.sh ./output/result.txt