diff options
author | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-11-08 11:23:06 +0000 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-11-15 15:34:20 +0000 |
commit | cdfb9417ddce28a5cbd33f8049a147168a26aa9b (patch) | |
tree | 925ebcb589cff2a118cd47dfbaf5d1a5daf058ea /tests/profiling/gatordmock/StreamMetadataCommandHandler.hpp | |
parent | 34a407d4a95830ff9fad05e2bff34dcfc631c931 (diff) | |
download | armnn-cdfb9417ddce28a5cbd33f8049a147168a26aa9b.tar.gz |
IVGCVSW-4073 Send stream info in the ConnectionAcknowledgedCommandHandler
* Added call to ISendTimelinePacket::SendStreamMetaDataPacket
* Added call to ISendTimelinePacket::SendTimelineMessageDirectoryPackage
* Added new StreamMetadataCommandHandler class to the mock Gatord service
* Updated code and unit tests
* Added include paths to the gatord mock target
Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
Change-Id: Ic6d200b513175884607b7c0563cbfa4942ff2fc6
Diffstat (limited to 'tests/profiling/gatordmock/StreamMetadataCommandHandler.hpp')
-rw-r--r-- | tests/profiling/gatordmock/StreamMetadataCommandHandler.hpp | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/tests/profiling/gatordmock/StreamMetadataCommandHandler.hpp b/tests/profiling/gatordmock/StreamMetadataCommandHandler.hpp new file mode 100644 index 0000000000..4558345e67 --- /dev/null +++ b/tests/profiling/gatordmock/StreamMetadataCommandHandler.hpp @@ -0,0 +1,71 @@ +// +// Copyright © 2019 Arm Ltd. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +#include <Packet.hpp> +#include <CommandHandlerFunctor.hpp> + +#include <vector> + +namespace armnn +{ + +namespace gatordmock +{ + +struct PacketVersion +{ + uint16_t m_PacketFamily; + uint16_t m_PacketId; + uint32_t m_PacketVersion; +}; + +class StreamMetadataCommandHandler : public profiling::CommandHandlerFunctor +{ + +public: + /** + * @param familyId The family of the packets this handler will service + * @param packetId The id of packets this handler will process + * @param version The version of that id + * @param quietOperation Optional parameter to turn off printouts. This is useful for unit tests + */ + StreamMetadataCommandHandler(uint32_t familyId, + uint32_t packetId, + uint32_t version, + bool quietOperation = false) + : CommandHandlerFunctor(familyId, packetId, version) + , m_QuietOperation(quietOperation) + {} + + void operator()(const armnn::profiling::Packet& packet) override; + +private: + void ParseData(const armnn::profiling::Packet& packet); + + uint32_t m_PipeMagic; + uint32_t m_StreamMetadataVersion; + uint32_t m_MaxDataLen; + uint32_t m_Pid; + uint32_t m_OffsetInfo; + uint32_t m_OffsetHwVersion; + uint32_t m_OffsetSwVersion; + uint32_t m_OffsetProcessName; + uint32_t m_OffsetPacketVersionTable; + + std::string m_SoftwareInfo; + std::string m_HardwareVersion; + std::string m_SoftwareVersion; + std::string m_ProcessName; + + std::vector<PacketVersion> m_PacketVersionTable; + + bool m_QuietOperation; +}; + +} // namespace gatordmock + +} // namespace armnn |