Skip to content

Commit 64db0c1

Browse files
martinlsmMartin Lindström
andauthored
Arm backend: Fix compilation errors in executor runner (#13792)
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. Co-authored-by: Martin Lindström <[email protected]>
1 parent e254f0e commit 64db0c1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

examples/arm/executor_runner/arm_executor_runner.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ using executorch::bundled_program::verify_method_outputs;
160160
#if defined(ET_EVENT_TRACER_ENABLED)
161161
using executorch::etdump::ETDumpGen;
162162
using executorch::etdump::ETDumpResult;
163+
using torch::executor::etdump_result;
163164
#endif
164165
/**
165166
* The method_allocation_pool should be large enough to fit the setup, input
@@ -503,7 +504,7 @@ struct RunnerContext {
503504
Box<ArmMemoryAllocator> temp_allocator;
504505
Box<Result<Method>> method;
505506
#if defined(ET_EVENT_TRACER_ENABLED)
506-
Box<torch::executor::ETDumpGen> etdump_gen;
507+
Box<ETDumpGen> etdump_gen;
507508
#endif
508509
#if defined(SEMIHOSTING)
509510
Box<ArmMemoryAllocator> input_file_allocator;
@@ -863,11 +864,11 @@ void write_etdump(RunnerContext& ctx) {
863864
#else
864865
// Dump the etdump data containing profiling/debugging data to the specified
865866
// file.
866-
etdump_result result = etdump_gen.get_etdump_data();
867+
etdump_result result = ctx.etdump_gen->get_etdump_data();
867868
if (result.buf != nullptr && result.size > 0) {
868869
// On a device with a file system we can just write it out
869870
// to the file-system.
870-
char etdump_filename = "etdump.bin";
871+
const char* etdump_filename = "etdump.bin";
871872
ET_LOG(Info, "Writing etdump to file: %s", etdump_filename);
872873
FILE* f = fopen(etdump_filename, "w+");
873874
fwrite((uint8_t*)result.buf, 1, result.size, f);

0 commit comments

Comments
 (0)