1
10
13
14
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
118
119
120
126
127
128
129
130
131
132
133
134
135
136
137
138
140
141
142
147
148
149
154
155
156
161
162
163
168
169
170
175
176
177
182
183
184
189
190
191
196
197
198
203
204
205
210
211
212
213
214
215
216
217
218
219
220
221
222
228
234
240
246
252
258
264
270
276
282
288
294
295
296
297
298
299
...
...
...
#define TX_SOURCE_CODE
#include "tx_api.h"
#include "tx_thread.h"
#ifdef TX_THREAD_ENABLE_PERFORMANCE_INFO
#include "tx_trace.h"
#endif
...
...
UINT _tx_thread_performance_info_get(TX_THREAD *thread_ptr, ULONG *resumptions, ULONG *suspensions,
ULONG *solicited_preemptions, ULONG *interrupt_preemptions, ULONG *priority_inversions,
ULONG *time_slices, ULONG *relinquishes, ULONG *timeouts, ULONG *wait_aborts, TX_THREAD **last_preempted_by)
{
#ifdef TX_THREAD_ENABLE_PERFORMANCE_INFO
TX_INTERRUPT_SAVE_AREA
UINT status;
if (thread_ptr == TX_NULL)
{
status = TX_PTR_ERROR;
}if (thread_ptr == TX_NULL) { ... }
else if (thread_ptr -> tx_thread_id != TX_THREAD_ID)
{
status = TX_PTR_ERROR;
}else if (thread_ptr -> tx_thread_id != TX_THREAD_ID) { ... }
else
{
TX_DISABLE
TX_TRACE_IN_LINE_INSERT(TX_TRACE_THREAD_PERFORMANCE_INFO_GET, thread_ptr, thread_ptr -> tx_thread_state, 0, 0, TX_TRACE_THREAD_EVENTS)
TX_EL_THREAD_PERFORMANCE_INFO_GET_INSERT
/* ... */
if (resumptions != TX_NULL)
{
*resumptions = thread_ptr -> tx_thread_performance_resume_count;
}if (resumptions != TX_NULL) { ... }
if (suspensions != TX_NULL)
{
*suspensions = thread_ptr -> tx_thread_performance_suspend_count;
}if (suspensions != TX_NULL) { ... }
if (solicited_preemptions != TX_NULL)
{
*solicited_preemptions = thread_ptr -> tx_thread_performance_solicited_preemption_count;
}if (solicited_preemptions != TX_NULL) { ... }
if (interrupt_preemptions != TX_NULL)
{
*interrupt_preemptions = thread_ptr -> tx_thread_performance_interrupt_preemption_count;
}if (interrupt_preemptions != TX_NULL) { ... }
if (priority_inversions != TX_NULL)
{
*priority_inversions = thread_ptr -> tx_thread_performance_priority_inversion_count;
}if (priority_inversions != TX_NULL) { ... }
if (time_slices != TX_NULL)
{
*time_slices = thread_ptr -> tx_thread_performance_time_slice_count;
}if (time_slices != TX_NULL) { ... }
if (relinquishes != TX_NULL)
{
*relinquishes = thread_ptr -> tx_thread_performance_relinquish_count;
}if (relinquishes != TX_NULL) { ... }
if (timeouts != TX_NULL)
{
*timeouts = thread_ptr -> tx_thread_performance_timeout_count;
}if (timeouts != TX_NULL) { ... }
if (wait_aborts != TX_NULL)
{
*wait_aborts = thread_ptr -> tx_thread_performance_wait_abort_count;
}if (wait_aborts != TX_NULL) { ... }
if (last_preempted_by != TX_NULL)
{
*last_preempted_by = thread_ptr -> tx_thread_performance_last_preempting_thread;
}if (last_preempted_by != TX_NULL) { ... }
TX_RESTORE
status = TX_SUCCESS;
}else { ... }
/* ... */#else
UINT status;
if (thread_ptr != TX_NULL)
{
status = TX_FEATURE_NOT_ENABLED;
}if (thread_ptr != TX_NULL) { ... }
else if (resumptions != TX_NULL)
{
status = TX_FEATURE_NOT_ENABLED;
}else if (resumptions != TX_NULL) { ... }
else if (suspensions != TX_NULL)
{
status = TX_FEATURE_NOT_ENABLED;
}else if (suspensions != TX_NULL) { ... }
else if (solicited_preemptions != TX_NULL)
{
status = TX_FEATURE_NOT_ENABLED;
}else if (solicited_preemptions != TX_NULL) { ... }
else if (interrupt_preemptions != TX_NULL)
{
status = TX_FEATURE_NOT_ENABLED;
}else if (interrupt_preemptions != TX_NULL) { ... }
else if (priority_inversions != TX_NULL)
{
status = TX_FEATURE_NOT_ENABLED;
}else if (priority_inversions != TX_NULL) { ... }
else if (time_slices != TX_NULL)
{
status = TX_FEATURE_NOT_ENABLED;
}else if (time_slices != TX_NULL) { ... }
else if (relinquishes != TX_NULL)
{
status = TX_FEATURE_NOT_ENABLED;
}else if (relinquishes != TX_NULL) { ... }
else if (timeouts != TX_NULL)
{
status = TX_FEATURE_NOT_ENABLED;
}else if (timeouts != TX_NULL) { ... }
else if (wait_aborts != TX_NULL)
{
status = TX_FEATURE_NOT_ENABLED;
}else if (wait_aborts != TX_NULL) { ... }
else if (last_preempted_by != TX_NULL)
{
status = TX_FEATURE_NOT_ENABLED;
}else if (last_preempted_by != TX_NULL) { ... }
else
{
status = TX_FEATURE_NOT_ENABLED;
}else { ... }
/* ... */#endif
return(status);
}{ ... }