forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtracing.h
126 lines (99 loc) · 2.81 KB
/
tracing.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/*
* Copyright (c) 2018 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _KERNEL_TRACE_H
#define _KERNEL_TRACE_H
#include <kernel.h>
/* Below IDs are used with systemview, not final to the zephyr tracing API */
#define SYS_TRACE_ID_OFFSET (32u)
#define SYS_TRACE_ID_MUTEX_INIT (1u + SYS_TRACE_ID_OFFSET)
#define SYS_TRACE_ID_MUTEX_UNLOCK (2u + SYS_TRACE_ID_OFFSET)
#define SYS_TRACE_ID_MUTEX_LOCK (3u + SYS_TRACE_ID_OFFSET)
#define SYS_TRACE_ID_SEMA_INIT (4u + SYS_TRACE_ID_OFFSET)
#define SYS_TRACE_ID_SEMA_GIVE (5u + SYS_TRACE_ID_OFFSET)
#define SYS_TRACE_ID_SEMA_TAKE (6u + SYS_TRACE_ID_OFFSET)
#if CONFIG_TRACING
void z_sys_trace_idle(void);
void z_sys_trace_isr_enter(void);
void z_sys_trace_isr_exit_to_scheduler(void);
void z_sys_trace_thread_switched_in(void);
#endif
#ifdef CONFIG_SEGGER_SYSTEMVIEW
#include "tracing_sysview.h"
#else
/**
* @brief Called before a thread has been selected to run
*/
#define sys_trace_thread_switched_out()
/**
* @brief Called after a thread has been selected to run
*/
#define sys_trace_thread_switched_in()
/**
* @brief Called when setting priority of a thread
*/
#define sys_trace_thread_priority_set(thread)
/**
* @brief Called when a thread is being created
*/
#define sys_trace_thread_create(thread)
/**
* @brief Called when a thread is being aborted
*
*/
#define sys_trace_thread_abort(thread)
/**
* @brief Called when a thread is being suspended
* @param thread Thread structure
*/
#define sys_trace_thread_suspend(thread)
/**
* @brief Called when a thread is being resumed from suspension
* @param thread Thread structure
*/
#define sys_trace_thread_resume(thread)
/**
* @brief Called when a thread is ready to run
* @param thread Thread structure
*/
#define sys_trace_thread_ready(thread)
/**
* @brief Called when a thread is pending
* @param thread Thread structure
*/
#define sys_trace_thread_pend(thread)
/**
* @brief Provide information about specific thread
* @param thread Thread structure
*/
#define sys_trace_thread_info(thread)
/**
* @brief Called when entering an ISR
*/
#define sys_trace_isr_enter()
/**
* @brief Called when exiting an ISR
*/
#define sys_trace_isr_exit()
/**
* @brief Called when exiting an ISR and switching to scheduler
*/
#define sys_trace_isr_exit_to_scheduler()
/**
* @brief Can be called with any id signifying a new call
* @param id ID of the operation that was started
*/
#define sys_trace_void(id)
/**
* @brief Can be called with any id signifying ending a call
* @param id ID of the operation that was completed
*/
#define sys_trace_end_call(id)
#define z_sys_trace_idle()
#define z_sys_trace_isr_enter()
#define z_sys_trace_isr_exit_to_scheduler()
#define z_sys_trace_thread_switched_in()
#endif
#endif