From c454ac95267beecd67b1ec3ef8851d5089f99c4c Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Wed, 16 Mar 2022 18:43:18 +0000 Subject: IVGCVSW-6851 Move DirectoryCaptureCommandHandler to the profiling server library Change-Id: Ib14fdcca15f40fedc0f992b0fd882458dc58c9ba Signed-off-by: Jim Flynn --- src/profiling/DirectoryCaptureCommandHandler.hpp | 91 ------------------------ 1 file changed, 91 deletions(-) delete mode 100644 src/profiling/DirectoryCaptureCommandHandler.hpp (limited to 'src/profiling/DirectoryCaptureCommandHandler.hpp') diff --git a/src/profiling/DirectoryCaptureCommandHandler.hpp b/src/profiling/DirectoryCaptureCommandHandler.hpp deleted file mode 100644 index 007cf05d18..0000000000 --- a/src/profiling/DirectoryCaptureCommandHandler.hpp +++ /dev/null @@ -1,91 +0,0 @@ -// -// Copyright © 2019 Arm Ltd and Contributors. All rights reserved. -// SPDX-License-Identifier: MIT -// - -#pragma once - -#include "CounterDirectory.hpp" - -#include - -#include - -namespace arm -{ - -namespace pipe -{ - -struct CounterDirectoryEventRecord -{ - uint16_t m_CounterClass; - std::string m_CounterDescription; - uint16_t m_CounterInterpolation; - double m_CounterMultiplier; - std::string m_CounterName; - uint16_t m_CounterSetUid; - uint16_t m_CounterUid; - arm::pipe::Optional m_CounterUnits; - uint16_t m_DeviceUid; - uint16_t m_MaxCounterUid; -}; - -class DirectoryCaptureCommandHandler : public arm::pipe::CommandHandlerFunctor -{ - -public: - DirectoryCaptureCommandHandler(const std::string& applicationName, - uint32_t familyId, - uint32_t packetId, - uint32_t version, - bool quietOperation = true) - : CommandHandlerFunctor(familyId, packetId, version) - , m_ApplicationName(applicationName) - , m_QuietOperation(quietOperation) - , m_AlreadyParsed(false) - {} - - void operator()(const arm::pipe::Packet& packet) override; - - const ICounterDirectory& GetCounterDirectory() const; - - bool ParsedCounterDirectory() - { - return m_AlreadyParsed.load(); - } - - /** - * Given a Uid that came from a copy of the counter directory translate it to the original. - * - * @param copyUid - * @return the original Uid that the copy maps to. - */ - uint16_t TranslateUIDCopyToOriginal(uint16_t copyUid) - { - return m_UidTranslation[copyUid]; - } - -private: - void ParseData(const arm::pipe::Packet& packet); - - void ReadCategoryRecords(const unsigned char* data, uint32_t offset, std::vector categoryOffsets); - - std::vector - ReadEventRecords(const unsigned char* data, uint32_t offset, std::vector eventRecordsOffsets); - - std::string GetStringNameFromBuffer(const unsigned char* data, uint32_t offset); - bool IsValidChar(unsigned char c); - - std::string m_ApplicationName; - CounterDirectory m_CounterDirectory; - std::unordered_map m_UidTranslation; - bool m_QuietOperation; - // We can only parse the counter directory once per instance. It won't change anyway as it's static - // per instance of ArmNN. - std::atomic m_AlreadyParsed; -}; - -} // namespace pipe - -} // namespace arm -- cgit v1.2.1