-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Tracy time with instrumentation (#9170)
At scripts for profiling locally with tracy and samply, add instrumentation so that tracy profile is pretty complete, and combine BB_OP_COUNT macros with tracy macros.
- Loading branch information
1 parent
2592e50
commit 1c008d9
Showing
51 changed files
with
337 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Collect a profile completely locally, i.e., without using any remote machine for building or capturing. | ||
|
||
set -eux | ||
USER=${1:-$USER} | ||
BOX=$USER-box | ||
BENCHMARK=${2:-client_ivc_bench} | ||
COMMAND=${3:-./bin/$BENCHMARK --benchmark_filter=ClientIVCBench/Full/6} | ||
HARDWARE_CONCURRENCY=${HARDWARE_CONCURRENCY:-16} | ||
PRESET=${PRESET:-tracy-time-sampled} | ||
|
||
! [ -d ~/tracy ] && git clone https://github.com/wolfpld/tracy ~/tracy | ||
cd ~/tracy | ||
git checkout 075395620a504c0cdcaf9bab3d196db16a043de7 # release 0.11.0 | ||
cmake -B profiler/build -S profiler -DCMAKE_BUILD_TYPE=Release | ||
cmake --build profiler/build --parallel | ||
|
||
cd ~/aztec-packages/barretenberg/cpp/ | ||
cmake --preset $PRESET -DCMAKE_MESSAGE_LOG_LEVEL=Warning && cmake --build --preset $PRESET --target $BENCHMARK | ||
|
||
! [ -d ~/tracy ] && git clone https://github.com/wolfpld/tracy ~/tracy | ||
cd ~/tracy/capture | ||
git checkout 075395620a504c0cdcaf9bab3d196db16a043de7 | ||
mkdir -p build && cd build && cmake .. -DCMAKE_MESSAGE_LOG_LEVEL=Warning && make -j | ||
|
||
./tracy-capture -a 127.0.0.1 -f -o ../trace-$BENCHMARK & | ||
sleep 0.1 | ||
cd ~/aztec-packages/barretenberg/cpp/build-$PRESET/ | ||
|
||
# Run the COMMAND with sudo if PRESET is 'tracy-time-sampled' | ||
if [ "$PRESET" = "tracy-time-sampled" ]; then | ||
sudo HARDWARE_CONCURRENCY=$HARDWARE_CONCURRENCY $COMMAND | ||
else | ||
HARDWARE_CONCURRENCY=$HARDWARE_CONCURRENCY $COMMAND | ||
fi | ||
|
||
~/tracy/profiler/build/tracy-profiler ~/tracy/capture/trace-$BENCHMARK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This is to be run locally not in a container, so the user must handle samply installation. | ||
#!/usr/bin/env bash | ||
set -eu | ||
|
||
BENCHMARK=${1:-client_ivc_bench} | ||
COMMAND=${2:-./bin/$BENCHMARK --benchmark_filter=ClientIVCBench/Full/6} | ||
HARDWARE_CONCURRENCY=${HARDWARE_CONCURRENCY:-16} | ||
|
||
# Move above script dir. | ||
cd $(dirname $0)/.. | ||
|
||
# Configure and build. | ||
cmake --preset wasm-threads -DCMAKE_MESSAGE_LOG_LEVEL=Warning | ||
cmake --build --preset wasm-threads --target $BENCHMARK | ||
|
||
cd build-wasm-threads | ||
# Consistency with _wasm.sh targets / shorter $COMMAND. | ||
cp ./bin/$BENCHMARK . | ||
samply record wasmtime run --profile=perfmap --env HARDWARE_CONCURRENCY=$HARDWARE_CONCURRENCY -Wthreads=y -Sthreads=y --dir=.. $COMMAND |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.