From bb3beeb65d4da4a2f092368ecdd482d237962a54 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Wed, 21 May 2025 22:16:19 +0200 Subject: [PATCH 01/40] Added tracy profiling integration. Link with with-tracy. --- builds/cmake/CMakeLists.txt | 29 +++++++++++++++++++++++++++-- install-cmake.sh | 2 +- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/builds/cmake/CMakeLists.txt b/builds/cmake/CMakeLists.txt index c2c7a56a30..1cf0c76e0a 100644 --- a/builds/cmake/CMakeLists.txt +++ b/builds/cmake/CMakeLists.txt @@ -19,6 +19,16 @@ include(CheckSymbolExists) include(CheckCXXCompilerFlag) include(CheckCXXSourceCompiles) include(CheckLinkerFlag) +include(FetchContent) + +FetchContent_Declare( + tracy + GIT_REPOSITORY https://github.com/wolfpld/tracy.git + GIT_TAG master + GIT_SHALLOW TRUE + GIT_PROGRESS TRUE +) +FetchContent_MakeAvailable(tracy) set_property(GLOBAL PROPERTY USE_FOLDERS ON) @@ -148,6 +158,10 @@ set( with-tests "yes" CACHE BOOL "Compile with unit tests." ) #------------------------------------------------------------------------------ set( with-examples "yes" CACHE BOOL "Compile with examples." ) +# Implement -Dwith-profiling and declare with-profiling. +#------------------------------------------------------------------------------ +set( with-tracy "yes" CACHE BOOL "Compile debug application with tracy libs (https://github.com/wolfpld/tracy)." ) + # Implement -Dwith-icu and define BOOST_HAS_ICU and output ${icu}. #------------------------------------------------------------------------------ set( with-icu "no" CACHE BOOL "Compile with International Components for Unicode." ) @@ -642,11 +656,21 @@ target_include_directories( ${CANONICAL_LIB_NAME} PRIVATE ${rt_INCLUDE_DIRS} ${icu_i18n_FOR_BUILD_INCLUDE_DIRS} ${dl_INCLUDE_DIRS} - ${secp256k1_FOR_BUILD_INCLUDE_DIRS} ) + ${secp256k1_FOR_BUILD_INCLUDE_DIRS} + "$<$:${tracy_SOURCE_DIR}/public>" ) target_include_directories( ${CANONICAL_LIB_NAME} PUBLIC "../../include" ) +# Conditionally enable Tracy profiling. +#------------------------------------------------------------------------------ +if (with-tracy) + target_compile_definitions( ${CANONICAL_LIB_NAME} PRIVATE + TRACY_ENABLE + TRACY_ON_DEMAND + ) +endif() + # ${CANONICAL_LIB_NAME} project specific libraries noramalization for build. #------------------------------------------------------------------------------ if (BUILD_SHARED_LIBS) @@ -671,7 +695,8 @@ target_link_libraries( ${CANONICAL_LIB_NAME} ${rt_LIBRARIES} ${icu_i18n_FOR_BUILD_LIBRARIES} ${dl_LIBRARIES} - ${secp256k1_FOR_BUILD_LIBRARIES} ) + ${secp256k1_FOR_BUILD_LIBRARIES} + "$<$:Tracy::TracyClient>" ) # Define libbitcoin-system-examples project. #------------------------------------------------------------------------------ diff --git a/install-cmake.sh b/install-cmake.sh index f0a3262941..f8a0de9b7a 100755 --- a/install-cmake.sh +++ b/install-cmake.sh @@ -937,7 +937,7 @@ build_all() local SAVE_CPPFLAGS="$CPPFLAGS" export CPPFLAGS="$CPPFLAGS ${BITCOIN_SYSTEM_FLAGS[@]}" if [[ ! ($CI == true) ]]; then - create_from_github libbitcoin libbitcoin-system ${BITCOIN_SYSTEM_BRANCH} "yes" + create_from_github eynhaender libbitcoin-system ${BITCOIN_SYSTEM_BRANCH} "yes" build_from_github_cmake libbitcoin-system "$PARALLEL" true "yes" "${BITCOIN_SYSTEM_OPTIONS[@]}" $CUMULATIVE_FILTERED_ARGS_CMAKE "$@" else push_directory "$PRESUMED_CI_PROJECT_PATH" From 72c3f36950e96417b2aa20850a7e79edb87c6cf7 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Wed, 21 May 2025 23:20:14 +0200 Subject: [PATCH 02/40] First instrumentation without macros --- src/arena.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/arena.cpp b/src/arena.cpp index 1ea64cf81f..eafc066711 100644 --- a/src/arena.cpp +++ b/src/arena.cpp @@ -21,6 +21,12 @@ #include #include +//#include <../obj/nix-gnu-debug-shared/_deps/tracy-src/public/tracy/Tracy.hpp> + +//#ifdef WITH_TRACY +#include <../obj/nix-gnu-debug-shared/_deps/tracy-src/public/tracy/Tracy.hpp> +//#endif + namespace libbitcoin { bool operator==(const arena& left, const arena& right) NOEXCEPT @@ -38,15 +44,26 @@ arena* default_arena::get() NOEXCEPT void* default_arena::do_allocate(size_t bytes, size_t) THROWS { +//#ifdef WITH_TRACY + ZoneScopedN("default_arena::do_allocate"); // Profile allocation +//#endif ////if (align > __STDCPP_DEFAULT_NEW_ALIGNMENT__) //// return ::operator new(bytes, std::align_val_t{ align }); BC_PUSH_WARNING(NO_MALLOC_OR_FREE) - return std::malloc(bytes); + void* ptr = std::malloc(bytes); BC_POP_WARNING() +//#ifdef WITH_TRACY + TracyAlloc(ptr, bytes); // Track allocated memory +//#endif + return ptr; } void default_arena::do_deallocate(void* ptr, size_t, size_t) NOEXCEPT { +//#ifdef WITH_TRACY + ZoneScopedN("default_arena::do_deallocate"); // Profile deallocation + TracyFree(ptr); // Track freed memory +//#endif ////if (align > __STDCPP_DEFAULT_NEW_ALIGNMENT__) //// ::operator delete(ptr, std::align_val_t{ align }); BC_PUSH_WARNING(NO_MALLOC_OR_FREE) From 5ec84c386044b365dbd9f891bbeacdb58bbd731d Mon Sep 17 00:00:00 2001 From: eynhaender Date: Wed, 21 May 2025 23:30:45 +0200 Subject: [PATCH 03/40] verzeichnistest --- src/arena.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/arena.cpp b/src/arena.cpp index eafc066711..3c66774a2f 100644 --- a/src/arena.cpp +++ b/src/arena.cpp @@ -24,7 +24,8 @@ //#include <../obj/nix-gnu-debug-shared/_deps/tracy-src/public/tracy/Tracy.hpp> //#ifdef WITH_TRACY -#include <../obj/nix-gnu-debug-shared/_deps/tracy-src/public/tracy/Tracy.hpp> +//#include <../obj/nix-gnu-debug-shared/_deps/tracy-src/public/tracy/Tracy.hpp> +#include <../_deps/tracy-src/public/tracy/Tracy.hpp> //#endif namespace libbitcoin { From c9cb53ae79bf14240e827ec7c6167a8a3a1cb517 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Wed, 21 May 2025 23:59:22 +0200 Subject: [PATCH 04/40] tracy korrektur --- src/arena.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arena.cpp b/src/arena.cpp index 3c66774a2f..be12a1b479 100644 --- a/src/arena.cpp +++ b/src/arena.cpp @@ -54,7 +54,7 @@ void* default_arena::do_allocate(size_t bytes, size_t) THROWS void* ptr = std::malloc(bytes); BC_POP_WARNING() //#ifdef WITH_TRACY - TracyAlloc(ptr, bytes); // Track allocated memory + //TracyAlloc(ptr, bytes); // Track allocated memory //#endif return ptr; } @@ -63,7 +63,7 @@ void default_arena::do_deallocate(void* ptr, size_t, size_t) NOEXCEPT { //#ifdef WITH_TRACY ZoneScopedN("default_arena::do_deallocate"); // Profile deallocation - TracyFree(ptr); // Track freed memory + //TracyFree(ptr); // Track freed memory //#endif ////if (align > __STDCPP_DEFAULT_NEW_ALIGNMENT__) //// ::operator delete(ptr, std::align_val_t{ align }); From 18a86c15f12a8baa44a7ddd6e32ca239108831bf Mon Sep 17 00:00:00 2001 From: eynhaender Date: Thu, 22 May 2025 00:06:25 +0200 Subject: [PATCH 05/40] =?UTF-8?q?tracy=20der=20n=C3=A4chste?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/arena.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/arena.cpp b/src/arena.cpp index be12a1b479..91cbbcc918 100644 --- a/src/arena.cpp +++ b/src/arena.cpp @@ -52,19 +52,20 @@ void* default_arena::do_allocate(size_t bytes, size_t) THROWS //// return ::operator new(bytes, std::align_val_t{ align }); BC_PUSH_WARNING(NO_MALLOC_OR_FREE) void* ptr = std::malloc(bytes); - BC_POP_WARNING() -//#ifdef WITH_TRACY - //TracyAlloc(ptr, bytes); // Track allocated memory -//#endif + //return std::malloc(bytes); +#ifdef WITH_TRACY + TracyAlloc(ptr, bytes); // Track allocated memory +#endif return ptr; + BC_POP_WARNING() } void default_arena::do_deallocate(void* ptr, size_t, size_t) NOEXCEPT { -//#ifdef WITH_TRACY +#ifdef WITH_TRACY ZoneScopedN("default_arena::do_deallocate"); // Profile deallocation - //TracyFree(ptr); // Track freed memory -//#endif + TracyFree(ptr); // Track freed memory +#endif ////if (align > __STDCPP_DEFAULT_NEW_ALIGNMENT__) //// ::operator delete(ptr, std::align_val_t{ align }); BC_PUSH_WARNING(NO_MALLOC_OR_FREE) From 2413e4fba902d2630801db71612090610dd335f4 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Thu, 22 May 2025 00:10:39 +0200 Subject: [PATCH 06/40] tracy --- src/arena.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/arena.cpp b/src/arena.cpp index 91cbbcc918..f17d4932d6 100644 --- a/src/arena.cpp +++ b/src/arena.cpp @@ -53,19 +53,19 @@ void* default_arena::do_allocate(size_t bytes, size_t) THROWS BC_PUSH_WARNING(NO_MALLOC_OR_FREE) void* ptr = std::malloc(bytes); //return std::malloc(bytes); -#ifdef WITH_TRACY +//#ifdef WITH_TRACY TracyAlloc(ptr, bytes); // Track allocated memory -#endif +//#endif return ptr; BC_POP_WARNING() } void default_arena::do_deallocate(void* ptr, size_t, size_t) NOEXCEPT { -#ifdef WITH_TRACY +//#ifdef WITH_TRACY ZoneScopedN("default_arena::do_deallocate"); // Profile deallocation TracyFree(ptr); // Track freed memory -#endif +//#endif ////if (align > __STDCPP_DEFAULT_NEW_ALIGNMENT__) //// ::operator delete(ptr, std::align_val_t{ align }); BC_PUSH_WARNING(NO_MALLOC_OR_FREE) From 2ab3edb27394240cf2212683f0dd77f65b65b86a Mon Sep 17 00:00:00 2001 From: eynhaender Date: Thu, 22 May 2025 00:15:12 +0200 Subject: [PATCH 07/40] tracy --- src/arena.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/arena.cpp b/src/arena.cpp index f17d4932d6..bacecdbbce 100644 --- a/src/arena.cpp +++ b/src/arena.cpp @@ -51,12 +51,12 @@ void* default_arena::do_allocate(size_t bytes, size_t) THROWS ////if (align > __STDCPP_DEFAULT_NEW_ALIGNMENT__) //// return ::operator new(bytes, std::align_val_t{ align }); BC_PUSH_WARNING(NO_MALLOC_OR_FREE) - void* ptr = std::malloc(bytes); - //return std::malloc(bytes); + //void* ptr = std::malloc(bytes); + return std::malloc(bytes); //#ifdef WITH_TRACY - TracyAlloc(ptr, bytes); // Track allocated memory + //TracyAlloc(ptr, bytes); // Track allocated memory //#endif - return ptr; + //return ptr; BC_POP_WARNING() } @@ -64,7 +64,7 @@ void default_arena::do_deallocate(void* ptr, size_t, size_t) NOEXCEPT { //#ifdef WITH_TRACY ZoneScopedN("default_arena::do_deallocate"); // Profile deallocation - TracyFree(ptr); // Track freed memory + //TracyFree(ptr); // Track freed memory //#endif ////if (align > __STDCPP_DEFAULT_NEW_ALIGNMENT__) //// ::operator delete(ptr, std::align_val_t{ align }); From 08c632029ee95ef72a0646c591127155404b45c4 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Thu, 22 May 2025 00:25:37 +0200 Subject: [PATCH 08/40] tracy --- src/arena.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/arena.cpp b/src/arena.cpp index bacecdbbce..58a454ec1d 100644 --- a/src/arena.cpp +++ b/src/arena.cpp @@ -45,27 +45,17 @@ arena* default_arena::get() NOEXCEPT void* default_arena::do_allocate(size_t bytes, size_t) THROWS { -//#ifdef WITH_TRACY ZoneScopedN("default_arena::do_allocate"); // Profile allocation -//#endif + ////if (align > __STDCPP_DEFAULT_NEW_ALIGNMENT__) //// return ::operator new(bytes, std::align_val_t{ align }); BC_PUSH_WARNING(NO_MALLOC_OR_FREE) - //void* ptr = std::malloc(bytes); return std::malloc(bytes); -//#ifdef WITH_TRACY - //TracyAlloc(ptr, bytes); // Track allocated memory -//#endif - //return ptr; BC_POP_WARNING() } void default_arena::do_deallocate(void* ptr, size_t, size_t) NOEXCEPT { -//#ifdef WITH_TRACY - ZoneScopedN("default_arena::do_deallocate"); // Profile deallocation - //TracyFree(ptr); // Track freed memory -//#endif ////if (align > __STDCPP_DEFAULT_NEW_ALIGNMENT__) //// ::operator delete(ptr, std::align_val_t{ align }); BC_PUSH_WARNING(NO_MALLOC_OR_FREE) @@ -94,4 +84,4 @@ void default_arena::release(void*) NOEXCEPT { } -} // namespace libbitcoin +} // namespace libbitcoin \ No newline at end of file From afaeeb12f564f15614f50f93cea859dc86236f64 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Thu, 22 May 2025 00:42:25 +0200 Subject: [PATCH 09/40] tracy wieder ganz raus --- src/arena.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arena.cpp b/src/arena.cpp index 58a454ec1d..c346cda6a0 100644 --- a/src/arena.cpp +++ b/src/arena.cpp @@ -25,7 +25,7 @@ //#ifdef WITH_TRACY //#include <../obj/nix-gnu-debug-shared/_deps/tracy-src/public/tracy/Tracy.hpp> -#include <../_deps/tracy-src/public/tracy/Tracy.hpp> +//#include <../_deps/tracy-src/public/tracy/Tracy.hpp> //#endif namespace libbitcoin { @@ -45,7 +45,7 @@ arena* default_arena::get() NOEXCEPT void* default_arena::do_allocate(size_t bytes, size_t) THROWS { - ZoneScopedN("default_arena::do_allocate"); // Profile allocation + //ZoneScopedN("default_arena::do_allocate"); // Profile allocation ////if (align > __STDCPP_DEFAULT_NEW_ALIGNMENT__) //// return ::operator new(bytes, std::align_val_t{ align }); From 06d87b34088ea825427e9596377e33f0ad660b5e Mon Sep 17 00:00:00 2001 From: eynhaender Date: Thu, 22 May 2025 01:09:11 +0200 Subject: [PATCH 10/40] tracy wieder rein --- src/arena.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arena.cpp b/src/arena.cpp index c346cda6a0..58a454ec1d 100644 --- a/src/arena.cpp +++ b/src/arena.cpp @@ -25,7 +25,7 @@ //#ifdef WITH_TRACY //#include <../obj/nix-gnu-debug-shared/_deps/tracy-src/public/tracy/Tracy.hpp> -//#include <../_deps/tracy-src/public/tracy/Tracy.hpp> +#include <../_deps/tracy-src/public/tracy/Tracy.hpp> //#endif namespace libbitcoin { @@ -45,7 +45,7 @@ arena* default_arena::get() NOEXCEPT void* default_arena::do_allocate(size_t bytes, size_t) THROWS { - //ZoneScopedN("default_arena::do_allocate"); // Profile allocation + ZoneScopedN("default_arena::do_allocate"); // Profile allocation ////if (align > __STDCPP_DEFAULT_NEW_ALIGNMENT__) //// return ::operator new(bytes, std::align_val_t{ align }); From 838d7ce45f9ae50578e274408c4dbd68a821f54c Mon Sep 17 00:00:00 2001 From: eynhaender Date: Thu, 22 May 2025 10:02:29 +0200 Subject: [PATCH 11/40] tracy erweitert --- src/arena.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/arena.cpp b/src/arena.cpp index 58a454ec1d..1e4a5f24ee 100644 --- a/src/arena.cpp +++ b/src/arena.cpp @@ -50,15 +50,21 @@ void* default_arena::do_allocate(size_t bytes, size_t) THROWS ////if (align > __STDCPP_DEFAULT_NEW_ALIGNMENT__) //// return ::operator new(bytes, std::align_val_t{ align }); BC_PUSH_WARNING(NO_MALLOC_OR_FREE) - return std::malloc(bytes); + auto ptr = std::malloc(bytes); + TracyAlloc(ptr, bytes); + //return std::malloc(bytes); + return ptr; BC_POP_WARNING() } void default_arena::do_deallocate(void* ptr, size_t, size_t) NOEXCEPT { + ZoneScopedN("default_arena::do_deallocate"); + ////if (align > __STDCPP_DEFAULT_NEW_ALIGNMENT__) //// ::operator delete(ptr, std::align_val_t{ align }); BC_PUSH_WARNING(NO_MALLOC_OR_FREE) + TracyFree(ptr); std::free(ptr); BC_POP_WARNING() } From e01eb252b55da92857fab4a206121e775831d50f Mon Sep 17 00:00:00 2001 From: eynhaender Date: Thu, 22 May 2025 10:29:22 +0200 Subject: [PATCH 12/40] jetzt gehts ab --- src/arena.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/arena.cpp b/src/arena.cpp index 1e4a5f24ee..d4d989a7e2 100644 --- a/src/arena.cpp +++ b/src/arena.cpp @@ -28,6 +28,8 @@ #include <../_deps/tracy-src/public/tracy/Tracy.hpp> //#endif +//Jetzt gehts ab + namespace libbitcoin { bool operator==(const arena& left, const arena& right) NOEXCEPT From 23145d747636a5b1a4e36acc5cc0be79dbe7a25e Mon Sep 17 00:00:00 2001 From: eynhaender Date: Thu, 22 May 2025 10:29:36 +0200 Subject: [PATCH 13/40] --with-tracy angefangen --- install-cmake.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-cmake.sh b/install-cmake.sh index f8a0de9b7a..6b441c2c75 100755 --- a/install-cmake.sh +++ b/install-cmake.sh @@ -267,6 +267,7 @@ parse_command_line_options() (--build-icu) BUILD_ICU="yes";; (--build-boost) BUILD_BOOST="yes";; (--build-secp256k1) BUILD_SECP256K1="yes";; + (--with-tracy) WITH-TRACY="yes";; # Unique script options. (--build-dir=*) BUILD_DIR="${OPTION#*=}";; @@ -985,7 +986,6 @@ BOOST_FLAGS=( SECP256K1_FLAGS=( "-w") - # Define build options. #============================================================================== # Define icu options. From 73e0c8c347e5a8956bedb4678904989cb39844a9 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Thu, 22 May 2025 11:34:33 +0200 Subject: [PATCH 14/40] tracy erweitert --- src/chain/block.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/chain/block.cpp b/src/chain/block.cpp index f8160b5c4e..5265872fb5 100644 --- a/src/chain/block.cpp +++ b/src/chain/block.cpp @@ -38,6 +38,8 @@ #include #include +#include <../../_deps/tracy-src/public/tracy/Tracy.hpp> + namespace libbitcoin { namespace system { namespace chain { @@ -134,13 +136,21 @@ bool block::operator!=(const block& other) const NOEXCEPT // private void block::assign_data(reader& source, bool witness) NOEXCEPT { + ZoneScopedN("block::assign_data"); + auto& allocator = source.get_allocator(); const auto count = source.read_size(max_block_size); auto txs = to_non_const_raw_ptr(txs_); txs->reserve(count); + TracyAlloc(txs->data(), sizeof(transaction_cptr) * count); // Instrumentiere reserve for (size_t tx = 0; tx < count; ++tx) - txs->emplace_back(CREATE(transaction, allocator, source, witness)); + ZoneScopedN("block::assign_data-add transaction"); + + auto tx_ptr = CREATE(transaction, allocator, source, witness); + TracyAlloc(tx_ptr.get(), sizeof(transaction)); // Instrumentiere CREATE + //txs->emplace_back(CREATE(transaction, allocator, source, witness)); + txs->emplace_back(tx_ptr); size_ = serialized_size(*txs_); valid_ = source; From f13d2e006bb8bb0fc386076cdc63a77d2a81e419 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Thu, 22 May 2025 11:35:31 +0200 Subject: [PATCH 15/40] verzeichnis korrigiert --- src/chain/block.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chain/block.cpp b/src/chain/block.cpp index 5265872fb5..391fd18815 100644 --- a/src/chain/block.cpp +++ b/src/chain/block.cpp @@ -38,7 +38,7 @@ #include #include -#include <../../_deps/tracy-src/public/tracy/Tracy.hpp> +#include <../_deps/tracy-src/public/tracy/Tracy.hpp> namespace libbitcoin { namespace system { From dc99f120e7f01dc28781786dedb90ac4b5953d7b Mon Sep 17 00:00:00 2001 From: eynhaender Date: Thu, 22 May 2025 11:40:51 +0200 Subject: [PATCH 16/40] verzeichnis korrigiert --- src/chain/block.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chain/block.cpp b/src/chain/block.cpp index 391fd18815..5265872fb5 100644 --- a/src/chain/block.cpp +++ b/src/chain/block.cpp @@ -38,7 +38,7 @@ #include #include -#include <../_deps/tracy-src/public/tracy/Tracy.hpp> +#include <../../_deps/tracy-src/public/tracy/Tracy.hpp> namespace libbitcoin { namespace system { From e38bd452c4bf744a97080f5e066e802219e67603 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Thu, 22 May 2025 14:44:31 +0200 Subject: [PATCH 17/40] verzeichnisse angepasst --- src/arena.cpp | 7 ++----- src/chain/block.cpp | 24 +++++++++++++++++------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/arena.cpp b/src/arena.cpp index d4d989a7e2..bcf68d14a7 100644 --- a/src/arena.cpp +++ b/src/arena.cpp @@ -21,15 +21,12 @@ #include #include -//#include <../obj/nix-gnu-debug-shared/_deps/tracy-src/public/tracy/Tracy.hpp> - //#ifdef WITH_TRACY //#include <../obj/nix-gnu-debug-shared/_deps/tracy-src/public/tracy/Tracy.hpp> -#include <../_deps/tracy-src/public/tracy/Tracy.hpp> +//#include <../_deps/tracy-src/public/tracy/Tracy.hpp> +#include //#endif -//Jetzt gehts ab - namespace libbitcoin { bool operator==(const arena& left, const arena& right) NOEXCEPT diff --git a/src/chain/block.cpp b/src/chain/block.cpp index 5265872fb5..09de7c7e41 100644 --- a/src/chain/block.cpp +++ b/src/chain/block.cpp @@ -38,7 +38,11 @@ #include #include -#include <../../_deps/tracy-src/public/tracy/Tracy.hpp> +//#ifdef WITH_TRACY +//#include <../obj/nix-gnu-debug-shared/_deps/tracy-src/public/tracy/Tracy.hpp> +//#include <../../_deps/tracy-src/public/tracy/Tracy.hpp> +#include +//#endif namespace libbitcoin { namespace system { @@ -59,6 +63,9 @@ block::block() NOEXCEPT block::block(chain::header&& header, chain::transactions&& txs) NOEXCEPT : block(to_shared(std::move(header)), to_shareds(std::move(txs)), true) { + //ZoneScopedN("Block Move Constructor"); + //TracyAlloc(header_.get(), sizeof(chain::header)); + //TracyAlloc(txs_.get(), sizeof(transaction_cptrs)); } block::block(const chain::header& header, @@ -136,21 +143,24 @@ bool block::operator!=(const block& other) const NOEXCEPT // private void block::assign_data(reader& source, bool witness) NOEXCEPT { + //#ifdef WITH_TRACY ZoneScopedN("block::assign_data"); + //#endif auto& allocator = source.get_allocator(); const auto count = source.read_size(max_block_size); auto txs = to_non_const_raw_ptr(txs_); txs->reserve(count); - TracyAlloc(txs->data(), sizeof(transaction_cptr) * count); // Instrumentiere reserve + + TracyAlloc(txs->data(), sizeof(transaction_cptrs) * count); // Instrumentiere reserve for (size_t tx = 0; tx < count; ++tx) - ZoneScopedN("block::assign_data-add transaction"); + //ZoneScopedN("block::assign_data-add transaction"); - auto tx_ptr = CREATE(transaction, allocator, source, witness); - TracyAlloc(tx_ptr.get(), sizeof(transaction)); // Instrumentiere CREATE - //txs->emplace_back(CREATE(transaction, allocator, source, witness)); - txs->emplace_back(tx_ptr); + //auto tx_ptr = CREATE(transaction, allocator, source, witness); + //TracyAlloc(tx_ptr.get(), sizeof(transaction)); // Instrumentiere CREATE + txs->emplace_back(CREATE(transaction, allocator, source, witness)); + //txs->emplace_back(tx_ptr); size_ = serialized_size(*txs_); valid_ = source; From 389e94fe6bafeda6767debc882a7335069cbbcaf Mon Sep 17 00:00:00 2001 From: eynhaender Date: Thu, 22 May 2025 18:06:03 +0200 Subject: [PATCH 18/40] tracy wieder raus --- src/chain/block.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/chain/block.cpp b/src/chain/block.cpp index 09de7c7e41..292e04b64b 100644 --- a/src/chain/block.cpp +++ b/src/chain/block.cpp @@ -39,9 +39,8 @@ #include //#ifdef WITH_TRACY -//#include <../obj/nix-gnu-debug-shared/_deps/tracy-src/public/tracy/Tracy.hpp> -//#include <../../_deps/tracy-src/public/tracy/Tracy.hpp> #include +//#else //#endif namespace libbitcoin { @@ -144,7 +143,7 @@ bool block::operator!=(const block& other) const NOEXCEPT void block::assign_data(reader& source, bool witness) NOEXCEPT { //#ifdef WITH_TRACY - ZoneScopedN("block::assign_data"); + //ZoneScopedN("block::assign_data"); //#endif auto& allocator = source.get_allocator(); @@ -152,7 +151,7 @@ void block::assign_data(reader& source, bool witness) NOEXCEPT auto txs = to_non_const_raw_ptr(txs_); txs->reserve(count); - TracyAlloc(txs->data(), sizeof(transaction_cptrs) * count); // Instrumentiere reserve + //TracyAlloc(txs->data(), sizeof(transaction_cptrs) * count); // Instrumentiere reserve for (size_t tx = 0; tx < count; ++tx) //ZoneScopedN("block::assign_data-add transaction"); From 882420cad0f119ef8651e78495b3daab608f4b84 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Sat, 24 May 2025 14:00:25 +0200 Subject: [PATCH 19/40] =?UTF-8?q?build-konfiguration=20ge=C3=A4ndert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builds/cmake/CMakeLists.txt | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/builds/cmake/CMakeLists.txt b/builds/cmake/CMakeLists.txt index 1cf0c76e0a..acece7d88d 100644 --- a/builds/cmake/CMakeLists.txt +++ b/builds/cmake/CMakeLists.txt @@ -21,6 +21,7 @@ include(CheckCXXSourceCompiles) include(CheckLinkerFlag) include(FetchContent) +# Define tracy version and define the source FetchContent_Declare( tracy GIT_REPOSITORY https://github.com/wolfpld/tracy.git @@ -28,8 +29,19 @@ FetchContent_Declare( GIT_SHALLOW TRUE GIT_PROGRESS TRUE ) +# Download and make tracy available FetchContent_MakeAvailable(tracy) +# Define Boost-Version 1.78.0 and define the source +FetchContent_Declare( + boost + URL https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.gz + #URL_HASH SHA256=79e6d3f986444e5a80afbeccdaf2d1c1cf964baa8d766d20859d653a16c39848 +) + +# Download Boost and make it available +#FetchContent_MakeAvailable(boost) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) if (MSVC) @@ -160,7 +172,7 @@ set( with-examples "yes" CACHE BOOL "Compile with examples." ) # Implement -Dwith-profiling and declare with-profiling. #------------------------------------------------------------------------------ -set( with-tracy "yes" CACHE BOOL "Compile debug application with tracy libs (https://github.com/wolfpld/tracy)." ) +set( with-tracy "no" CACHE BOOL "Compile debug application with tracy libs (https://github.com/wolfpld/tracy)." ) # Implement -Dwith-icu and define BOOST_HAS_ICU and output ${icu}. #------------------------------------------------------------------------------ @@ -176,23 +188,23 @@ endif() # Implement -Denable-avx2. #------------------------------------------------------------------------------ -set( enable-avx2 "no" CACHE BOOL "Compile with avx2 intrinsics (specifically -mavx -mavx2)." ) +set( enable-avx2 "yes" CACHE BOOL "Compile with avx2 intrinsics (specifically -mavx -mavx2)." ) # Implement -Denable-avx512. #------------------------------------------------------------------------------ -set( enable-avx512 "no" CACHE BOOL "Compile with avx512 intrinsics (specifically -mavx512bw -mavx512f)." ) +set( enable-avx512 "yes" CACHE BOOL "Compile with avx512 intrinsics (specifically -mavx512bw -mavx512f)." ) # Implement -Denable-sse41. #------------------------------------------------------------------------------ -set( enable-sse41 "no" CACHE BOOL "Compile with sse4.1 intrinsics (specifically -msse4.1)." ) +set( enable-sse41 "yes" CACHE BOOL "Compile with sse4.1 intrinsics (specifically -msse4.1)." ) # Implement -Denable-shani. #------------------------------------------------------------------------------ -set( enable-shani "no" CACHE BOOL "Compile with sha native intrinsics (specifically -msse4 -msha)" ) +set( enable-shani "yes" CACHE BOOL "Compile with sha native intrinsics (specifically -msse4 -msha)" ) # Implement -Denable-ndebug and define NDEBUG. #------------------------------------------------------------------------------ -set( enable-ndebug "yes" CACHE BOOL "Compile without debug assertions." ) +set( enable-ndebug "no" CACHE BOOL "Compile without debug assertions." ) if (enable-ndebug) add_definitions( -DNDEBUG ) From 266e92f508a60ab80ab8ae000193f21b5bfc5092 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Sat, 24 May 2025 14:16:00 +0200 Subject: [PATCH 20/40] tracy wieder rein --- builds/cmake/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builds/cmake/CMakeLists.txt b/builds/cmake/CMakeLists.txt index acece7d88d..8cd85bbea2 100644 --- a/builds/cmake/CMakeLists.txt +++ b/builds/cmake/CMakeLists.txt @@ -172,7 +172,7 @@ set( with-examples "yes" CACHE BOOL "Compile with examples." ) # Implement -Dwith-profiling and declare with-profiling. #------------------------------------------------------------------------------ -set( with-tracy "no" CACHE BOOL "Compile debug application with tracy libs (https://github.com/wolfpld/tracy)." ) +set( with-tracy "yes" CACHE BOOL "Compile debug application with tracy libs (https://github.com/wolfpld/tracy)." ) # Implement -Dwith-icu and define BOOST_HAS_ICU and output ${icu}. #------------------------------------------------------------------------------ From e94ca3b645d481c695f3a525110ccf9a4ba93b69 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Sat, 24 May 2025 14:17:23 +0200 Subject: [PATCH 21/40] shani raus --- builds/cmake/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builds/cmake/CMakeLists.txt b/builds/cmake/CMakeLists.txt index 8cd85bbea2..9184996f51 100644 --- a/builds/cmake/CMakeLists.txt +++ b/builds/cmake/CMakeLists.txt @@ -200,7 +200,7 @@ set( enable-sse41 "yes" CACHE BOOL "Compile with sse4.1 intrinsics (specifically # Implement -Denable-shani. #------------------------------------------------------------------------------ -set( enable-shani "yes" CACHE BOOL "Compile with sha native intrinsics (specifically -msse4 -msha)" ) +set( enable-shani "no" CACHE BOOL "Compile with sha native intrinsics (specifically -msse4 -msha)" ) # Implement -Denable-ndebug and define NDEBUG. #------------------------------------------------------------------------------ From 1de556235b3c2e705a7e4c8cee50e5279b396343 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Sat, 24 May 2025 23:09:05 +0200 Subject: [PATCH 22/40] =?UTF-8?q?optimierungen=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builds/cmake/CMakePresets.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builds/cmake/CMakePresets.json b/builds/cmake/CMakePresets.json index ec1922b973..ae55647428 100644 --- a/builds/cmake/CMakePresets.json +++ b/builds/cmake/CMakePresets.json @@ -31,8 +31,8 @@ "description": "Factored debug settings.", "hidden": true, "cacheVariables": { - "CMAKE_C_FLAGS": "$env{CMAKE_C_FLAGS} -Og -g --coverage", - "CMAKE_CXX_FLAGS": "$env{CMAKE_CXX_FLAGS} -Og -g --coverage", + "CMAKE_C_FLAGS": "$env{CMAKE_C_FLAGS} -Og -g -fno-omit-frame-pointer -msse4.1 -msha -mavx512f -mavx512dq -mavx512bw --coverage", + "CMAKE_CXX_FLAGS": "$env{CMAKE_CXX_FLAGS} -Og -g -fno-omit-frame-pointer -msse4.1 -msha -mavx512f -mavx512dq -mavx512bw --coverage", "enable-ndebug": { "type": "BOOL", "value": "OFF" @@ -44,8 +44,8 @@ "description": "Factored release settings.", "hidden": true, "cacheVariables": { - "CMAKE_C_FLAGS": "$env{CMAKE_C_FLAGS} -O3", - "CMAKE_CXX_FLAGS": "$env{CMAKE_CXX_FLAGS} -O3", + "CMAKE_C_FLAGS": "$env{CMAKE_C_FLAGS} -O3 -msse4.1 -msha -mavx512f -mavx512dq -mavx512bw ", + "CMAKE_CXX_FLAGS": "$env{CMAKE_CXX_FLAGS} -O3 -msse4.1 -msha -mavx512f -mavx512dq -mavx512bw ", "enable-ndebug": { "type": "BOOL", "value": "ON" From 0d24b48378134152daf1a38057794c29cf20e550 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Sun, 25 May 2025 21:14:47 +0200 Subject: [PATCH 23/40] =?UTF-8?q?Compileroptionen=20ge=C3=A4ndert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builds/cmake/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builds/cmake/CMakeLists.txt b/builds/cmake/CMakeLists.txt index 1b943e75f5..62911abf25 100644 --- a/builds/cmake/CMakeLists.txt +++ b/builds/cmake/CMakeLists.txt @@ -188,15 +188,15 @@ endif() # Implement -Denable-avx2. #------------------------------------------------------------------------------ -set( enable-avx2 "yes" CACHE BOOL "Compile with avx2 intrinsics (specifically -mavx -mavx2)." ) +set( enable-avx2 "no" CACHE BOOL "Compile with avx2 intrinsics (specifically -mavx -mavx2)." ) # Implement -Denable-avx512. #------------------------------------------------------------------------------ -set( enable-avx512 "yes" CACHE BOOL "Compile with avx512 intrinsics (specifically -mavx512bw -mavx512f)." ) +set( enable-avx512 "no" CACHE BOOL "Compile with avx512 intrinsics (specifically -mavx512bw -mavx512f)." ) # Implement -Denable-sse41. #------------------------------------------------------------------------------ -set( enable-sse41 "yes" CACHE BOOL "Compile with sse4.1 intrinsics (specifically -msse4.1)." ) +set( enable-sse41 "no" CACHE BOOL "Compile with sse4.1 intrinsics (specifically -msse4.1)." ) # Implement -Denable-shani. #------------------------------------------------------------------------------ @@ -204,7 +204,7 @@ set( enable-shani "no" CACHE BOOL "Compile with sha native intrinsics (specifica # Implement -Denable-ndebug and define NDEBUG. #------------------------------------------------------------------------------ -set( enable-ndebug "no" CACHE BOOL "Compile without debug assertions." ) +set( enable-ndebug "yes" CACHE BOOL "Compile without debug assertions." ) if (enable-ndebug) add_definitions( -DNDEBUG ) From 5cb289524746abbbd19c08a4423c5e8363077fe0 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Mon, 26 May 2025 20:06:07 +0200 Subject: [PATCH 24/40] =?UTF-8?q?Boost=20entfernt,=20tracy=20standardm?= =?UTF-8?q?=C3=A4=C3=9Fig=20aus,=20Kommentar=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builds/cmake/CMakeLists.txt | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/builds/cmake/CMakeLists.txt b/builds/cmake/CMakeLists.txt index 62911abf25..ef8b38084f 100644 --- a/builds/cmake/CMakeLists.txt +++ b/builds/cmake/CMakeLists.txt @@ -32,16 +32,6 @@ FetchContent_Declare( # Download and make tracy available FetchContent_MakeAvailable(tracy) -# Define Boost-Version 1.78.0 and define the source -FetchContent_Declare( - boost - URL https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.gz - #URL_HASH SHA256=79e6d3f986444e5a80afbeccdaf2d1c1cf964baa8d766d20859d653a16c39848 -) - -# Download Boost and make it available -#FetchContent_MakeAvailable(boost) - set_property(GLOBAL PROPERTY USE_FOLDERS ON) if (MSVC) @@ -172,7 +162,7 @@ set( with-examples "yes" CACHE BOOL "Compile with examples." ) # Implement -Dwith-profiling and declare with-profiling. #------------------------------------------------------------------------------ -set( with-tracy "yes" CACHE BOOL "Compile debug application with tracy libs (https://github.com/wolfpld/tracy)." ) +set( with-tracy "no" CACHE BOOL "Compile/Build with tracy profiler (https://github.com/wolfpld/tracy)." ) # Implement -Dwith-icu and define BOOST_HAS_ICU and output ${icu}. #------------------------------------------------------------------------------ @@ -694,6 +684,7 @@ target_link_libraries( ${CANONICAL_LIB_NAME} ${icu_i18n_FOR_BUILD_LIBRARIES} ${dl_LIBRARIES} ${secp256k1_FOR_BUILD_LIBRARIES} + # Conditionally add tracy libs "$<$:Tracy::TracyClient>" ) # Define libbitcoin-system-examples project. From a516f9268b6ca84e941060589f122e85b359782d Mon Sep 17 00:00:00 2001 From: eynhaender Date: Mon, 26 May 2025 20:33:56 +0200 Subject: [PATCH 25/40] --with-tracy eingepflegt --- install-cmake.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/install-cmake.sh b/install-cmake.sh index 1aece982dd..544b623703 100755 --- a/install-cmake.sh +++ b/install-cmake.sh @@ -17,6 +17,7 @@ # accesses this feature, so if you do not intend to # use passphrase normalization this dependency can # be avoided. +# --with-tracy Add support for tracy profiler. # --build-icu Builds ICU libraries. # --build-boost Builds Boost libraries. # --build-dir= Location of downloaded and intermediate files. @@ -232,6 +233,7 @@ display_help() display_message " accesses this feature, so if you do not intend to " display_message " use passphrase normalization this dependency can " display_message " be avoided." + display_message " --with-tracy Add support for tracy profiler." display_message " --build-icu Build ICU libraries." display_message " --build-boost Build Boost libraries." display_message " --build-secp256k1 Build libsecp256k1 libraries." @@ -262,12 +264,12 @@ parse_command_line_options() # Common project options. (--with-icu) WITH_ICU="yes";; + (--with-tracy) WITH_TRACY="yes";; # Custom build options. - (--build-icu) BUILD_ICU="yes";; - (--build-boost) BUILD_BOOST="yes";; - (--build-secp256k1) BUILD_SECP256K1="yes";; - (--with-tracy) WITH-TRACY="yes";; + (--build-icu) BUILD_ICU="yes";; + (--build-boost) BUILD_BOOST="yes";; + (--build-secp256k1) BUILD_SECP256K1="yes";; # Unique script options. (--build-dir=*) BUILD_DIR="${OPTION#*=}";; @@ -400,6 +402,12 @@ handle_custom_options() CUMULATIVE_FILTERED_ARGS+=" --with-icu" CUMULATIVE_FILTERED_ARGS_CMAKE+=" -Dwith-icu=yes" fi + + # Process tracy + if [[ $WITH_TRACY ]]; then + CUMULATIVE_FILTERED_ARGS+=" --with-tracy" + CUMULATIVE_FILTERED_ARGS_CMAKE+=" -Dwith-tracy=yes" + fi } remove_build_options() From f7598a876a9f005d494cc7926be8236ffa3f965c Mon Sep 17 00:00:00 2001 From: eynhaender Date: Mon, 26 May 2025 20:37:02 +0200 Subject: [PATCH 26/40] tracy wird jetzt auch nur geholt wenn with-tracy --- builds/cmake/CMakeLists.txt | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/builds/cmake/CMakeLists.txt b/builds/cmake/CMakeLists.txt index ef8b38084f..59963d575e 100644 --- a/builds/cmake/CMakeLists.txt +++ b/builds/cmake/CMakeLists.txt @@ -21,16 +21,19 @@ include(CheckCXXSourceCompiles) include(CheckLinkerFlag) include(FetchContent) -# Define tracy version and define the source -FetchContent_Declare( - tracy - GIT_REPOSITORY https://github.com/wolfpld/tracy.git - GIT_TAG master - GIT_SHALLOW TRUE - GIT_PROGRESS TRUE -) -# Download and make tracy available -FetchContent_MakeAvailable(tracy) +# Conditionally get tracy profiler +if (with-tracy) + # Define tracy version and define the source + FetchContent_Declare( + tracy + GIT_REPOSITORY https://github.com/wolfpld/tracy.git + GIT_TAG master + GIT_SHALLOW TRUE + GIT_PROGRESS TRUE + ) + # Download and make tracy available + FetchContent_MakeAvailable(tracy) +endif() set_property(GLOBAL PROPERTY USE_FOLDERS ON) @@ -648,6 +651,7 @@ target_include_directories( ${CANONICAL_LIB_NAME} PRIVATE ${icu_i18n_FOR_BUILD_INCLUDE_DIRS} ${dl_INCLUDE_DIRS} ${secp256k1_FOR_BUILD_INCLUDE_DIRS} + # Conditionally add tracy includes "$<$:${tracy_SOURCE_DIR}/public>" ) target_include_directories( ${CANONICAL_LIB_NAME} PUBLIC From 55ea506f2341ac26cd7177b2f3c79db64ed7011f Mon Sep 17 00:00:00 2001 From: eynhaender Date: Mon, 26 May 2025 21:03:18 +0200 Subject: [PATCH 27/40] tracy in Makros verpackt --- src/arena.cpp | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/arena.cpp b/src/arena.cpp index bcf68d14a7..043e2ea26c 100644 --- a/src/arena.cpp +++ b/src/arena.cpp @@ -21,11 +21,9 @@ #include #include -//#ifdef WITH_TRACY -//#include <../obj/nix-gnu-debug-shared/_deps/tracy-src/public/tracy/Tracy.hpp> -//#include <../_deps/tracy-src/public/tracy/Tracy.hpp> -#include -//#endif +#ifdef WITH_TRACY + #include +#endif namespace libbitcoin { @@ -44,26 +42,36 @@ arena* default_arena::get() NOEXCEPT void* default_arena::do_allocate(size_t bytes, size_t) THROWS { - ZoneScopedN("default_arena::do_allocate"); // Profile allocation + #ifdef WITH_TRACY + ZoneScopedN("default_arena::do_allocate"); + #endif ////if (align > __STDCPP_DEFAULT_NEW_ALIGNMENT__) //// return ::operator new(bytes, std::align_val_t{ align }); BC_PUSH_WARNING(NO_MALLOC_OR_FREE) - auto ptr = std::malloc(bytes); - TracyAlloc(ptr, bytes); - //return std::malloc(bytes); - return ptr; + #ifdef WITH_TRACY + auto ptr = std::malloc(bytes); + TracyAlloc(ptr, bytes); + return ptr; + #else + return std::malloc(bytes); + #endif + BC_POP_WARNING() } void default_arena::do_deallocate(void* ptr, size_t, size_t) NOEXCEPT { - ZoneScopedN("default_arena::do_deallocate"); + #ifdef WITH_TRACY + ZoneScopedN("default_arena::do_deallocate"); + #endif ////if (align > __STDCPP_DEFAULT_NEW_ALIGNMENT__) //// ::operator delete(ptr, std::align_val_t{ align }); BC_PUSH_WARNING(NO_MALLOC_OR_FREE) - TracyFree(ptr); + #ifdef WITH_TRACY + TracyFree(ptr); + #endif std::free(ptr); BC_POP_WARNING() } From ae52203a69c8b22390a7c7a1c65d69a78b266be5 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Mon, 26 May 2025 21:17:41 +0200 Subject: [PATCH 28/40] tracy removed --- src/chain/block.cpp | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/chain/block.cpp b/src/chain/block.cpp index 79fd26be0a..0e748d4f56 100644 --- a/src/chain/block.cpp +++ b/src/chain/block.cpp @@ -37,11 +37,6 @@ #include #include -//#ifdef WITH_TRACY -#include -//#else -//#endif - namespace libbitcoin { namespace system { namespace chain { @@ -61,9 +56,6 @@ block::block() NOEXCEPT block::block(chain::header&& header, chain::transactions&& txs) NOEXCEPT : block(to_shared(std::move(header)), to_shareds(std::move(txs)), true) { - //ZoneScopedN("Block Move Constructor"); - //TracyAlloc(header_.get(), sizeof(chain::header)); - //TracyAlloc(txs_.get(), sizeof(transaction_cptrs)); } block::block(const chain::header& header, @@ -141,25 +133,13 @@ bool block::operator!=(const block& other) const NOEXCEPT // private void block::assign_data(reader& source, bool witness) NOEXCEPT { - //#ifdef WITH_TRACY - //ZoneScopedN("block::assign_data"); - //#endif - auto& allocator = source.get_allocator(); const auto count = source.read_size(max_block_size); auto txs = to_non_const_raw_ptr(txs_); txs->reserve(count); - //TracyAlloc(txs->data(), sizeof(transaction_cptrs) * count); // Instrumentiere reserve - for (size_t tx = 0; tx < count; ++tx) - //ZoneScopedN("block::assign_data-add transaction"); - - //auto tx_ptr = CREATE(transaction, allocator, source, witness); - //TracyAlloc(tx_ptr.get(), sizeof(transaction)); // Instrumentiere CREATE txs->emplace_back(CREATE(transaction, allocator, source, witness)); - //txs->emplace_back(tx_ptr); - size_ = serialized_size(*txs_); valid_ = source; } From a071a86ec361b80132dfbd67744fc59377c9af8e Mon Sep 17 00:00:00 2001 From: eynhaender Date: Tue, 27 May 2025 00:02:03 +0200 Subject: [PATCH 29/40] =?UTF-8?q?WITH=5FTRACY=20zu=20compile=20definitions?= =?UTF-8?q?=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builds/cmake/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builds/cmake/CMakeLists.txt b/builds/cmake/CMakeLists.txt index 59963d575e..979bca0f98 100644 --- a/builds/cmake/CMakeLists.txt +++ b/builds/cmake/CMakeLists.txt @@ -661,8 +661,9 @@ target_include_directories( ${CANONICAL_LIB_NAME} PUBLIC #------------------------------------------------------------------------------ if (with-tracy) target_compile_definitions( ${CANONICAL_LIB_NAME} PRIVATE + WITH_TRACY TRACY_ENABLE - TRACY_ON_DEMAND + TRACY_ON_DEMAND ) endif() From 3189613c63937308594ca8ad3bfa014938eaad4b Mon Sep 17 00:00:00 2001 From: eynhaender Date: Tue, 27 May 2025 00:35:47 +0200 Subject: [PATCH 30/40] tracy header include umgezogen --- include/bitcoin/system/define.hpp | 4 ++++ src/arena.cpp | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/bitcoin/system/define.hpp b/include/bitcoin/system/define.hpp index 65cd08cab9..4672976c1c 100644 --- a/include/bitcoin/system/define.hpp +++ b/include/bitcoin/system/define.hpp @@ -37,6 +37,10 @@ // Pulls in all /system headers (except settings.hpp). #include +#if defined(WITH_TRACY) + #include +#endif + #if defined(HAVE_MSC) #include #endif diff --git a/src/arena.cpp b/src/arena.cpp index 043e2ea26c..2d0e59f786 100644 --- a/src/arena.cpp +++ b/src/arena.cpp @@ -21,10 +21,6 @@ #include #include -#ifdef WITH_TRACY - #include -#endif - namespace libbitcoin { bool operator==(const arena& left, const arena& right) NOEXCEPT From 5e1bd186d730cdca77e367204cce8541ef882393 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Tue, 27 May 2025 00:40:32 +0200 Subject: [PATCH 31/40] tracy include wieder eingebaut --- src/arena.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/arena.cpp b/src/arena.cpp index 2d0e59f786..043e2ea26c 100644 --- a/src/arena.cpp +++ b/src/arena.cpp @@ -21,6 +21,10 @@ #include #include +#ifdef WITH_TRACY + #include +#endif + namespace libbitcoin { bool operator==(const arena& left, const arena& right) NOEXCEPT From 18da746a73a8afef046e111d1722d3ab5d0f521c Mon Sep 17 00:00:00 2001 From: eynhaender Date: Tue, 27 May 2025 00:40:54 +0200 Subject: [PATCH 32/40] =?UTF-8?q?schreibweise=20ge=C3=A4ndert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/bitcoin/system/define.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/bitcoin/system/define.hpp b/include/bitcoin/system/define.hpp index 4672976c1c..68c121c5d8 100644 --- a/include/bitcoin/system/define.hpp +++ b/include/bitcoin/system/define.hpp @@ -37,7 +37,7 @@ // Pulls in all /system headers (except settings.hpp). #include -#if defined(WITH_TRACY) +#ifdef WITH_TRACY #include #endif From 5a5091c7df72a36901b22cfa5225687c9ab91291 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Tue, 27 May 2025 10:44:15 +0200 Subject: [PATCH 33/40] built back --- src/chain/block.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/chain/block.cpp b/src/chain/block.cpp index 0e748d4f56..fc91918644 100644 --- a/src/chain/block.cpp +++ b/src/chain/block.cpp @@ -137,9 +137,10 @@ void block::assign_data(reader& source, bool witness) NOEXCEPT const auto count = source.read_size(max_block_size); auto txs = to_non_const_raw_ptr(txs_); txs->reserve(count); - + for (size_t tx = 0; tx < count; ++tx) txs->emplace_back(CREATE(transaction, allocator, source, witness)); + size_ = serialized_size(*txs_); valid_ = source; } @@ -1023,4 +1024,4 @@ BC_POP_WARNING() } // namespace chain } // namespace system -} // namespace libbitcoin +} // namespace libbitcoin \ No newline at end of file From b6401e4e6c275529f6de868458e356375e8853e7 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Tue, 27 May 2025 10:48:36 +0200 Subject: [PATCH 34/40] built more back --- src/chain/block.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chain/block.cpp b/src/chain/block.cpp index fc91918644..bc8d8c58e2 100644 --- a/src/chain/block.cpp +++ b/src/chain/block.cpp @@ -1024,4 +1024,4 @@ BC_POP_WARNING() } // namespace chain } // namespace system -} // namespace libbitcoin \ No newline at end of file +} // namespace libbitcoin From 1ecf67487339d068c42129d6b409a0a0cdb7e760 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Tue, 27 May 2025 10:50:59 +0200 Subject: [PATCH 35/40] Typos --- builds/cmake/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builds/cmake/CMakeLists.txt b/builds/cmake/CMakeLists.txt index 979bca0f98..8a172a8ad3 100644 --- a/builds/cmake/CMakeLists.txt +++ b/builds/cmake/CMakeLists.txt @@ -163,9 +163,9 @@ set( with-tests "yes" CACHE BOOL "Compile with unit tests." ) #------------------------------------------------------------------------------ set( with-examples "yes" CACHE BOOL "Compile with examples." ) -# Implement -Dwith-profiling and declare with-profiling. +# Implement -Dwith-tracy and declare with-tracy. #------------------------------------------------------------------------------ -set( with-tracy "no" CACHE BOOL "Compile/Build with tracy profiler (https://github.com/wolfpld/tracy)." ) +set( with-tracy "no" CACHE BOOL "Compile/Build with tracy profiler." ) # Implement -Dwith-icu and define BOOST_HAS_ICU and output ${icu}. #------------------------------------------------------------------------------ @@ -657,7 +657,7 @@ target_include_directories( ${CANONICAL_LIB_NAME} PRIVATE target_include_directories( ${CANONICAL_LIB_NAME} PUBLIC "../../include" ) -# Conditionally enable Tracy profiling. +# Conditionally enable tracy profiling. #------------------------------------------------------------------------------ if (with-tracy) target_compile_definitions( ${CANONICAL_LIB_NAME} PRIVATE From b07026ea20a423d34b423189716a308cf63743a9 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Tue, 27 May 2025 10:52:11 +0200 Subject: [PATCH 36/40] Built back --- builds/cmake/CMakePresets.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builds/cmake/CMakePresets.json b/builds/cmake/CMakePresets.json index ae55647428..ec1922b973 100644 --- a/builds/cmake/CMakePresets.json +++ b/builds/cmake/CMakePresets.json @@ -31,8 +31,8 @@ "description": "Factored debug settings.", "hidden": true, "cacheVariables": { - "CMAKE_C_FLAGS": "$env{CMAKE_C_FLAGS} -Og -g -fno-omit-frame-pointer -msse4.1 -msha -mavx512f -mavx512dq -mavx512bw --coverage", - "CMAKE_CXX_FLAGS": "$env{CMAKE_CXX_FLAGS} -Og -g -fno-omit-frame-pointer -msse4.1 -msha -mavx512f -mavx512dq -mavx512bw --coverage", + "CMAKE_C_FLAGS": "$env{CMAKE_C_FLAGS} -Og -g --coverage", + "CMAKE_CXX_FLAGS": "$env{CMAKE_CXX_FLAGS} -Og -g --coverage", "enable-ndebug": { "type": "BOOL", "value": "OFF" @@ -44,8 +44,8 @@ "description": "Factored release settings.", "hidden": true, "cacheVariables": { - "CMAKE_C_FLAGS": "$env{CMAKE_C_FLAGS} -O3 -msse4.1 -msha -mavx512f -mavx512dq -mavx512bw ", - "CMAKE_CXX_FLAGS": "$env{CMAKE_CXX_FLAGS} -O3 -msse4.1 -msha -mavx512f -mavx512dq -mavx512bw ", + "CMAKE_C_FLAGS": "$env{CMAKE_C_FLAGS} -O3", + "CMAKE_CXX_FLAGS": "$env{CMAKE_CXX_FLAGS} -O3", "enable-ndebug": { "type": "BOOL", "value": "ON" From d01fc6e6bde3f818b05c4d8d72e06fa8660bd714 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Tue, 27 May 2025 11:01:59 +0200 Subject: [PATCH 37/40] git repo eynhaender -> libbitcoin --- install-cmake.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-cmake.sh b/install-cmake.sh index 544b623703..39c5566455 100755 --- a/install-cmake.sh +++ b/install-cmake.sh @@ -946,7 +946,7 @@ build_all() local SAVE_CPPFLAGS="$CPPFLAGS" export CPPFLAGS="$CPPFLAGS ${BITCOIN_SYSTEM_FLAGS[@]}" if [[ ! ($CI == true) ]]; then - create_from_github eynhaender libbitcoin-system ${BITCOIN_SYSTEM_BRANCH} "yes" + create_from_github libbitcoin libbitcoin-system ${BITCOIN_SYSTEM_BRANCH} "yes" build_from_github_cmake libbitcoin-system "$PARALLEL" true "yes" "${BITCOIN_SYSTEM_OPTIONS[@]}" $CUMULATIVE_FILTERED_ARGS_CMAKE "$@" else push_directory "$PRESUMED_CI_PROJECT_PATH" From e161cb31f42bc8cdf7151ccbd8ca806a03f0357f Mon Sep 17 00:00:00 2001 From: eynhaender Date: Tue, 27 May 2025 11:08:18 +0200 Subject: [PATCH 38/40] spaces --- src/arena.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/arena.cpp b/src/arena.cpp index 043e2ea26c..32ad3b8961 100644 --- a/src/arena.cpp +++ b/src/arena.cpp @@ -96,5 +96,4 @@ size_t default_arena::detach() NOEXCEPT void default_arena::release(void*) NOEXCEPT { } - } // namespace libbitcoin \ No newline at end of file From fa56e776d530697a7487ff32e4a12ab3bb203107 Mon Sep 17 00:00:00 2001 From: eynhaender Date: Tue, 27 May 2025 11:09:55 +0200 Subject: [PATCH 39/40] spaces --- src/arena.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arena.cpp b/src/arena.cpp index 32ad3b8961..ef88bc378c 100644 --- a/src/arena.cpp +++ b/src/arena.cpp @@ -96,4 +96,4 @@ size_t default_arena::detach() NOEXCEPT void default_arena::release(void*) NOEXCEPT { } -} // namespace libbitcoin \ No newline at end of file +} // namespace libbitcoin From 9bda54f03d6a3b8d2d0c9b10cd7c2b894713544e Mon Sep 17 00:00:00 2001 From: eynhaender Date: Tue, 27 May 2025 11:11:23 +0200 Subject: [PATCH 40/40] more formatting --- src/arena.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/arena.cpp b/src/arena.cpp index ef88bc378c..6b52a5fbcd 100644 --- a/src/arena.cpp +++ b/src/arena.cpp @@ -96,4 +96,5 @@ size_t default_arena::detach() NOEXCEPT void default_arena::release(void*) NOEXCEPT { } + } // namespace libbitcoin