diff options
author | Finn Williams <Finn.Williams@arm.com> | 2019-10-22 10:30:49 +0100 |
---|---|---|
committer | David Monahan <david.monahan@arm.com> | 2019-11-07 12:20:47 +0000 |
commit | e63a026bd987e78bdaa5b94c3e53201b62011faa (patch) | |
tree | cad6e7dcc7107b723ecc92116a96eda80100a99e /tests/profiling/timelineDecoder/TimelineModel.h | |
parent | 362e03214ceceb95ec30d530ff84e8d9efc198d7 (diff) | |
download | armnn-e63a026bd987e78bdaa5b94c3e53201b62011faa.tar.gz |
IVGCVSW-3951 Create the timeline decoder
* Added ITimelineDecoder.h C interface
* Added an example implementation of ITimelineDecoder.h
* Added command handlers for the timeline directory and objects
* Added tests for the decoder implementation
* Changed ReadSwTraceMessage to take a const unsigned char*
so it can be used by the directory command handler
* Fixed some bugs in ProfilingUtils.cpp and related tests
Change-Id: If06faf1fe0274a8f022f194a6d3527f5ce5374c6
Signed-off-by: Finn Williams <Finn.Williams@arm.com>
Diffstat (limited to 'tests/profiling/timelineDecoder/TimelineModel.h')
-rw-r--r-- | tests/profiling/timelineDecoder/TimelineModel.h | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/tests/profiling/timelineDecoder/TimelineModel.h b/tests/profiling/timelineDecoder/TimelineModel.h new file mode 100644 index 0000000000..a4fbd0dbde --- /dev/null +++ b/tests/profiling/timelineDecoder/TimelineModel.h @@ -0,0 +1,96 @@ +// +// Copyright © 2019 Arm Ltd. All rights reserved. +// SPDX-License-Identifier: MIT +// +#ifndef ARMNN_ITIMELINEMODEL_H +#define ARMNN_ITIMELINEMODEL_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include <stdint.h> + +struct Model; + +typedef enum 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). +} RelationshipType; + +typedef struct Entity +{ + uint64_t m_Guid; +} Entity; + +typedef struct EventClass +{ + uint64_t m_Guid; +} EventClass; + +typedef struct Event +{ + uint64_t m_Guid; + uint64_t m_TimeStamp; + unsigned char* m_ThreadId; +} ProfilingEvent; + +typedef struct Label +{ + uint64_t m_Guid; + char* m_Name; +} Label; + +typedef struct Relationship +{ + RelationshipType m_RelationshipType; + uint64_t m_Guid; + uint64_t m_HeadGuid; + uint64_t m_TailGuid; +} Relationship; + +typedef void (*OnNewEntityCallback)(const Entity, struct Model* model); +typedef void (*OnNewEventClassCallback)(const EventClass, struct Model* model); +typedef void (*OnNewEventCallback)(const Event, struct Model* model); +typedef void (*OnNewLabelCallback)(const Label, struct Model* model); +typedef void (*OnNewRelationshipCallback)(const Relationship, struct Model* model) ; + +typedef struct Model +{ + OnNewEntityCallback m_EntityCb; + OnNewEventClassCallback m_EventClassCb; + OnNewEventCallback m_EventCb; + OnNewLabelCallback m_LabelCb; + OnNewRelationshipCallback m_RelationshipCb; + + Entity** m_Entities; + EventClass** m_EventClasses; + Event** m_Events; + Label** m_Labels; + Relationship** m_Relationships; + + uint32_t m_EntityCount; + uint32_t m_EntityCapacity; + + uint32_t m_EventClassCount; + uint32_t m_EventClassCapacity; + + uint32_t m_EventCount; + uint32_t m_EventCapacity; + + uint32_t m_LabelCount; + uint32_t m_LabelCapacity; + + uint32_t m_RelationshipCount; + uint32_t m_RelationshipCapacity; +} Model; + +#ifdef __cplusplus +} +#endif + +#endif //ARMNN_ITIMELINEMODEL_H
\ No newline at end of file |