diff options
author | Keith Davis <keith.davis@arm.com> | 2020-03-11 12:17:05 +0000 |
---|---|---|
committer | Jim Flynn <jim.flynn@arm.com> | 2020-03-11 17:42:33 +0000 |
commit | 5238aff21baf0b35c36ab0cc72c7a46888e3bd08 (patch) | |
tree | 531ab960cd38b4255d6537393dbe8adf1d9ffb26 /src/timelineDecoder/TimelineCaptureCommandHandler.hpp | |
parent | f3a43238858a91bbd3719efc5ae6e1a3992b2d23 (diff) | |
download | armnn-5238aff21baf0b35c36ab0cc72c7a46888e3bd08.tar.gz |
IVGCVSW-4542 Refactor TimelineDecoder parsing of TimelinePackets
* Added test to add multiple SwTraceMessages to the buffer
* Updated TimelineCaptureCommandHandler to iterate until there
are no more read functions in the packet
* Further commenting
Change-Id: I41d5acf4f7288ce5a51ffd10a5eea335ac3026ec
Signed-off-by: Keith Davis <keith.davis@arm.com>
Diffstat (limited to 'src/timelineDecoder/TimelineCaptureCommandHandler.hpp')
-rw-r--r-- | src/timelineDecoder/TimelineCaptureCommandHandler.hpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/timelineDecoder/TimelineCaptureCommandHandler.hpp b/src/timelineDecoder/TimelineCaptureCommandHandler.hpp index d95adc0321..b69e615b56 100644 --- a/src/timelineDecoder/TimelineCaptureCommandHandler.hpp +++ b/src/timelineDecoder/TimelineCaptureCommandHandler.hpp @@ -17,13 +17,14 @@ namespace armnn namespace timelinedecoder { -class TimelineCaptureCommandHandler : public profiling::CommandHandlerFunctor +class TimelineCaptureCommandHandler : + public profiling::CommandHandlerFunctor { // Utils uint32_t uint32_t_size = sizeof(uint32_t); uint32_t uint64_t_size = sizeof(uint64_t); - using ReadFunction = void (TimelineCaptureCommandHandler::*)(const unsigned char*, uint32_t); + using ReadFunction = void (TimelineCaptureCommandHandler::*)(const unsigned char*, uint32_t&); public: TimelineCaptureCommandHandler(uint32_t familyId, @@ -31,25 +32,29 @@ public: uint32_t version, ITimelineDecoder& timelineDecoder, uint32_t threadId_size) - : CommandHandlerFunctor(familyId, packetId, version) - , m_TimelineDecoder(timelineDecoder) - , m_ThreadIdSize(threadId_size) + : CommandHandlerFunctor(familyId, packetId, version), + m_TimelineDecoder(timelineDecoder), + m_ThreadIdSize(threadId_size), + m_PacketLength(0) {} void operator()(const armnn::profiling::Packet& packet) override; - void ReadLabel(const unsigned char* data, uint32_t offset); - void ReadEntity(const unsigned char* data, uint32_t offset); - void ReadEventClass(const unsigned char* data, uint32_t offset); - void ReadRelationship(const unsigned char* data, uint32_t offset); - void ReadEvent(const unsigned char* data, uint32_t offset); + void ReadLabel(const unsigned char* data, uint32_t& offset); + void ReadEntity(const unsigned char* data, uint32_t& offset); + void ReadEventClass(const unsigned char* data, uint32_t& offset); + void ReadRelationship(const unsigned char* data, uint32_t& offset); + void ReadEvent(const unsigned char* data, uint32_t& offset); private: void ParseData(const armnn::profiling::Packet& packet); ITimelineDecoder& m_TimelineDecoder; - const uint32_t m_ThreadIdSize; + + const uint32_t m_ThreadIdSize; + unsigned int m_PacketLength; static const ReadFunction m_ReadFunctions[]; + }; } //namespace gatordmock |