timeline_struct.h 1.19 KB
Newer Older
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
#ifndef _TIMELINE_STRUCT_H_
#define _TIMELINE_STRUCT_H_

#include <cstddef>
#include <cstdint>
#include <cstring>
#include <stdint.h>
#include <string>
#include <list>
#include <map>

#pragma pack(push, 1)

typedef struct  {
  uint8_t type;
  uint16_t opCount;
  uint16_t funcIndex;
  size_t size;
  uint64_t timestamp;
  uint64_t gpuTimestamp;
} TimelineGpuEvent;

typedef struct {
  // int skip;
  // int skipped;
  uint64_t event_buffer_head;
  TimelineGpuEvent* event_buffer;
} TimelineGpuEventHandle;

typedef struct  {
  int skip;
  int skipped;
  uint16_t isFull;
  uint16_t curOpCount;
  uint16_t gpuMaxProfilingThreads;
  uint16_t gpuMaxProfilingEvents;
  TimelineGpuEventHandle* handle;
} TimelineGpuEventContext;

#pragma pack(pop)

typedef struct TimelineCpuEvent{
  uint16_t funcIndex;
  uint16_t opCount;
  const void* sendbuff;
  void* recvbuff;
  int root;
  size_t count;
  size_t nBytes;
  int nChannels;
  int nThreads;
  uint64_t beginTimestamp;
  uint64_t endTimestamp;
  char funcName[128];
} TimelineCpuEvent;

typedef struct  {
  std::map<uint16_t, TimelineCpuEvent*> * cpuCollEvent;
  std::map<uint16_t, TimelineCpuEvent*> * cpuP2pEvent;
} TimelineCpuEventContext;



#endif // _TIMELINE_STRUCT_H_