blob: 7199b38d24aaf609b8a9028b2ac594dd6bb06323 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
//
// Copyright © 2020 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
#pragma once
#include <cstdint>
#include <string>
class ITimelineDecoder
{
public:
enum class ErrorCode
{
ErrorCode_Success,
ErrorCode_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).
};
struct Entity
{
uint64_t m_Guid;
};
struct EventClass
{
uint64_t m_Guid;
};
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;
};
virtual ~ITimelineDecoder() = default;
virtual ErrorCode CreateEntity(const Entity&) = 0;
virtual ErrorCode CreateEventClass(const EventClass&) = 0;
virtual ErrorCode CreateEvent(const Event&) = 0;
virtual ErrorCode CreateLabel(const Label&) = 0;
virtual ErrorCode CreateRelationship(const Relationship&) = 0;
};
|