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 1
1
#! /bin/bash
2
2
set -e
3
3
4
+ FLAMEG_BASE=~ /FlameGraph
5
+
4
6
run_profile_test () {
5
7
local test_dir=" $1 "
6
8
local key_size=" $2 "
@@ -37,7 +39,27 @@ run_profile_test() {
37
39
if [[ ! -d " ${test_dir} /results" ]]; then
38
40
mkdir -p " ${test_dir} /results"
39
41
fi
42
+ echo " [record]"
40
43
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
41
63
}
42
64
43
65
ROOT_DIR=~ /2023_Analysis_zephyr
@@ -62,6 +84,9 @@ for algo in "${ALGO_FLAVORS[@]}"; do
62
84
63
85
run_profile_test " psa_encrypt_test" " ${size} " " ${algo} "
64
86
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} "
65
90
done
66
91
done
67
92
You can’t perform that action at this time.
0 commit comments