aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristofer Jonsson <kristofer.jonsson@arm.com>2022-02-02 12:11:22 +0100
committerKristofer Jonsson <kristofer.jonsson@arm.com>2022-02-02 12:11:22 +0100
commit47f556a5904578e1f87ffd4ea5103f68ce30426e (patch)
tree6f27c413839a98171630a163617aced3638a9707
parent5410db1be8c1b8f84c5062e646156e8bca42a4c4 (diff)
downloadethos-u-core-platform-47f556a5904578e1f87ffd4ea5103f68ce30426e.tar.gz
Add PMU prints
Update message handler application to output PMU counters to the log. Change-Id: Ib6002e7c0035d6736b58eed61a059553083348ce
-rw-r--r--applications/message_handler/message_handler.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/applications/message_handler/message_handler.cpp b/applications/message_handler/message_handler.cpp
index 585d63c..f6135fc 100644
--- a/applications/message_handler/message_handler.cpp
+++ b/applications/message_handler/message_handler.cpp
@@ -254,6 +254,20 @@ void InferenceHandler::runInference(ethosu_core_inference_req &req, ethosu_core_
job.clean();
/*
+ * Print PMU counters
+ */
+
+ const int numEvents = std::min(static_cast<int>(ETHOSU_PMU_Get_NumEventCounters()), ETHOSU_CORE_PMU_MAX);
+
+ for (int i = 0; i < numEvents; i++) {
+ printf("ethos-u : ethosu_pmu_cntr%d : %" PRIu32 "\n", i, rsp.pmu_event_count[i]);
+ }
+
+ if (rsp.pmu_cycle_counter_enable) {
+ printf("ethos-u : cycle_cnt : %" PRIu64 " cycles\n", rsp.pmu_cycle_counter_count);
+ }
+
+ /*
* Send inference response
*/