Skip to content

Commit 11ecead

Browse files
committed
Start profile delegate
1 parent 60c868b commit 11ecead

File tree

6 files changed

+10
-7
lines changed

6 files changed

+10
-7
lines changed

devtools/etdump/etdump_flatcc.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ void ETDumpGen::end_profiling_delegate(
284284
etdump_RunData_events_push_end(builder_);
285285
}
286286

287-
void ETDumpGen::log_profiling_delegate(
287+
Result<bool> ETDumpGen::log_profiling_delegate(
288288
const char* name,
289289
DelegateDebugIntId delegate_debug_index,
290290
et_timestamp_t start_time,
@@ -314,6 +314,7 @@ void ETDumpGen::log_profiling_delegate(
314314
etdump_RunData_events_push_start(builder_);
315315
etdump_Event_profile_event_add(builder_, id);
316316
etdump_RunData_events_push_end(builder_);
317+
return Result<bool>(true);
317318
}
318319

319320
Result<bool> ETDumpGen::log_intermediate_output_delegate(

devtools/etdump/etdump_flatcc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class ETDumpGen : public ::executorch::runtime::EventTracer {
9090
::executorch::runtime::EventTracerEntry prof_entry,
9191
const void* metadata,
9292
size_t metadata_len) override;
93-
virtual void log_profiling_delegate(
93+
virtual Result<bool> log_profiling_delegate(
9494
const char* name,
9595
DelegateDebugIntId delegate_debug_index,
9696
et_timestamp_t start_time,

docs/source/delegate-debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ ExecuTorch also allows you to log in post time. Some runtime settings don't have
113113
To log events in post (for example, logging start and end time simultaneously) `event_tracer_log_profiling_delegate` is called with a combination of the arguments used in the real-time logging API’s and timestamps.
114114

115115
```c++
116-
void event_tracer_log_profiling_delegate(
116+
Result<bool> event_tracer_log_profiling_delegate(
117117
EventTracer* event_tracer,
118118
const char* name,
119119
DebugHandle delegate_debug_id,

runtime/core/event_tracer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ class EventTracer {
265265
* make it available for the user again in the post-processing stage.
266266
* @param[in] metadata_len Length of the metadata buffer.
267267
*/
268-
virtual void log_profiling_delegate(
268+
virtual Result<bool> log_profiling_delegate(
269269
const char* name,
270270
DelegateDebugIntId delegate_debug_index,
271271
et_timestamp_t start_time,

runtime/core/event_tracer_hooks_delegate.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ inline void event_tracer_end_profiling_delegate(
124124
* make it available for the user again in the post-processing stage.
125125
* @param[in] metadata_len Length of the metadata buffer.
126126
*/
127-
inline void event_tracer_log_profiling_delegate(
127+
inline Result<bool> event_tracer_log_profiling_delegate(
128128
EventTracer* event_tracer,
129129
const char* name,
130130
DebugHandle delegate_debug_id,
@@ -134,7 +134,7 @@ inline void event_tracer_log_profiling_delegate(
134134
size_t metadata_len = 0) {
135135
#ifdef ET_EVENT_TRACER_ENABLED
136136
if (event_tracer) {
137-
event_tracer->log_profiling_delegate(
137+
return event_tracer->log_profiling_delegate(
138138
name, delegate_debug_id, start_time, end_time, metadata, metadata_len);
139139
}
140140
#else //! ET_EVENT_TRACER_ENABLED
@@ -144,6 +144,7 @@ inline void event_tracer_log_profiling_delegate(
144144
(void)end_time;
145145
(void)metadata;
146146
(void)metadata_len;
147+
return Result<bool>(false);
147148
#endif
148149
}
149150

runtime/core/test/event_tracer_test.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class DummyEventTracer : public EventTracer {
9696
(void)event_tracer_filter;
9797
}
9898

99-
void log_profiling_delegate(
99+
Result<bool> log_profiling_delegate(
100100
const char* name,
101101
DelegateDebugIntId delegate_debug_id,
102102
et_timestamp_t start_time,
@@ -109,6 +109,7 @@ class DummyEventTracer : public EventTracer {
109109
(void)end_time;
110110
(void)metadata;
111111
(void)metadata_len;
112+
return Result<bool>(true);
112113
}
113114

114115
virtual Result<bool> log_intermediate_output_delegate(

0 commit comments

Comments
 (0)