Change to accumulate PMU values in message handler

Currently the message_handler_openamp overwrites the PMU values in the
response message each time operators are offloaded the NPU in an
inference request. To instead get the total PMU values for all the times
the NPU was used during the inference, the PMU values are now
accumulated instead.

Change-Id: I7fb8697e441b362f2f6da8a26536ba51d17c6b4c
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
diff --git a/applications/message_handler_openamp/inference_runner.cpp b/applications/message_handler_openamp/inference_runner.cpp
index c290773..b462b44 100644
--- a/applications/message_handler_openamp/inference_runner.cpp
+++ b/applications/message_handler_openamp/inference_runner.cpp
@@ -191,8 +191,8 @@
 
     // Get cycle counter
     if (response.pmu_cycle_counter_enable) {
-        uint64_t cycleCount              = ETHOSU_PMU_Get_CCNTR(drv);
-        response.pmu_cycle_counter_count = cycleCount;
+        uint64_t cycleCount = ETHOSU_PMU_Get_CCNTR(drv);
+        response.pmu_cycle_counter_count += cycleCount;
         ethosu_profiler_add_to_pmu_cycles(&context->profiler_context, cycleCount);
     }
 
@@ -202,8 +202,8 @@
     // Get event counters
     int i;
     for (i = 0; i < numEvents; i++) {
-        uint32_t eventValue         = ETHOSU_PMU_Get_EVCNTR(drv, i);
-        response.pmu_event_count[i] = eventValue;
+        uint32_t eventValue = ETHOSU_PMU_Get_EVCNTR(drv, i);
+        response.pmu_event_count[i] += eventValue;
         ethosu_profiler_add_to_pmu_event(&context->profiler_context, i, eventValue);
     }