-
Notifications
You must be signed in to change notification settings - Fork 7
/
timeline.h
63 lines (53 loc) · 1015 Bytes
/
timeline.h
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
/*
* Copyright (c) 2017-2018 Mellanox Technologies Ltd. ALL RIGHTS RESERVED.
*
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef TIMELINE_H
#define TIMELINE_H
typedef enum {
EVENT_POST,
EVENT_WAIT
} mtcomb_event_t;
#define COLOR_1 "#00A2DE"
#define COLOR_2 "#101073"
typedef struct {
mtcomb_event_t type;
double start, end;
} timeline_event_t;
typedef struct {
int thr_id;
int num_events;
#ifdef STANDALONE
timeline_event_t events[100];
#else
timeline_event_t *events;
#endif
} thread_timeline_t;
typedef struct {
int proc_id;
int thr_num;
#ifdef STANDALONE
thread_timeline_t threads[8];
#else
thread_timeline_t *threads;
#endif
} proc_timeline_t;
typedef struct {
int proc_num;
#ifdef STANDALONE
proc_timeline_t procs[8];
#else
proc_timeline_t *procs;
#endif
} timeline_t;
typedef struct {
int thr_id;
int proc_id;
} resource_map_t;
int write_timeline(timeline_t *tl, char *fname);
#endif // TIMELINE_H