From 29308f46b2e27082a6926e992572d2d2bb5c813a Mon Sep 17 00:00:00 2001 From: cccclai Date: Thu, 11 Dec 2025 14:45:49 -0800 Subject: [PATCH 1/2] Addition note for ETDump Added note about ET_EVENT_TRACER_ENABLED flag requirement for ETDump. --- docs/source/etdump.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/source/etdump.md b/docs/source/etdump.md index 467b7379cf1..26309ed4852 100644 --- a/docs/source/etdump.md +++ b/docs/source/etdump.md @@ -39,6 +39,29 @@ if (result.buf != nullptr && result.size > 0) { target_compile_options(executorch INTERFACE -DET_EVENT_TRACER_ENABLED) target_compile_options(portable_ops_lib INTERFACE -DET_EVENT_TRACER_ENABLED) ``` + +### Make sure ET_EVENT_TRACER_ENABLED flag is enabled or ETDump will be empty. + +If ExecuTorch and all operator libraries are not compiled with the `ET_EVENT_TRACER_ENABLED` preprocessor flag, no trace events will be recorded and the ETDump will be empty. + +When this flag is missing, the following code: + +```C++ +ETDumpResult result = etdump_gen.get_etdump_data(); +if (result.buf != nullptr && result.size > 0) { + ... +} +``` + +will always return: + +```C++ +result.buf == nullptr +result.size == 0 +``` + +This indicates that no ETDump data was collected, and therefore nothing can be analyzed through the Inspector API. + ## Using an ETDump Pass this ETDump into the [Inspector API](model-inspector.rst) to access this data and do post-run analysis. From 229a877d1d87ae2bcf0c1eb2df933a11a19ead3a Mon Sep 17 00:00:00 2001 From: cccclai Date: Thu, 11 Dec 2025 14:46:44 -0800 Subject: [PATCH 2/2] Clarify ET_EVENT_TRACER_ENABLED flag requirement --- docs/source/etdump.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/etdump.md b/docs/source/etdump.md index 26309ed4852..922ebe59657 100644 --- a/docs/source/etdump.md +++ b/docs/source/etdump.md @@ -42,7 +42,7 @@ target_compile_options(portable_ops_lib INTERFACE -DET_EVENT_TRACER_ENABLED) ### Make sure ET_EVENT_TRACER_ENABLED flag is enabled or ETDump will be empty. -If ExecuTorch and all operator libraries are not compiled with the `ET_EVENT_TRACER_ENABLED` preprocessor flag, no trace events will be recorded and the ETDump will be empty. +If the binary is not compiled with the `ET_EVENT_TRACER_ENABLED` preprocessor flag, no trace events will be recorded and the ETDump will be empty. When this flag is missing, the following code: