Finn Williams | e63a026 | 2019-10-22 10:30:49 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2019 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | #ifndef ARMNN_ITIMELINEMODEL_H |
| 6 | #define ARMNN_ITIMELINEMODEL_H |
| 7 | |
| 8 | #ifdef __cplusplus |
| 9 | extern "C" |
| 10 | { |
| 11 | #endif |
| 12 | |
| 13 | #include <stdint.h> |
| 14 | |
| 15 | struct Model; |
| 16 | |
| 17 | typedef enum RelationshipType |
| 18 | { |
| 19 | RetentionLink, /// Head retains(parents) Tail |
| 20 | ExecutionLink, /// Head execution start depends on Tail execution completion |
| 21 | DataLink, /// Head uses data of Tail |
| 22 | LabelLink /// Head uses label Tail (Tail MUST be a guid of a label). |
| 23 | } RelationshipType; |
| 24 | |
| 25 | typedef struct Entity |
| 26 | { |
| 27 | uint64_t m_Guid; |
| 28 | } Entity; |
| 29 | |
| 30 | typedef struct EventClass |
| 31 | { |
| 32 | uint64_t m_Guid; |
| 33 | } EventClass; |
| 34 | |
| 35 | typedef struct Event |
| 36 | { |
| 37 | uint64_t m_Guid; |
| 38 | uint64_t m_TimeStamp; |
| 39 | unsigned char* m_ThreadId; |
| 40 | } ProfilingEvent; |
| 41 | |
| 42 | typedef struct Label |
| 43 | { |
| 44 | uint64_t m_Guid; |
| 45 | char* m_Name; |
| 46 | } Label; |
| 47 | |
| 48 | typedef struct Relationship |
| 49 | { |
| 50 | RelationshipType m_RelationshipType; |
| 51 | uint64_t m_Guid; |
| 52 | uint64_t m_HeadGuid; |
| 53 | uint64_t m_TailGuid; |
| 54 | } Relationship; |
| 55 | |
| 56 | typedef void (*OnNewEntityCallback)(const Entity, struct Model* model); |
| 57 | typedef void (*OnNewEventClassCallback)(const EventClass, struct Model* model); |
| 58 | typedef void (*OnNewEventCallback)(const Event, struct Model* model); |
| 59 | typedef void (*OnNewLabelCallback)(const Label, struct Model* model); |
| 60 | typedef void (*OnNewRelationshipCallback)(const Relationship, struct Model* model) ; |
| 61 | |
| 62 | typedef struct Model |
| 63 | { |
| 64 | OnNewEntityCallback m_EntityCb; |
| 65 | OnNewEventClassCallback m_EventClassCb; |
| 66 | OnNewEventCallback m_EventCb; |
| 67 | OnNewLabelCallback m_LabelCb; |
| 68 | OnNewRelationshipCallback m_RelationshipCb; |
| 69 | |
| 70 | Entity** m_Entities; |
| 71 | EventClass** m_EventClasses; |
| 72 | Event** m_Events; |
| 73 | Label** m_Labels; |
| 74 | Relationship** m_Relationships; |
| 75 | |
| 76 | uint32_t m_EntityCount; |
| 77 | uint32_t m_EntityCapacity; |
| 78 | |
| 79 | uint32_t m_EventClassCount; |
| 80 | uint32_t m_EventClassCapacity; |
| 81 | |
| 82 | uint32_t m_EventCount; |
| 83 | uint32_t m_EventCapacity; |
| 84 | |
| 85 | uint32_t m_LabelCount; |
| 86 | uint32_t m_LabelCapacity; |
| 87 | |
| 88 | uint32_t m_RelationshipCount; |
| 89 | uint32_t m_RelationshipCapacity; |
| 90 | } Model; |
| 91 | |
| 92 | #ifdef __cplusplus |
| 93 | } |
| 94 | #endif |
| 95 | |
| 96 | #endif //ARMNN_ITIMELINEMODEL_H |