Skip to content

Commit abe3a71

Browse files
cccclaiGasoonjia
andauthored
Addition note for ETDump (#16214)
Added note about ET_EVENT_TRACER_ENABLED flag requirement for ETDump. --------- Co-authored-by: Gasoonjia <gasoonjia@meta.com>
1 parent 793180f commit abe3a71

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/source/etdump.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,29 @@ if (result.buf != nullptr && result.size > 0) {
3939
target_compile_options(executorch INTERFACE -DET_EVENT_TRACER_ENABLED)
4040
target_compile_options(portable_ops_lib INTERFACE -DET_EVENT_TRACER_ENABLED)
4141
```
42+
43+
### Make sure ET_EVENT_TRACER_ENABLED flag is enabled or ETDump will be empty.
44+
45+
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.
46+
47+
When this flag is missing, the following code:
48+
49+
```C++
50+
ETDumpResult result = etdump_gen.get_etdump_data();
51+
if (result.buf != nullptr && result.size > 0) {
52+
...
53+
}
54+
```
55+
56+
will always return:
57+
58+
```C++
59+
result.buf == nullptr
60+
result.size == 0
61+
```
62+
63+
This indicates that no ETDump data was collected, and therefore nothing can be analyzed through the Inspector API.
64+
4265
## Using an ETDump
4366

4467
Pass this ETDump into the [Inspector API](model-inspector.rst) to access this data and do post-run analysis.

0 commit comments

Comments
 (0)