From 538bfaf3d5a25baf2d094c178b0fe9e708ed16f2 Mon Sep 17 00:00:00 2001 From: YIWENX14 <164585414+YIWENX14@users.noreply.github.com> Date: Fri, 6 Dec 2024 16:15:39 -0800 Subject: [PATCH] Add util function in etdump to get debug buffer size Differential Revision: D66855639 Pull Request resolved: https://github.com/pytorch/executorch/pull/7228 --- devtools/etdump/etdump_flatcc.cpp | 4 ++++ devtools/etdump/etdump_flatcc.h | 1 + 2 files changed, 5 insertions(+) diff --git a/devtools/etdump/etdump_flatcc.cpp b/devtools/etdump/etdump_flatcc.cpp index f34b28e650..e175cc5d0f 100644 --- a/devtools/etdump/etdump_flatcc.cpp +++ b/devtools/etdump/etdump_flatcc.cpp @@ -635,5 +635,9 @@ bool ETDumpGen::is_static_etdump() { return alloc_.data != nullptr; } +size_t ETDumpGen::get_debug_buffer_size() const { + return debug_buffer_.size(); +} + } // namespace etdump } // namespace executorch diff --git a/devtools/etdump/etdump_flatcc.h b/devtools/etdump/etdump_flatcc.h index 0bd891a097..dcfe687577 100644 --- a/devtools/etdump/etdump_flatcc.h +++ b/devtools/etdump/etdump_flatcc.h @@ -138,6 +138,7 @@ class ETDumpGen : public ::executorch::runtime::EventTracer { const double& output) override; void set_debug_buffer(::executorch::runtime::Span buffer); ETDumpResult get_etdump_data(); + size_t get_debug_buffer_size() const; size_t get_num_blocks(); bool is_static_etdump(); void reset();