blob: 43d686c73fb114e029fe1845a73a40afe90ef0c6 [file] [log] [blame]
Colm Donelanb682d842019-10-16 12:24:20 +01001//
Jim Flynnbbfe6032020-07-20 16:57:44 +01002// Copyright © 2019 Arm Ltd and Contributors. All rights reserved.
Colm Donelanb682d842019-10-16 12:24:20 +01003// SPDX-License-Identifier: MIT
4//
5
6#include "PeriodicCounterSelectionResponseHandler.hpp"
7
Jim Flynnbbfe6032020-07-20 16:57:44 +01008#include <common/include/CommonProfilingUtils.hpp>
Colm Donelanb682d842019-10-16 12:24:20 +01009
10#include <iostream>
11
12namespace armnn
13{
14
15namespace gatordmock
16{
17
Jim Flynnbbfe6032020-07-20 16:57:44 +010018void PeriodicCounterSelectionResponseHandler::operator()(const arm::pipe::Packet& packet)
Colm Donelanb682d842019-10-16 12:24:20 +010019{
20 if (!m_QuietOperation) // Are we supposed to print to stdout?
21 {
Jim Flynnbbfe6032020-07-20 16:57:44 +010022 uint32_t period = arm::pipe::ReadUint32(reinterpret_cast<const unsigned char*>(packet.GetData()), 0);
Colm Donelanb682d842019-10-16 12:24:20 +010023 uint32_t numCounters = 0;
24 // First check if there are any counters mentioned.
25 if(packet.GetLength() > 4)
26 {
27 // Length will be 4 bytes for the period and then a list of 16 bit UIDS.
28 numCounters = ((packet.GetLength() - 4) / 2);
29 }
30 std::cout << "PeriodicCounterSelectionResponse: Collection interval = " << std::dec << period << "uSec"
31 << " Num counters activated = " << numCounters << std::endl;
32 }
33}
34
35} // namespace gatordmock
36
37} // namespace armnn