diff options
author | Anton Moberg <anton.moberg@arm.com> | 2021-07-07 11:08:17 +0200 |
---|---|---|
committer | Fredrik Knutsson <fredrik.knutsson@arm.com> | 2021-07-15 09:46:02 +0000 |
commit | 07cf70b46cd2bf7db94a8d0e0d845eb44be24d1c (patch) | |
tree | 8c54c8d1785d58d2c336f695bd986350af3c0960 /lib/layer_by_layer_profiler | |
parent | 67536759dce9d6a41d42c6403edc4482623eea0b (diff) | |
download | ethos-u-core-software-07cf70b46cd2bf7db94a8d0e0d845eb44be24d1c.tar.gz |
Improved Logging - Core Software
Logging macros:
Added ethosu_logging.h as a lib, containing logging macros controlled by
a parameter ETHOSU_LOG_SEVERITY set in core_software CMakeLists.txt
Updated inference_process:
Updated inference_process to include ethosu_logging and use the logging
macros rather than printf()
Updated message_process:
Updated message_process to include ethosu_logging and use the
logging macros rather than printf()
Updated ethosu_monitor:
Updated ethosu_monitor to include ethosu_logging and use the
logging macros rather than printf()
Updated layer_by_layer_profiler:
Updated layer_by_layer_profiler to include ethosu_logging and use the
logging macros rather than printf()
Updated mhu_v2:
Updated mhu_v2 to include ethosu_logging and use the
logging macros rather than printf()
Change-Id: I5d6fd80b7645b3e0af5b494eea6dbb7755f02122
Diffstat (limited to 'lib/layer_by_layer_profiler')
-rw-r--r-- | lib/layer_by_layer_profiler/CMakeLists.txt | 2 | ||||
-rw-r--r-- | lib/layer_by_layer_profiler/src/layer_by_layer_profiler.cpp | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/layer_by_layer_profiler/CMakeLists.txt b/lib/layer_by_layer_profiler/CMakeLists.txt index 9774685..7a16da2 100644 --- a/lib/layer_by_layer_profiler/CMakeLists.txt +++ b/lib/layer_by_layer_profiler/CMakeLists.txt @@ -21,6 +21,6 @@ if (NOT TARGET ethosu_core_driver) endif() add_library(layer_by_layer_profiler INTERFACE) -target_link_libraries(layer_by_layer_profiler INTERFACE ethosu_core_driver tflu event_recorder) +target_link_libraries(layer_by_layer_profiler INTERFACE ethosu_core_driver tflu event_recorder ethosu_log) target_include_directories(layer_by_layer_profiler INTERFACE include) target_sources(layer_by_layer_profiler INTERFACE src/layer_by_layer_profiler.cpp) diff --git a/lib/layer_by_layer_profiler/src/layer_by_layer_profiler.cpp b/lib/layer_by_layer_profiler/src/layer_by_layer_profiler.cpp index f7922cb..0211414 100644 --- a/lib/layer_by_layer_profiler/src/layer_by_layer_profiler.cpp +++ b/lib/layer_by_layer_profiler/src/layer_by_layer_profiler.cpp @@ -23,6 +23,7 @@ #include <string.h> +#include "ethosu_log.h" #include "layer_by_layer_profiler.hpp" #include <ethosu_driver.h> #include <inttypes.h> @@ -88,9 +89,9 @@ void LayerByLayerProfiler::EndEvent(uint32_t event_handle) { } if (backend_ == PRINTF) { - printf("%s : cycle_cnt : %" PRIu64 " cycles\n", - tags_[event_handle], - end_ticks_[event_handle] - start_ticks_[event_handle]); + LOG("%s : cycle_cnt : %" PRIu64 " cycles\n", + tags_[event_handle], + end_ticks_[event_handle] - start_ticks_[event_handle]); } else { EventRecord2(event_id_, (int32_t)event_handle, end_ticks_[event_handle] - start_ticks_[event_handle]); } @@ -112,7 +113,7 @@ void LayerByLayerProfiler::Log() const { if (backend_ == PRINTF) { for (size_t i = 0; i < num_events_; ++i) { uint64_t ticks = end_ticks_[i] - start_ticks_[i]; - printf("%s took %" PRIu64 " cycles\n", tags_[i], ticks); + LOG("%s took %" PRIu64 " cycles", tags_[i], ticks); } } #endif |