10 #include <client/src/BufferManager.hpp> 11 #include <client/src/ProfilingService.hpp> 12 #include <client/src/ProfilingUtils.hpp> 17 #include <common/include/Optional.hpp> 18 #include <common/include/ProfilingGuid.hpp> 20 using namespace armnn;
23 const static uint32_t bodyHeaderSize = 6;
34 uint32_t packetDataLength);
37 const std::string& label,
38 const unsigned char* readableData,
39 unsigned int& offset);
42 ProfilingGuid nameGuid,
43 const unsigned char* readableData,
44 unsigned int& offset);
47 arm::pipe::Optional<ProfilingGuid> relationshipGuid,
48 arm::pipe::Optional<ProfilingGuid> headGuid,
49 arm::pipe::Optional<ProfilingGuid> tailGuid,
50 arm::pipe::Optional<ProfilingGuid> attributeGuid,
51 const unsigned char* readableData,
52 unsigned int& offset);
55 const unsigned char* readableData,
56 unsigned int& offset);
59 arm::pipe::Optional<int> threadId,
60 arm::pipe::Optional<ProfilingGuid> eventGuid,
61 const unsigned char* readableData,
62 unsigned int& offset);
66 bool CompareOutput(std::vector<std::string> output, std::vector<std::string> expectedOutput);
79 arm::pipe::IProfilingService& profilingService)
80 : ProfilingService(maxGlobalCounterId,
82 arm::pipe::ARMNN_SOFTWARE_INFO,
83 arm::pipe::ARMNN_SOFTWARE_VERSION,
84 arm::pipe::ARMNN_HARDWARE_VERSION),
85 m_ProfilingService(profilingService) {}
90 return GetBufferManager(static_cast<arm::pipe::ProfilingService&>(m_ProfilingService));
96 TransitionToState(static_cast<arm::pipe::ProfilingService&>(m_ProfilingService), newState);
100 struct LogLevelSwapper
120 , m_BackupBuffer(m_Stream.rdbuf(newStreamBuffer))
128 if (m_BackupBuffer !=
nullptr )
130 m_Stream.rdbuf(m_BackupBuffer);
131 m_BackupBuffer =
nullptr;
136 std::ostream& m_Stream;
137 std::streambuf* m_BackupBuffer;
BufferManager & GetProfilingBufferManager()
ProfilingGuid VerifyTimelineEventBinaryPacket(arm::pipe::Optional< uint64_t > timestamp, arm::pipe::Optional< int > threadId, arm::pipe::Optional< ProfilingGuid > eventGuid, const unsigned char *readableData, unsigned int &offset)
void ConfigureLogging(bool printToStandardOutput, bool printToDebugOutput, LogSeverity severity)
Configures the logging behaviour of the ARMNN library.
ProfilingGuid VerifyTimelineEntityBinaryPacketData(arm::pipe::Optional< ProfilingGuid > guid, const unsigned char *readableData, unsigned int &offset)
unsigned int OffsetToNextWord(unsigned int numberOfBytes)
uint32_t GetStreamMetaDataPacketSize()
void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId)
arm::pipe::IInitialiseProfilingService IInitialiseProfilingService
Copyright (c) 2021 ARM Limited and Contributors.
StreamRedirector(std::ostream &stream, std::streambuf *newStreamBuffer)
void VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType relationshipType, arm::pipe::Optional< ProfilingGuid > relationshipGuid, arm::pipe::Optional< ProfilingGuid > headGuid, arm::pipe::Optional< ProfilingGuid > tailGuid, arm::pipe::Optional< ProfilingGuid > attributeGuid, const unsigned char *readableData, unsigned int &offset)
std::vector< BackendId > GetSuitableBackendRegistered()
Returns a vector of CpuRef, CpuAcc or GpuAcc backends if they where registered.
bool CompareOutput(std::vector< std::string > output, std::vector< std::string > expectedOutput)
void VerifyTimelineHeaderBinary(const unsigned char *readableData, unsigned int &offset, uint32_t packetDataLength)
ProfilingGuid VerifyTimelineLabelBinaryPacketData(arm::pipe::Optional< ProfilingGuid > guid, const std::string &label, const unsigned char *readableData, unsigned int &offset)
void ForceTransitionToState(ProfilingState newState)
arm::pipe::IProfilingService & m_ProfilingService
ProfilingServiceRuntimeHelper(uint16_t maxGlobalCounterId, IInitialiseProfilingService &initialiser, arm::pipe::IProfilingService &profilingService)
void VerifyTimelineEventClassBinaryPacketData(ProfilingGuid guid, ProfilingGuid nameGuid, const unsigned char *readableData, unsigned int &offset)