Skip to content

Commit 40a1727

Browse files
committed
Update profiling runner script: Add key persistence test
1 parent a9dff37 commit 40a1727

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

profiling/run_profiling_parametrized.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22
set -e
33

4+
FLAMEG_BASE=~/FlameGraph
5+
46
run_profile_test() {
57
local test_dir="$1"
68
local key_size="$2"
@@ -37,7 +39,27 @@ run_profile_test() {
3739
if [[ ! -d "${test_dir}/results" ]]; then
3840
mkdir -p "${test_dir}/results"
3941
fi
42+
echo " [record]"
4043
sudo -E perf record -g -o "${result_file}" -- "${exe_path}"
44+
echo " [stat]"
45+
sudo -E perf stat -d -o "${result_file}_stat" -- "${exe_path}"
46+
echo " -> Generating flame graph..."
47+
sudo -E perf script -i "${result_file}" | "${FLAMEG_BASE}/stackcollapse-perf.pl" | "${FLAMEG_BASE}/flamegraph.pl" > "${result_file}_flame.svg"
48+
}
49+
50+
setup_helper() {
51+
local test_dir="$1"
52+
53+
if [[ -d ${test_dir}/setup ]]; then
54+
if [[ "${BUILD_ENABLED}" == true ]]; then
55+
west build -p always -b native_sim -d ${test_dir}/setup/build ${test_dir}/setup
56+
57+
mv ${test_dir}/setup/build/zephyr/zephyr.exe ${test_dir}/setup.exe
58+
rm -rf ${test_dir}/setup/build
59+
60+
sudo -E ${test_dir}/setup.exe
61+
fi
62+
fi
4163
}
4264

4365
ROOT_DIR=~/2023_Analysis_zephyr
@@ -62,6 +84,9 @@ for algo in "${ALGO_FLAVORS[@]}"; do
6284

6385
run_profile_test "psa_encrypt_test" "${size}" "${algo}"
6486
run_profile_test "psa_decrypt_test" "${size}" "${algo}"
87+
88+
setup_helper "psa_key_persistence_test"
89+
run_profile_test "psa_key_persistence_test" "${size}" "${algo}"
6590
done
6691
done
6792

0 commit comments

Comments
 (0)