From 1c382c53edb774be5dede60bede7c7a891df4579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Lindstr=C3=B6m?= Date: Thu, 28 Aug 2025 10:30:24 +0200 Subject: [PATCH] Arm backend: Fix compilation errors in executor runner When building arm_executor_runner.cpp with the two macros ET_EVENT_TRACER_ENABLED and SEMIHOSTING set, compilation errors occur. This patch corrects the code to fix this problem. Change-Id: I14eb0d797f885a08c78328f45297b07d1127b5e6 --- examples/arm/executor_runner/arm_executor_runner.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/arm/executor_runner/arm_executor_runner.cpp b/examples/arm/executor_runner/arm_executor_runner.cpp index 0e0e66dd07b..92926642ec1 100644 --- a/examples/arm/executor_runner/arm_executor_runner.cpp +++ b/examples/arm/executor_runner/arm_executor_runner.cpp @@ -92,6 +92,7 @@ using executorch::bundled_program::verify_method_outputs; #if defined(ET_EVENT_TRACER_ENABLED) using executorch::etdump::ETDumpGen; using executorch::etdump::ETDumpResult; +using torch::executor::etdump_result; #endif /** * The method_allocation_pool should be large enough to fit the setup, input @@ -435,7 +436,7 @@ struct RunnerContext { Box temp_allocator; Box> method; #if defined(ET_EVENT_TRACER_ENABLED) - Box etdump_gen; + Box etdump_gen; #endif #if defined(SEMIHOSTING) Box input_file_allocator; @@ -783,11 +784,11 @@ void write_etdump(RunnerContext& ctx) { #else // Dump the etdump data containing profiling/debugging data to the specified // file. - etdump_result result = etdump_gen.get_etdump_data(); + etdump_result result = ctx.etdump_gen->get_etdump_data(); if (result.buf != nullptr && result.size > 0) { // On a device with a file system we can just write it out // to the file-system. - char etdump_filename = "etdump.bin"; + const char* etdump_filename = "etdump.bin"; ET_LOG(Info, "Writing etdump to file: %s", etdump_filename); FILE* f = fopen(etdump_filename, "w+"); fwrite((uint8_t*)result.buf, 1, result.size, f);