diff options
Diffstat (limited to 'include/timestamp.h')
-rw-r--r-- | include/timestamp.h | 53 |
1 files changed, 42 insertions, 11 deletions
diff --git a/include/timestamp.h b/include/timestamp.h index 75ab79a..81d7a79 100644 --- a/include/timestamp.h +++ b/include/timestamp.h | |||
@@ -6,7 +6,10 @@ | |||
6 | enum task_type_marker { | 6 | enum task_type_marker { |
7 | TSK_BE, | 7 | TSK_BE, |
8 | TSK_RT, | 8 | TSK_RT, |
9 | TSK_UNKNOWN | 9 | TSK_UNKNOWN, |
10 | TSK_LVLA, | ||
11 | TSK_LVLB, | ||
12 | TSK_LVLC | ||
10 | }; | 13 | }; |
11 | 14 | ||
12 | struct timestamp { | 15 | struct timestamp { |
@@ -14,13 +17,22 @@ struct timestamp { | |||
14 | uint32_t seq_no; | 17 | uint32_t seq_no; |
15 | uint8_t cpu; | 18 | uint8_t cpu; |
16 | uint8_t event; | 19 | uint8_t event; |
17 | uint8_t task_type:2; | 20 | uint8_t task_type:3; |
18 | uint8_t irq_flag:1; | 21 | uint8_t irq_flag:1; |
19 | uint8_t irq_count:5; | 22 | uint8_t irq_count:4; |
20 | }; | 23 | }; |
21 | 24 | ||
22 | typedef uint32_t cmd_t; | 25 | typedef uint32_t cmd_t; |
23 | 26 | ||
27 | static inline unsigned int ts_pid_fragment(struct timestamp* ts) | ||
28 | { | ||
29 | unsigned int hi, lo; | ||
30 | |||
31 | hi = ts->cpu; | ||
32 | lo = ts->task_type; | ||
33 | return (hi << 8) | lo; | ||
34 | } | ||
35 | |||
24 | int str2event(const char* str, cmd_t *id); | 36 | int str2event(const char* str, cmd_t *id); |
25 | const char* event2str(cmd_t id); | 37 | const char* event2str(cmd_t id); |
26 | const char* task_type2str(int task_type); | 38 | const char* task_type2str(int task_type); |
@@ -36,6 +48,15 @@ const char* task_type2str(int task_type); | |||
36 | #define TS_SYSCALL_OUT_START TIMESTAMP(20) | 48 | #define TS_SYSCALL_OUT_START TIMESTAMP(20) |
37 | #define TS_SYSCALL_OUT_END TIMESTAMP(21) | 49 | #define TS_SYSCALL_OUT_END TIMESTAMP(21) |
38 | 50 | ||
51 | #define TS_LOCK_START TIMESTAMP(30) | ||
52 | #define TS_LOCK_SUSPEND TIMESTAMP(31) | ||
53 | #define TS_LOCK_RESUME TIMESTAMP(32) | ||
54 | #define TS_LOCK_END TIMESTAMP(33) | ||
55 | |||
56 | #define TS_UNLOCK_START TIMESTAMP(40) | ||
57 | #define TS_UNLOCK_END TIMESTAMP(41) | ||
58 | |||
59 | #define PID_RECORDS_RANGE 99 | ||
39 | 60 | ||
40 | #define TS_SCHED_START TIMESTAMP(100) | 61 | #define TS_SCHED_START TIMESTAMP(100) |
41 | #define TS_SCHED_END TIMESTAMP(101) | 62 | #define TS_SCHED_END TIMESTAMP(101) |
@@ -51,20 +72,30 @@ const char* task_type2str(int task_type); | |||
51 | #define TS_TICK_START TIMESTAMP(110) | 72 | #define TS_TICK_START TIMESTAMP(110) |
52 | #define TS_TICK_END TIMESTAMP(111) | 73 | #define TS_TICK_END TIMESTAMP(111) |
53 | 74 | ||
75 | #define TS_LVLA_RELEASE_START TIMESTAMP(112) | ||
76 | #define TS_LVLA_RELEASE_END TIMESTAMP(113) | ||
77 | |||
78 | #define TS_LVLA_SCHED_START TIMESTAMP(114) | ||
79 | #define TS_LVLA_SCHED_END TIMESTAMP(115) | ||
80 | |||
81 | #define TS_LVLB_RELEASE_START TIMESTAMP(116) | ||
82 | #define TS_LVLB_RELEASE_END TIMESTAMP(117) | ||
83 | |||
84 | #define TS_LVLB_SCHED_START TIMESTAMP(118) | ||
85 | #define TS_LVLB_SCHED_END TIMESTAMP(119) | ||
86 | |||
87 | #define TS_LVLC_RELEASE_START TIMESTAMP(120) | ||
88 | #define TS_LVLC_RELEASE_END TIMESTAMP(121) | ||
89 | |||
90 | #define TS_LVLC_SCHED_START TIMESTAMP(122) | ||
91 | #define TS_LVLC_SCHED_END TIMESTAMP(123) | ||
92 | |||
54 | #define TS_PLUGIN_SCHED_START TIMESTAMP(120) | 93 | #define TS_PLUGIN_SCHED_START TIMESTAMP(120) |
55 | #define TS_PLUGIN_SCHED_END TIMESTAMP(121) | 94 | #define TS_PLUGIN_SCHED_END TIMESTAMP(121) |
56 | 95 | ||
57 | #define TS_PLUGIN_TICK_START TIMESTAMP(130) | 96 | #define TS_PLUGIN_TICK_START TIMESTAMP(130) |
58 | #define TS_PLUGIN_TICK_END TIMESTAMP(131) | 97 | #define TS_PLUGIN_TICK_END TIMESTAMP(131) |
59 | 98 | ||
60 | #define TS_LOCK_START TIMESTAMP(170) | ||
61 | #define TS_LOCK_SUSPEND TIMESTAMP(171) | ||
62 | #define TS_LOCK_RESUME TIMESTAMP(172) | ||
63 | #define TS_LOCK_END TIMESTAMP(173) | ||
64 | |||
65 | #define TS_UNLOCK_START TIMESTAMP(180) | ||
66 | #define TS_UNLOCK_END TIMESTAMP(181) | ||
67 | |||
68 | #define TS_SEND_RESCHED_START TIMESTAMP(190) | 99 | #define TS_SEND_RESCHED_START TIMESTAMP(190) |
69 | #define TS_SEND_RESCHED_END TIMESTAMP(191) | 100 | #define TS_SEND_RESCHED_END TIMESTAMP(191) |
70 | 101 | ||