ArmNN
 21.02
PeriodicCounterSelectionResponseHandler.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2019 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 
8 #include <common/include/CommonProfilingUtils.hpp>
9 
10 #include <iostream>
11 
12 namespace armnn
13 {
14 
15 namespace gatordmock
16 {
17 
18 void PeriodicCounterSelectionResponseHandler::operator()(const arm::pipe::Packet& packet)
19 {
20  if (!m_QuietOperation) // Are we supposed to print to stdout?
21  {
22  uint32_t period = arm::pipe::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
Copyright (c) 2021 ARM Limited and Contributors.
uint32_t ReadUint32(const IPacketBufferPtr &packetBuffer, unsigned int offset)