aboutsummaryrefslogtreecommitdiff
path: root/profiling/server/include/timelineDecoder/ITimelineDecoder.hpp
diff options
context:
space:
mode:
authorJim Flynn <jim.flynn@arm.com>2020-07-20 16:57:44 +0100
committerJim Flynn <jim.flynn@arm.com>2020-07-29 15:35:15 +0100
commitbbfe603e5ae42317a2b67d713d00882bea341c88 (patch)
tree8d8a78d6836384fb92fb9741c865443624dfec68 /profiling/server/include/timelineDecoder/ITimelineDecoder.hpp
parenta9c2ce123a6a5a68728d040a0323c482bbe46903 (diff)
downloadarmnn-bbfe603e5ae42317a2b67d713d00882bea341c88.tar.gz
IVGCVSW-5166 Pull out the common and server side code into standalone libraries
Change-Id: I180f84c493a9b2be4b93b25d312ebdd9e71b1735 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'profiling/server/include/timelineDecoder/ITimelineDecoder.hpp')
-rw-r--r--profiling/server/include/timelineDecoder/ITimelineDecoder.hpp91
1 files changed, 91 insertions, 0 deletions
diff --git a/profiling/server/include/timelineDecoder/ITimelineDecoder.hpp b/profiling/server/include/timelineDecoder/ITimelineDecoder.hpp
new file mode 100644
index 0000000000..18b8cc7006
--- /dev/null
+++ b/profiling/server/include/timelineDecoder/ITimelineDecoder.hpp
@@ -0,0 +1,91 @@
+//
+// Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#pragma once
+
+#include <cstdint>
+#include <string>
+
+namespace arm
+{
+
+namespace pipe
+{
+
+class ITimelineDecoder
+{
+
+public:
+
+ enum class TimelineStatus
+ {
+ TimelineStatus_Success,
+ TimelineStatus_Fail
+ };
+
+ enum class RelationshipType
+ {
+ 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).
+ };
+
+ static char const* GetRelationshipAsCString(RelationshipType rType)
+ {
+ switch (rType)
+ {
+ case RelationshipType::RetentionLink: return "RetentionLink";
+ case RelationshipType::ExecutionLink: return "ExecutionLink";
+ case RelationshipType::DataLink: return "DataLink";
+ case RelationshipType::LabelLink: return "LabelLink";
+ default: return "Unknown";
+ }
+ }
+
+ struct Entity
+ {
+ uint64_t m_Guid;
+ };
+
+ struct EventClass
+ {
+ uint64_t m_Guid;
+ uint64_t m_NameGuid;
+ };
+
+ struct Event
+ {
+ uint64_t m_Guid;
+ uint64_t m_TimeStamp;
+ uint64_t m_ThreadId;
+ };
+
+ struct Label
+ {
+ uint64_t m_Guid;
+ std::string m_Name;
+ };
+
+ struct Relationship
+ {
+ RelationshipType m_RelationshipType;
+ uint64_t m_Guid;
+ uint64_t m_HeadGuid;
+ uint64_t m_TailGuid;
+ uint64_t m_AttributeGuid;
+ };
+
+ virtual ~ITimelineDecoder() = default;
+
+ virtual TimelineStatus CreateEntity(const Entity&) = 0;
+ virtual TimelineStatus CreateEventClass(const EventClass&) = 0;
+ virtual TimelineStatus CreateEvent(const Event&) = 0;
+ virtual TimelineStatus CreateLabel(const Label&) = 0;
+ virtual TimelineStatus CreateRelationship(const Relationship&) = 0;
+};
+
+} // namespace pipe
+} // namespace arm