forked from thesofproject/sof
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsof-testbench-build-profile.sh
More file actions
executable file
·83 lines (70 loc) · 2.08 KB
/
sof-testbench-build-profile.sh
File metadata and controls
executable file
·83 lines (70 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
# SPDX-License-Identifier: BSD-3-Clause
set -e
usage() {
echo "Usage: $0 <options>"
echo " -d <directory> directory to place code profiling reports"
echo " -h shows this text"
echo " -p <platform> sets platform for scripts/rebuild-testbench.sh"
echo
}
MODULES_S32_44K_48K="asrc src"
MODULES_S32="dcblock drc drc_multiband dolby-dax eqfir eqiir gain level_multiplier micsel \
sound_dose stft_process_1536_240_ template_comp tdfb"
MODULES_S24="aria"
if [ -z "${SOF_WORKSPACE}" ]; then
echo "Error: environment variable SOF_WORKSPACE need to be set to top level sof directory"
exit 1
fi
PLATFORM=none
PDIR=$SOF_WORKSPACE/sof/tools/testbench/profile
while getopts "hp:d:" opt; do
case "${opt}" in
d)
PDIR=${OPTARG}
;;
h)
usage
exit
;;
p)
PLATFORM=${OPTARG}
;;
*)
usage
exit
;;
esac
done
shift $((OPTIND-1))
# Build
SCRIPTS=$SOF_WORKSPACE/sof/scripts
mkdir -p "$PDIR"
"$SCRIPTS"/rebuild-testbench.sh -p "$PLATFORM"
HELPER="$SCRIPTS"/sof-testbench-helper.sh
echo "Profiler reports are stored to $PDIR"
# Run sof-hda-generic.tplg playback
echo "Profiling sof-hda-generic.tplg ..."
$HELPER -x -t production/sof-hda-generic.tplg -n 1,2 \
-p "$PDIR/profile-$PLATFORM-generic.txt" > "$PDIR/log-$PLATFORM-generic.txt"
# Run sof-hda-benchmark-generic.tplg playback
echo "Profiling sof-hda-benchmark-generic.tplg ..."
$HELPER -x -t development/sof-hda-benchmark-generic.tplg -n 1,2,3 \
-p "$PDIR/profile-$PLATFORM-benchmark.txt" > "$PDIR/log-$PLATFORM-benchmark.txt"
# Profile modules
for mod in $MODULES_S32_44K_48K
do
echo "Profiling $mod ..."
$HELPER -r 44100 -x -m "$mod" \
-p "$PDIR/profile-$PLATFORM-$mod.txt" > "$PDIR/log-$PLATFORM-$mod.txt"
done
for mod in $MODULES_S32
do
echo "Profiling $mod ..."
$HELPER -x -m "$mod" -p "$PDIR/profile-$PLATFORM-$mod.txt" > "$PDIR/log-$PLATFORM-$mod.txt"
done
for mod in $MODULES_S24
do
echo "Profiling $mod ..."
$HELPER -b 24 -x -m "$mod" -p "$PDIR/profile-$PLATFORM-$mod.txt" > "$PDIR/log-$PLATFORM-$mod.txt"
done