|
35 | 35 | * @defgroup tracing_apis Tracing APIs
|
36 | 36 | * @{
|
37 | 37 | */
|
| 38 | + |
38 | 39 | /**
|
39 |
| - * @brief Called before a thread has been selected to run |
| 40 | + * @brief Called when entering an ISR |
40 | 41 | */
|
41 |
| -#define sys_trace_thread_switched_out() |
| 42 | +#define sys_trace_isr_enter() |
42 | 43 |
|
43 | 44 | /**
|
44 |
| - * @brief Called after a thread has been selected to run |
| 45 | + * @brief Called when exiting an ISR |
45 | 46 | */
|
46 |
| -#define sys_trace_thread_switched_in() |
| 47 | +#define sys_trace_isr_exit() |
47 | 48 |
|
48 | 49 | /**
|
49 |
| - * @brief Called when setting priority of a thread |
50 |
| - * @param thread Thread structure |
| 50 | + * @brief Called when exiting an ISR and switching to scheduler |
51 | 51 | */
|
52 |
| -#define sys_trace_thread_priority_set(thread) |
| 52 | +#define sys_trace_isr_exit_to_scheduler() |
53 | 53 |
|
54 | 54 | /**
|
55 |
| - * @brief Called when a thread is being created |
56 |
| - * @param thread Thread structure |
| 55 | + * @brief Called when the cpu enters the idle state |
57 | 56 | */
|
58 |
| -#define sys_trace_thread_create(thread) |
| 57 | +#define sys_trace_idle() |
| 58 | +/** |
| 59 | + * @} |
| 60 | + */ |
| 61 | + |
| 62 | + |
| 63 | +/** |
| 64 | + * @brief Tracing APIs |
| 65 | + * @defgroup tracing_apis Tracing APIs |
| 66 | + * @{ |
| 67 | + */ |
| 68 | + |
| 69 | + |
| 70 | +/** |
| 71 | + * @brief Thread Tracing APIs |
| 72 | + * @defgroup thread_tracing_apis Thread Tracing APIs |
| 73 | + * @ingroup tracing_apis |
| 74 | + * @{ |
| 75 | + */ |
| 76 | + |
| 77 | +/** |
| 78 | + * @brief Called when entering a k_thread_foreach call |
| 79 | + */ |
| 80 | +#define sys_port_trace_k_thread_foreach_enter() |
| 81 | + |
| 82 | +/** |
| 83 | + * @brief Called when exiting a k_thread_foreach call |
| 84 | + */ |
| 85 | +#define sys_port_trace_k_thread_foreach_exit() |
| 86 | + |
| 87 | +/** |
| 88 | + * @brief Called when entering a k_thread_foreach_unlocked |
| 89 | + */ |
| 90 | +#define sys_port_trace_k_thread_foreach_unlocked_enter() |
| 91 | + |
| 92 | +/** |
| 93 | + * @brief Called when exiting a k_thread_foreach_unlocked |
| 94 | + */ |
| 95 | +#define sys_port_trace_k_thread_foreach_unlocked_exit() |
| 96 | + |
| 97 | +/** |
| 98 | + * @brief Trace creating a Thread |
| 99 | + * @param new_thread Thread object |
| 100 | + */ |
| 101 | +#define sys_port_trace_k_thread_create(new_thread) |
| 102 | + |
| 103 | +/** |
| 104 | + * @brief Trace Thread entering user mode |
| 105 | + */ |
| 106 | +#define sys_port_trace_k_thread_user_mode_enter() |
| 107 | + |
| 108 | +/** |
| 109 | + * @brief Called when entering a k_thread_join |
| 110 | + * @param thread Thread object |
| 111 | + * @param timeout Timeout period |
| 112 | + */ |
| 113 | +#define sys_port_trace_k_thread_join_enter(thread, timeout) |
| 114 | + |
| 115 | +/** |
| 116 | + * @brief Called when k_thread_join blocks |
| 117 | + * @param thread Thread object |
| 118 | + * @param timeout Timeout period |
| 119 | + */ |
| 120 | +#define sys_port_trace_k_thread_join_blocking(thread, timeout) |
| 121 | + |
| 122 | +/** |
| 123 | + * @brief Called when exiting k_thread_join |
| 124 | + * @param thread Thread object |
| 125 | + * @param timeout Timeout period |
| 126 | + * @param ret Return value |
| 127 | + */ |
| 128 | +#define sys_port_trace_k_thread_join_exit(thread, timeout, ret) |
| 129 | + |
| 130 | +/** |
| 131 | + * @brief Called when entering k_thread_sleep |
| 132 | + * @param timeout Timeout period |
| 133 | + */ |
| 134 | +#define sys_port_trace_k_thread_sleep_enter(timeout) |
| 135 | + |
| 136 | +/** |
| 137 | + * @brief Called when exiting k_thread_sleep |
| 138 | + * @param timeout Timeout period |
| 139 | + * @param ret Return value |
| 140 | + */ |
| 141 | +#define sys_port_trace_k_thread_sleep_exit(timeout, ret) |
| 142 | + |
| 143 | +/** |
| 144 | + * @brief Called when entering k_thread_msleep |
| 145 | + * @param ms Duration in milliseconds |
| 146 | + */ |
| 147 | +#define sys_port_trace_k_thread_msleep_enter(ms) |
| 148 | + |
| 149 | +/** |
| 150 | + * @brief Called when exiting k_thread_msleep |
| 151 | + * @param ms Duration in milliseconds |
| 152 | + * @param ret Return value |
| 153 | + */ |
| 154 | +#define sys_port_trace_k_thread_msleep_exit(ms, ret) |
| 155 | + |
| 156 | +/** |
| 157 | + * @brief Called when entering k_thread_usleep |
| 158 | + * @param us Duration in microseconds |
| 159 | + */ |
| 160 | +#define sys_port_trace_k_thread_usleep_enter(us) |
| 161 | + |
| 162 | +/** |
| 163 | + * @brief Called when exiting k_thread_usleep |
| 164 | + * @param us Duration in microseconds |
| 165 | + * @param ret Return value |
| 166 | + */ |
| 167 | +#define sys_port_trace_k_thread_usleep_exit(us, ret) |
| 168 | + |
| 169 | +/** |
| 170 | + * @brief Called when entering k_thread_busy_wait |
| 171 | + * @param usec_to_wait Duration in microseconds |
| 172 | + */ |
| 173 | +#define sys_port_trace_k_thread_busy_wait_enter(usec_to_wait) |
| 174 | + |
| 175 | +/** |
| 176 | + * @brief Called when exiting k_thread_busy_wait |
| 177 | + * @param usec_to_wait Duration in microseconds |
| 178 | + */ |
| 179 | +#define sys_port_trace_k_thread_busy_wait_exit(usec_to_wait) |
| 180 | + |
| 181 | +/** |
| 182 | + * @brief Called when a thread yields |
| 183 | + */ |
| 184 | +#define sys_port_trace_k_thread_yield() |
| 185 | + |
| 186 | +/** |
| 187 | + * @brief Called when a thread wakes up |
| 188 | + * @param thread Thread object |
| 189 | + */ |
| 190 | +#define sys_port_trace_k_thread_wakeup(thread) |
| 191 | + |
| 192 | +/** |
| 193 | + * @brief Called when a thread is started |
| 194 | + * @param thread Thread object |
| 195 | + */ |
| 196 | +#define sys_port_trace_k_thread_start(thread) |
59 | 197 |
|
60 | 198 | /**
|
61 | 199 | * @brief Called when a thread is being aborted
|
62 |
| - * @param thread Thread structure |
63 |
| - * |
| 200 | + * @param thread Thread object |
| 201 | + */ |
| 202 | +#define sys_port_trace_k_thread_abort(thread) |
| 203 | + |
| 204 | +/** |
| 205 | + * @brief Called when setting priority of a thread |
| 206 | + * @param thread Thread object |
64 | 207 | */
|
65 |
| -#define sys_trace_thread_abort(thread) |
| 208 | +#define sys_port_trace_k_thread_priority_set(thread) |
66 | 209 |
|
67 | 210 | /**
|
68 | 211 | * @brief Called when a thread is being suspended
|
69 |
| - * @param thread Thread structure |
| 212 | + * @param thread Thread object |
70 | 213 | */
|
71 |
| -#define sys_trace_thread_suspend(thread) |
| 214 | +#define sys_port_trace_k_thread_suspend(thread) |
72 | 215 |
|
73 | 216 | /**
|
74 | 217 | * @brief Called when a thread is being resumed from suspension
|
75 |
| - * @param thread Thread structure |
| 218 | + * @param thread Thread object |
| 219 | + */ |
| 220 | +#define sys_port_trace_k_thread_resume(thread) |
| 221 | + |
| 222 | +/** |
| 223 | + * @brief Called when the thread scheduler is locked |
| 224 | + */ |
| 225 | +#define sys_port_trace_k_thread_sched_lock() |
| 226 | + |
| 227 | +/** |
| 228 | + * @brief Called when the thread sceduler is unlocked |
| 229 | + */ |
| 230 | +#define sys_port_trace_k_thread_sched_unlock() |
| 231 | + |
| 232 | +/** |
| 233 | + * @brief Called when a thread name is set |
| 234 | + * @param thread Thread object |
| 235 | + * @param ret Return value |
| 236 | + */ |
| 237 | +#define sys_port_trace_k_thread_name_set(thread, ret) |
| 238 | + |
| 239 | +/** |
| 240 | + * @brief Called before a thread has been selected to run |
| 241 | + */ |
| 242 | +#define sys_port_trace_k_thread_switched_out() |
| 243 | + |
| 244 | +/** |
| 245 | + * @brief Called after a thread has been selected to run |
76 | 246 | */
|
77 |
| -#define sys_trace_thread_resume(thread) |
| 247 | +#define sys_port_trace_k_thread_switched_in() |
78 | 248 |
|
79 | 249 | /**
|
80 | 250 | * @brief Called when a thread is ready to run
|
81 |
| - * @param thread Thread structure |
| 251 | + * @param thread Thread object |
82 | 252 | */
|
83 |
| -#define sys_trace_thread_ready(thread) |
| 253 | +#define sys_port_trace_k_thread_ready(thread) |
84 | 254 |
|
85 | 255 | /**
|
86 | 256 | * @brief Called when a thread is pending
|
87 |
| - * @param thread Thread structure |
| 257 | + * @param thread Thread object |
88 | 258 | */
|
89 |
| -#define sys_trace_thread_pend(thread) |
| 259 | +#define sys_port_trace_k_thread_pend(thread) |
90 | 260 |
|
91 | 261 | /**
|
92 | 262 | * @brief Provide information about specific thread
|
93 |
| - * @param thread Thread structure |
| 263 | + * @param thread Thread object |
94 | 264 | */
|
95 |
| -#define sys_trace_thread_info(thread) |
| 265 | +#define sys_port_trace_k_thread_info(thread) |
96 | 266 |
|
97 | 267 | /**
|
98 |
| - * @brief Called when a thread name is set |
99 |
| - * @param thread Thread structure |
| 268 | + * @brief Trace implicit thread wakup invocation by the scheduler |
| 269 | + * @param thread Thread object |
100 | 270 | */
|
101 |
| -#define sys_trace_thread_name_set(thread) |
| 271 | +#define sys_port_trace_k_thread_sched_wakeup(thread) |
102 | 272 |
|
103 | 273 | /**
|
104 |
| - * @brief Called when entering an ISR |
| 274 | + * @brief Trace implicit thread abort invocation by the scheduler |
| 275 | + * @param thread Thread object |
105 | 276 | */
|
106 |
| -#define sys_trace_isr_enter() |
| 277 | +#define sys_port_trace_k_thread_sched_abort(thread) |
107 | 278 |
|
108 | 279 | /**
|
109 |
| - * @brief Called when exiting an ISR |
| 280 | + * @brief Trace implicit thread set priority invocation by the scheduler |
| 281 | + * @param thread Thread object |
| 282 | + * @param prio Thread priority |
110 | 283 | */
|
111 |
| -#define sys_trace_isr_exit() |
| 284 | +#define sys_port_trace_k_thread_sched_priority_set(thread, prio) |
112 | 285 |
|
113 | 286 | /**
|
114 |
| - * @brief Called when exiting an ISR and switching to scheduler |
| 287 | + * @brief Trace implicit thread ready invocation by the scheduler |
| 288 | + * @param thread Thread object |
115 | 289 | */
|
116 |
| -#define sys_trace_isr_exit_to_scheduler() |
| 290 | +#define sys_port_trace_k_thread_sched_ready(thread) |
117 | 291 |
|
118 | 292 | /**
|
119 |
| - * @brief Can be called with any id signifying a new call |
120 |
| - * @param id ID of the operation that was started |
| 293 | + * @brief Trace implicit thread pend invocation by the scheduler |
| 294 | + * @param thread Thread object |
121 | 295 | */
|
122 |
| -#define sys_trace_void(id) |
| 296 | +#define sys_port_trace_k_thread_sched_pend(thread) |
123 | 297 |
|
124 | 298 | /**
|
125 |
| - * @brief Can be called with any id signifying ending a call |
126 |
| - * @param id ID of the operation that was completed |
| 299 | + * @brief Trace implicit thread resume invocation by the scheduler |
| 300 | + * @param thread Thread object |
127 | 301 | */
|
128 |
| -#define sys_trace_end_call(id) |
| 302 | +#define sys_port_trace_k_thread_sched_resume(thread) |
129 | 303 |
|
130 | 304 | /**
|
131 |
| - * @brief Called when the cpu enters the idle state |
| 305 | + * @brief Trace implicit thread suspend invocation by the scheduler |
| 306 | + * @param thread Thread object |
132 | 307 | */
|
133 |
| -#define sys_trace_idle() |
| 308 | +#define sys_port_trace_k_thread_sched_suspend(thread) |
| 309 | + |
134 | 310 | /**
|
135 | 311 | * @}
|
136 |
| - */ |
| 312 | + */ /* end of thread_tracing_apis */ |
137 | 313 |
|
138 | 314 |
|
139 |
| -/** |
140 |
| - * @brief Tracing APIs |
141 |
| - * @defgroup tracing_apis Tracing APIs |
142 |
| - * @{ |
143 |
| - */ |
144 | 315 |
|
145 | 316 |
|
146 | 317 | /**
|
|
0 commit comments