diff options
author | Keith Davis <keith.davis@arm.com> | 2019-10-24 17:30:41 +0100 |
---|---|---|
committer | Colm Donelan <colm.donelan@arm.com> | 2019-11-06 08:30:31 +0000 |
commit | 3201eea0565ce2bb0418d1936fec71bdeb14c084 (patch) | |
tree | f73017f6338d707165dbcfd717ddc9793b1858e0 /src/profiling/ProfilingUtils.hpp | |
parent | fe2e2cbbbe5294072b2d58755b8a095f32a97e75 (diff) | |
download | armnn-3201eea0565ce2bb0418d1936fec71bdeb14c084.tar.gz |
IVGCVSW-3444 File Only Profiling Connection
* Add FileOnlyProfilingConnection Decorator
* Fix bug where Conn Ack not automatically sent back
* Modify GatordMock to use the Counter Directory class.
* Promote DirectoryCaptureCommandHandler from GatordMock into ArmNN.
* Remove MockUtils as it's contents were moved or deleted.
* Rewrite GatordMockTests to use Counter Directory class.
* Flush streams in ProfilingConnectionDumpToFileDecorator::Close.
Signed-off-by: Keith Davis <keith.davis@arm.com>
Signed-off-by: Colm Donelan <Colm.Donelan@arm.com>
Change-Id: I77b2aedece24150dd31691b577f3b5d81b2e226f
Diffstat (limited to 'src/profiling/ProfilingUtils.hpp')
-rw-r--r-- | src/profiling/ProfilingUtils.hpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/profiling/ProfilingUtils.hpp b/src/profiling/ProfilingUtils.hpp index 3e0a8a2cec..fae1a83024 100644 --- a/src/profiling/ProfilingUtils.hpp +++ b/src/profiling/ProfilingUtils.hpp @@ -7,6 +7,7 @@ #include <armnn/Exceptions.hpp> +#include "ICounterDirectory.hpp" #include "IPacketBuffer.hpp" #include <boost/numeric/conversion/cast.hpp> @@ -55,10 +56,7 @@ template <typename SwTracePolicy> bool IsValidSwTraceString(const std::string& s) { // Check that all the characters in the given string conform to the given policy - return std::all_of(s.begin(), s.end(), [](unsigned char c) - { - return SwTracePolicy::IsValidChar(c); - }); + return std::all_of(s.begin(), s.end(), [](unsigned char c) { return SwTracePolicy::IsValidChar(c); }); } template <typename SwTracePolicy> @@ -77,7 +75,7 @@ bool StringToSwTraceString(const std::string& s, std::vector<uint32_t>& outputBu } // Prepare the output buffer - size_t s_size = s.size() + 1; // The size of the string (in chars) plus the null-terminator + size_t s_size = s.size() + 1; // The size of the string (in chars) plus the null-terminator size_t uint32_t_size = sizeof(uint32_t); size_t outBufferSize = 1 + s_size / uint32_t_size + (s_size % uint32_t_size != 0 ? 1 : 0); outputBuffer.resize(outBufferSize, '\0'); @@ -95,6 +93,10 @@ std::vector<uint16_t> GetNextCounterUids(uint16_t cores); void WriteBytes(const IPacketBuffer& packetBuffer, unsigned int offset, const void* value, unsigned int valueSize); +uint32_t ConstructHeader(uint32_t packetFamily, uint32_t packetId); + +uint32_t ConstructHeader(uint32_t packetFamily, uint32_t packetClass, uint32_t packetType); + void WriteUint64(const IPacketBufferPtr& packetBuffer, unsigned int offset, uint64_t value); void WriteUint32(const IPacketBufferPtr& packetBuffer, unsigned int offset, uint32_t value); @@ -146,10 +148,10 @@ enum class TimelinePacketStatus enum class ProfilingRelationshipType { - RetentionLink, /// Head retains(parents) Tail - ExecutionLink, /// Head execution start depends on Tail execution completion - DataLink, /// Head uses data of Tail - LabelLink /// Head uses label Tail (Tail MUST be a guid of a label). + RetentionLink, /// Head retains(parents) Tail + ExecutionLink, /// Head execution start depends on Tail execution completion + DataLink, /// Head uses data of Tail + LabelLink /// Head uses label Tail (Tail MUST be a guid of a label). }; uint32_t CalculateSizeOfPaddedSwString(const std::string& str); @@ -191,14 +193,18 @@ TimelinePacketStatus WriteTimelineEventBinaryPacket(uint64_t timestamp, unsigned int bufferSize, unsigned int& numberOfBytesWritten); +std::string CentreAlignFormatting(const std::string& stringToPass, const int spacingWidth); + +void PrintCounterDirectory(ICounterDirectory& counterDirectory); + class BufferExhaustion : public armnn::Exception { using Exception::Exception; }; -} // namespace profiling +} // namespace profiling -} // namespace armnn +} // namespace armnn namespace std { |