From ab1ceb3b48beebd99028b35e2b6f0ffecd046077 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Wed, 3 Apr 2024 20:14:14 -0500 Subject: [PATCH] More logging around trace api --- .../include/eosio/trace_api/chain_extraction.hpp | 2 ++ .../include/eosio/trace_api/store_provider.hpp | 6 ++++++ plugins/trace_api_plugin/store_provider.cpp | 8 ++++++++ 3 files changed, 16 insertions(+) diff --git a/plugins/trace_api_plugin/include/eosio/trace_api/chain_extraction.hpp b/plugins/trace_api_plugin/include/eosio/trace_api/chain_extraction.hpp index 05860bb1ef..bf4f9d3b9d 100644 --- a/plugins/trace_api_plugin/include/eosio/trace_api/chain_extraction.hpp +++ b/plugins/trace_api_plugin/include/eosio/trace_api/chain_extraction.hpp @@ -119,7 +119,9 @@ class chain_extraction_impl_type { void store_lib( uint32_t block_num ) { try { + dlog("append_lib"); store.append_lib( block_num ); + dlog("append_lib done"); } catch( ... ) { except_handler( MAKE_EXCEPTION_WITH_CONTEXT( std::current_exception() ) ); } diff --git a/plugins/trace_api_plugin/include/eosio/trace_api/store_provider.hpp b/plugins/trace_api_plugin/include/eosio/trace_api/store_provider.hpp index d30d5f9a21..54d774bafd 100644 --- a/plugins/trace_api_plugin/include/eosio/trace_api/store_provider.hpp +++ b/plugins/trace_api_plugin/include/eosio/trace_api/store_provider.hpp @@ -62,11 +62,17 @@ namespace eosio::trace_api { */ template static uint64_t append_store(const DataEntry &entry, File &file) { + dlog("pack"); auto data = fc::raw::pack(entry); + dlog("tellp"); const auto offset = file.tellp(); + dlog("write"); file.write(data.data(), data.size()); + dlog("flush"); file.flush(); + dlog("sync"); file.sync(); + dlog("append_store done"); return offset; } diff --git a/plugins/trace_api_plugin/store_provider.cpp b/plugins/trace_api_plugin/store_provider.cpp index ae42e843da..9edbd0af29 100644 --- a/plugins/trace_api_plugin/store_provider.cpp +++ b/plugins/trace_api_plugin/store_provider.cpp @@ -53,13 +53,21 @@ namespace eosio::trace_api { void store_provider::append_lib(uint32_t lib) { fc::cfile index, trx_id; + dlog("slice_number"); const uint32_t slice_number = _slice_directory.slice_number(lib); + dlog("find_or_create_index_slice"); _slice_directory.find_or_create_index_slice(slice_number, open_state::write, index); + dlog("metadata_log_entry"); auto le = metadata_log_entry { lib_entry_v0 { .lib = lib }}; + dlog("append_store"); append_store(le, index); + dlog("find_or_create_trx_id_slice"); _slice_directory.find_or_create_trx_id_slice(slice_number, open_state::write, trx_id); + dlog("append_store"); append_store(le, trx_id); + dlog("set_lib"); _slice_directory.set_lib(lib); + dlog("append_lib done"); } void store_provider::append_trx_ids(block_trxs_entry tt){