diff options
author | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-11-06 15:30:54 +0000 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-11-15 15:12:45 +0000 |
commit | 34a407d4a95830ff9fad05e2bff34dcfc631c931 (patch) | |
tree | ff8673a7ea0ffa493885017400a3ea543fce96f9 /tests/profiling/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp | |
parent | 30db8ad8b15e5d0e94ae2ff64c246350885c4b6b (diff) | |
download | armnn-34a407d4a95830ff9fad05e2bff34dcfc631c931.tar.gz |
IVGCVSW-4072 Add stream header to Timeline Message Directory packet
* Refactored the WriteTimelineMessageDirectoryPacket function
* Added the stream header to the packet
* Updated decoders/parsers
* Updated unit tests accordingly
* Minor refactoring
Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
Change-Id: I58f15fde54adc6414ca9fd5fb8d6157cad867339
Diffstat (limited to 'tests/profiling/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp')
-rw-r--r-- | tests/profiling/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/tests/profiling/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp b/tests/profiling/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp index cb860a950b..f28c7b50bf 100644 --- a/tests/profiling/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp +++ b/tests/profiling/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp @@ -5,9 +5,13 @@ #include "TimelineDirectoryCaptureCommandHandler.hpp" +#include <ProfilingUtils.hpp> + #include <iostream> #include <string> +using namespace armnn::profiling; + namespace armnn { @@ -25,10 +29,17 @@ void TimelineDirectoryCaptureCommandHandler::ParseData(const armnn::profiling::P const unsigned char* data = packet.GetData(); + m_SwTraceHeader.m_StreamVersion = ReadUint8(data, offset); + offset += uint8_t_size; + m_SwTraceHeader.m_PointerBytes = ReadUint8(data, offset); + offset += uint8_t_size; + m_SwTraceHeader.m_ThreadIdBytes = ReadUint8(data, offset); + offset += uint8_t_size; + uint32_t numberOfDeclarations = profiling::ReadUint32(data, offset); offset += uint32_t_size; - for (uint32_t declaration = 0; declaration < numberOfDeclarations; ++declaration) + for (uint32_t declaration = 0; declaration < numberOfDeclarations; ++declaration) { m_SwTraceMessages.push_back(profiling::ReadSwTraceMessage(data, offset)); } @@ -54,21 +65,21 @@ void TimelineDirectoryCaptureCommandHandler::Print() std::cout << "\n"; std::cout << std::string(header.size(), '=') << "\n"; - std::cout<< header; + std::cout << header; - for (auto swTraceMessage : m_SwTraceMessages) + for (const auto& swTraceMessage : m_SwTraceMessages) { std::string body; - body.append(profiling::CentreAlignFormatting(std::to_string(swTraceMessage.id), 12)); + body.append(profiling::CentreAlignFormatting(std::to_string(swTraceMessage.m_Id), 12)); body.append(" | "); - body.append(profiling::CentreAlignFormatting(swTraceMessage.name, 20)); + body.append(profiling::CentreAlignFormatting(swTraceMessage.m_Name, 20)); body.append(" | "); - body.append(profiling::CentreAlignFormatting(swTraceMessage.uiName, 20)); + body.append(profiling::CentreAlignFormatting(swTraceMessage.m_UiName, 20)); body.append(" | "); std::string argTypes; - for(auto argType: swTraceMessage.argTypes) + for (auto argType: swTraceMessage.m_ArgTypes) { argTypes += argType; argTypes += " "; @@ -77,7 +88,7 @@ void TimelineDirectoryCaptureCommandHandler::Print() body.append(" | "); std::string argNames; - for(auto argName: swTraceMessage.argNames) + for (auto argName: swTraceMessage.m_ArgNames) { argNames += argName + " "; } @@ -87,7 +98,7 @@ void TimelineDirectoryCaptureCommandHandler::Print() std::cout << std::string(body.size(), '-') << "\n"; - std::cout<< body; + std::cout << body; } } @@ -95,7 +106,7 @@ void TimelineDirectoryCaptureCommandHandler::operator()(const profiling::Packet& { ParseData(packet); - if(!m_QuietOperation) + if (!m_QuietOperation) { Print(); } @@ -103,4 +114,4 @@ void TimelineDirectoryCaptureCommandHandler::operator()(const profiling::Packet& } //namespace gatordmock -} //namespace armnn
\ No newline at end of file +} //namespace armnn |