Colm Donelan | b682d84 | 2019-10-16 12:24:20 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2019 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "PeriodicCounterSelectionResponseHandler.hpp" |
| 7 | |
| 8 | #include "../../../src/profiling/ProfilingUtils.hpp" |
| 9 | |
| 10 | #include <iostream> |
| 11 | |
| 12 | namespace armnn |
| 13 | { |
| 14 | |
| 15 | namespace gatordmock |
| 16 | { |
| 17 | |
| 18 | void 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 |