blob: 7d6471bf911ad5feffa7f4d21be1c4d3370449fa [file] [log] [blame]
Colm Donelana21620d2019-10-11 13:09:49 +01001//
2// Copyright © 2019 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7
Matteo Martincigh65984272019-10-17 13:26:21 +01008#include <Packet.hpp>
9#include <CommandHandlerFunctor.hpp>
Colm Donelana21620d2019-10-11 13:09:49 +010010
11#include <vector>
12
13namespace armnn
14{
15
16namespace gatordmock
17{
18
19struct CounterCaptureValues
20{
21 uint64_t m_Timestamp;
22 std::vector<uint16_t> m_Uids;
23 std::vector<uint32_t> m_Values;
24};
25
26class PeriodicCounterCaptureCommandHandler : public profiling::CommandHandlerFunctor
27{
28
29public:
30 PeriodicCounterCaptureCommandHandler(uint32_t packetId,
31 uint32_t version,
32 bool echoPackets)
33 : CommandHandlerFunctor(packetId, version)
34 , m_EchoPackets(echoPackets)
35 {}
36
37 void operator()(const armnn::profiling::Packet& packet) override;
38
39 CounterCaptureValues m_CounterCaptureValues;
40
41 uint64_t m_CurrentPeriodValue = 0;
42
43private:
44 void ParseData(const armnn::profiling::Packet& packet);
45
46 uint64_t m_FirstTimestamp = 0, m_SecondTimestamp = 0;
47
48 bool m_HeaderPrinted = false;
49 bool m_EchoPackets;
50};
51
52} // namespace gatordmock
53
Matteo Martincigh65984272019-10-17 13:26:21 +010054} // namespace armnn