mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
4389c71619
This works on my kernel. If your kernel is older/newer, you may need a different alpine base image that matches your kernel more closely.
24 lines
708 B
Bash
Executable File
24 lines
708 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -eux
|
|
|
|
TEST=${1:-conference_test}
|
|
OUTPUT="/work/c-toxcore/test.perf"
|
|
|
|
readarray -t FLAGS <<<"$(pkg-config --cflags --libs libsodium msgpack opus vpx | sed -e 's/ /\n/g')"
|
|
readarray -t SRCS <<<"$(find /work/c-toxcore/tox* -name "*.c")"
|
|
|
|
gcc -pthread -g \
|
|
-o "/work/$TEST" -O3 -fno-omit-frame-pointer \
|
|
"${SRCS[@]}" \
|
|
/work/c-toxcore/auto_tests/auto_test_support.c \
|
|
/work/c-toxcore/testing/misc_tools.c \
|
|
"/work/c-toxcore/auto_tests/$TEST.c" \
|
|
-DMIN_LOGGER_LEVEL=LOGGER_LEVEL_TRACE \
|
|
"${FLAGS[@]}"
|
|
|
|
time perf record -g --call-graph dwarf --freq=max "/work/$TEST" /work/c-toxcore/auto_tests/
|
|
perf report | head -n50
|
|
perf script -F +pid >"$OUTPUT"
|
|
chown 1000:100 "$OUTPUT"
|