From 07cf70b46cd2bf7db94a8d0e0d845eb44be24d1c Mon Sep 17 00:00:00 2001 From: Anton Moberg Date: Wed, 7 Jul 2021 11:08:17 +0200 Subject: 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 --- lib/layer_by_layer_profiler/src/layer_by_layer_profiler.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/layer_by_layer_profiler/src') 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 +#include "ethosu_log.h" #include "layer_by_layer_profiler.hpp" #include #include @@ -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 -- cgit v1.2.1