test-zig-cc/results/profile.sh

24 lines
1.5 KiB
Bash
Raw Normal View History

2022-12-11 20:54:28 +02:00
#!/bin/bash
set -xeuo pipefail
_build() {
name=$1
shift
bazel build --color=no --curses=no "$@" //:zigzag-0
bazel clean --color=no --curses=no
bazel shutdown --color=no --curses=no
2022-12-11 20:54:28 +02:00
perf record --call-graph=dwarf -g -o "$HOME/$name.data" bazel --batch build --color=no --curses=no "$@" ...
}
_build zigcc-nosandbox --spawn_strategy=local --platforms=@zig_sdk//libc_aware/platform:linux_amd64_gnu.2.28
_build llvm-nosandbox --spawn_strategy=local --extra_toolchains=@llvm_toolchain_with_sysroot//:cc-toolchain-x86_64-linux
_build zigcc --platforms=@zig_sdk//libc_aware/platform:linux_amd64_gnu.2.28
_build llvm --extra_toolchains=@llvm_toolchain_with_sysroot//:cc-toolchain-x86_64-linux
_build zigcc-reuse-sandbox-dirs --experimental_reuse_sandbox_directories --platforms=@zig_sdk//libc_aware/platform:linux_amd64_gnu.2.28
_build llvm-reuse-sandbox-dirs --experimental_reuse_sandbox_directories --extra_toolchains=@llvm_toolchain_with_sysroot//:cc-toolchain-x86_64-linux
2022-12-11 20:54:28 +02:00
for d in $HOME/*.data; do
f=$(basename "$d")
echo "perf script -i $d | inferno-collapse-perf | inferno-flamegraph > results/${f%data}svg"
done | parallel -v --eta