blob: 2c2e71170acfd9c22e54d672e46367188c9aa657 [file] [log] [blame]
Colm Donelanb682d842019-10-16 12:24:20 +01001//
2// Copyright © 2019 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "PeriodicCounterSelectionResponseHandler.hpp"
7
Finn Williams0c8cb992020-05-07 10:38:15 +01008#include <ProfilingUtils.hpp>
Colm Donelanb682d842019-10-16 12:24:20 +01009
10#include <iostream>
11
12namespace armnn
13{
14
15namespace gatordmock
16{
17
18void PeriodicCounterSelectionResponseHandler::operator()(const profiling::Packet& packet)
19{
20 if (!m_QuietOperation) // Are we supposed to print to stdout?
21 {
22 uint32_t period = profiling::ReadUint32(reinterpret_cast<const unsigned char*>(packet.GetData()), 0);
23 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