-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(bb): integrate tracy memory/cpu profiler #7718
Merged
Merged
Changes from 15 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
c812370
feat: initial tracy cmake config
ludamad 5447fc8
pass on tracy - give up on cmake subproject option passing
ludamad 48a985a
start of tracy automation
ludamad 7e2ec27
more memory instrumentation
ludamad f09c9e0
more zones
ludamad fb0a25a
fixes
ludamad 42e53a7
delete operator new
ludamad 01f98ab
fix linking tracy
ludamad 68ef51a
final linker fix
ludamad 9fda270
Merge github.com:AztecProtocol/aztec-packages into ad/tracy-enable
ludamad b65c8f2
tracy
ludamad 2cd4588
operator new
ludamad 4e37944
Merge branch 'master' into ad/tracy-enable
ludamad 51735c6
Update benchmark_tracy.sh
ludamad 5d95b69
Update client_ivc.bench.cpp
ludamad 6cd0461
Update ci.yml
ludamad a095cea
tracy readme
ludamad 88d8701
Merge remote-tracking branch 'origin/ad/tracy-enable' into ad/tracy-e…
ludamad 32385eb
cmake comments
ludamad 87209d8
zonescoped fix
ludamad e073499
Update mem.cpp
ludamad 6328a89
Merge github.com:AztecProtocol/aztec-packages into ad/tracy-enable
ludamad f8a6655
Update mem.cpp
ludamad 42f3ddc
fix build for wasm
ludamad c48ccf2
Merge remote-tracking branch 'origin/ad/tracy-enable' into ad/tracy-e…
ludamad a83a664
format
ludamad 05e72ea
wasm build fix for single-threaded
ludamad bc8c7bd
Update CMakePresets.json
ludamad 1feb04c
Update client_ivc.bench.cpp
ludamad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,10 @@ | ||
include(FetchContent) | ||
|
||
set(TRACY_INCLUDE "${CMAKE_BINARY_DIR}/_deps/tracy-src/public") | ||
|
||
FetchContent_Declare(tracy | ||
GIT_REPOSITORY https://github.com/wolfpld/tracy | ||
GIT_TAG ffb98a972401c246b2348fb5341252e2ba855d00 | ||
SYSTEM # optional, the tracy include directory will be treated as system directory | ||
) | ||
FetchContent_MakeAvailable(tracy) |
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,32 @@ | ||
|
||
# NOTE: intended to be ran from one's external computer, connecting to Aztec mainframe | ||
# the benchmark runs with headless capture and then we copy the trace file and run tracy profiler | ||
# This is thus only really useful internally at Aztec, sorry external folks. It can be easily tweaked | ||
# however for any SSH setup, especially an ubuntu one, and of course if you are just tracing on the | ||
# same machine you can use the normal interactive tracy workflow. | ||
set -eux | ||
USER=$1 | ||
BOX=$USER-box | ||
BENCHMARK=${2:-ultra_plonk_bench} | ||
COMMAND=${3:-./bin/$BENCHMARK} | ||
|
||
ssh $BOX " | ||
set -eux ; | ||
! [ -d ~/tracy ] && git clone https://github.com/wolfpld/tracy ~/tracy ; | ||
cd ~/tracy/capture ; | ||
sudo apt-get install libdbus-1-dev libdbus-glib-1-dev ; | ||
mkdir -p build && cd build && cmake .. && make -j ; | ||
./tracy-capture -a 127.0.0.1 -f -o trace-$BENCHMARK & ; | ||
sleep 0.1 ; | ||
cd ~/aztec-packages/barretenberg/cpp/ ; | ||
cmake --preset tracy && cmake --build --preset tracy --parallel $BENCHMARK ; | ||
cd build-tracy ; | ||
ninja $BENCHMARK ; | ||
$COMMAND ; | ||
" | ||
! [ -d ~/tracy ] && git clone https://github.com/wolfpld/tracy ~/tracy | ||
cd ~/tracy | ||
cmake -B profiler/build -S profiler -DCMAKE_BUILD_TYPE=Release | ||
cmake --build profiler/build --parallel | ||
scp $BOX:/mnt/user-data/$USER/tracy/capture/build/trace-$BENCHMARK . | ||
~/tracy/profiler/build/tracy-profiler 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "barretenberg/common/mem.hpp" | ||
|
||
void* operator new(std::size_t count) | ||
{ | ||
// NOLINTBEGIN(cppcoreguidelines-no-malloc) | ||
void* ptr = malloc(count); | ||
// NOLINTEND(cppcoreguidelines-no-malloc) | ||
TRACY_ALLOC(ptr, count); | ||
return ptr; | ||
} | ||
|
||
void operator delete(void* ptr) noexcept | ||
{ | ||
TRACY_FREE(ptr); | ||
// NOLINTBEGIN(cppcoreguidelines-no-malloc) | ||
free(ptr); | ||
// NOLINTEND(cppcoreguidelines-no-malloc) | ||
} |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?