File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22set -e
33
4+ FLAMEG_BASE=~ /FlameGraph
5+
46run_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
4365ROOT_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
6691done
6792
You can’t perform that action at this time.
0 commit comments