RTEMS 6.1-rc2
Loading...
Searching...
No Matches
record.h
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/*
4 * Copyright (C) 2018, 2020 embedded brains GmbH & Co. KG
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#ifndef _RTEMS_RECORD_H
29#define _RTEMS_RECORD_H
30
31#include "recorddata.h"
32
33#include <rtems/score/atomic.h>
34#include <rtems/score/cpu.h>
35#include <rtems/score/interr.h>
36#include <rtems/score/percpu.h>
38#include <rtems/counter.h>
39
40#ifdef __cplusplus
41extern "C" {
42#endif /* __cplusplus */
43
44typedef struct Record_Control {
45 Atomic_Uint head;
46 unsigned int tail;
47 unsigned int mask;
48 Watchdog_Control Watchdog;
49 rtems_record_item Header[ 3 ];
50 RTEMS_ALIGNED( CPU_CACHE_LINE_BYTES )
51 rtems_record_item Items[ RTEMS_ZERO_LENGTH_ARRAY ];
53
54typedef struct {
55 unsigned int item_count;
56 Record_Control *controls;
58
59typedef struct {
61 unsigned int head;
62 uint32_t now;
63 uint32_t level;
65
66extern const Record_Configuration _Record_Configuration;
67
68void _Record_Initialize( void );
69
70void _Record_Interrupt_initialize( void );
71
72bool _Record_Thread_create(
73 struct _Thread_Control *executing,
74 struct _Thread_Control *created
75);
76
77void _Record_Thread_start(
78 struct _Thread_Control *executing,
79 struct _Thread_Control *started
80);
81
82void _Record_Thread_restart(
83 struct _Thread_Control *executing,
84 struct _Thread_Control *restarted
85);
86
87void _Record_Thread_delete(
88 struct _Thread_Control *executing,
89 struct _Thread_Control *deleted
90);
91
92void _Record_Thread_switch(
93 struct _Thread_Control *executing,
94 struct _Thread_Control *heir
95);
96
97void _Record_Thread_begin( struct _Thread_Control *executing );
98
99void _Record_Thread_exitted( struct _Thread_Control *executing );
100
101void _Record_Fatal_dump_base64(
103 bool always_set_to_false,
104 Internal_errors_t code
105);
106
107void _Record_Fatal_dump_base64_zlib(
109 bool always_set_to_false,
110 Internal_errors_t code
111);
112
113void _Record_Thread_terminate(
114 struct _Thread_Control *executing
115);
116
117static inline unsigned int _Record_Index(
118 const Record_Control *control,
119 unsigned int index
120)
121{
122 return index & control->mask;
123}
124
125static inline unsigned int _Record_Head( const Record_Control *control )
126{
127 return _Atomic_Load_uint( &control->head, ATOMIC_ORDER_RELAXED );
128}
129
130static inline unsigned int _Record_Tail( const Record_Control *control )
131{
132 return control->tail;
133}
134
135static inline bool _Record_Is_overflow(
136 const Record_Control *control,
137 unsigned int tail,
138 unsigned int head
139)
140{
141 return head - tail >= control->mask + 1U;
142}
143
144static inline unsigned int _Record_Capacity(
145 const Record_Control *control,
146 unsigned int tail,
147 unsigned int head
148)
149{
150 return ( tail - head - 1U ) & control->mask;
151}
152
153static inline rtems_counter_ticks _Record_Now( void )
154{
155 return rtems_counter_read();
156}
157
158typedef struct RTEMS_PACKED {
159 uint32_t format;
160 uint32_t magic;
161 rtems_record_item Version;
162 rtems_record_item Processor_maximum;
163 rtems_record_item Count;
164 rtems_record_item Frequency;
165 rtems_record_item Info[64];
167
168size_t _Record_Stream_header_initialize( Record_Stream_header *header );
169
170size_t _Record_String_to_items(
171 rtems_record_event event,
172 const char *str,
173 size_t len,
174 rtems_record_item *items,
175 size_t item_count
176);
177
178void _Record_Caller( void *return_address );
179
180void _Record_Caller_3(
181 void *return_address,
182 rtems_record_event event,
184);
185
186void _Record_Caller_4(
187 void *return_address,
188 rtems_record_event event_0,
189 rtems_record_data data_0,
190 rtems_record_event event_1,
191 rtems_record_data data_1
192);
193
194void _Record_Caller_arg( void *return_address, rtems_record_data data );
195
196void _Record_Caller_arg_2(
197 void *return_address,
198 rtems_record_data data_0,
199 rtems_record_data data_1
200);
201
202void _Record_Caller_arg_3(
203 void *return_address,
204 rtems_record_data data_0,
205 rtems_record_data data_1,
206 rtems_record_data data_2
207);
208
209void _Record_Caller_arg_4(
210 void *return_address,
211 rtems_record_data data_0,
212 rtems_record_data data_1,
213 rtems_record_data data_2,
214 rtems_record_data data_3
215);
216
217void _Record_Caller_arg_5(
218 void *return_address,
219 rtems_record_data data_0,
220 rtems_record_data data_1,
221 rtems_record_data data_2,
222 rtems_record_data data_3,
223 rtems_record_data data_4
224);
225
226void _Record_Caller_arg_6(
227 void *return_address,
228 rtems_record_data data_0,
229 rtems_record_data data_1,
230 rtems_record_data data_2,
231 rtems_record_data data_3,
232 rtems_record_data data_4,
233 rtems_record_data data_5
234);
235
236void _Record_Caller_arg_7(
237 void *return_address,
238 rtems_record_data data_0,
239 rtems_record_data data_1,
240 rtems_record_data data_2,
241 rtems_record_data data_3,
242 rtems_record_data data_4,
243 rtems_record_data data_5,
244 rtems_record_data data_6
245);
246
247void _Record_Caller_arg_8(
248 void *return_address,
249 rtems_record_data data_0,
250 rtems_record_data data_1,
251 rtems_record_data data_2,
252 rtems_record_data data_3,
253 rtems_record_data data_4,
254 rtems_record_data data_5,
255 rtems_record_data data_6,
256 rtems_record_data data_7
257);
258
259void _Record_Caller_arg_9(
260 void *return_address,
261 rtems_record_data data_0,
262 rtems_record_data data_1,
263 rtems_record_data data_2,
264 rtems_record_data data_3,
265 rtems_record_data data_4,
266 rtems_record_data data_5,
267 rtems_record_data data_6,
268 rtems_record_data data_7,
269 rtems_record_data data_8
270);
271
272void _Record_Caller_arg_10(
273 void *return_address,
274 rtems_record_data data_0,
275 rtems_record_data data_1,
276 rtems_record_data data_2,
277 rtems_record_data data_3,
278 rtems_record_data data_4,
279 rtems_record_data data_5,
280 rtems_record_data data_6,
281 rtems_record_data data_7,
282 rtems_record_data data_8,
283 rtems_record_data data_9
284);
285
286void _Record_Entry_2(
287 void *return_address,
288 rtems_record_event event,
289 rtems_record_data data_0,
290 rtems_record_data data_1
291);
292
293void _Record_Entry_3(
294 void *return_address,
295 rtems_record_event event,
296 rtems_record_data data_0,
297 rtems_record_data data_1,
298 rtems_record_data data_2
299);
300
301void _Record_Entry_4(
302 void *return_address,
303 rtems_record_event event,
304 rtems_record_data data_0,
305 rtems_record_data data_1,
306 rtems_record_data data_2,
307 rtems_record_data data_3
308);
309
310void _Record_Entry_5(
311 void *return_address,
312 rtems_record_event event,
313 rtems_record_data data_0,
314 rtems_record_data data_1,
315 rtems_record_data data_2,
316 rtems_record_data data_3,
317 rtems_record_data data_4
318);
319
320void _Record_Entry_6(
321 void *return_address,
322 rtems_record_event event,
323 rtems_record_data data_0,
324 rtems_record_data data_1,
325 rtems_record_data data_2,
326 rtems_record_data data_3,
327 rtems_record_data data_4,
328 rtems_record_data data_5
329);
330
331void _Record_Entry_7(
332 void *return_address,
333 rtems_record_event event,
334 rtems_record_data data_0,
335 rtems_record_data data_1,
336 rtems_record_data data_2,
337 rtems_record_data data_3,
338 rtems_record_data data_4,
339 rtems_record_data data_5,
340 rtems_record_data data_6
341);
342
343void _Record_Entry_8(
344 void *return_address,
345 rtems_record_event event,
346 rtems_record_data data_0,
347 rtems_record_data data_1,
348 rtems_record_data data_2,
349 rtems_record_data data_3,
350 rtems_record_data data_4,
351 rtems_record_data data_5,
352 rtems_record_data data_6,
353 rtems_record_data data_7
354);
355
356void _Record_Entry_9(
357 void *return_address,
358 rtems_record_event event,
359 rtems_record_data data_0,
360 rtems_record_data data_1,
361 rtems_record_data data_2,
362 rtems_record_data data_3,
363 rtems_record_data data_4,
364 rtems_record_data data_5,
365 rtems_record_data data_6,
366 rtems_record_data data_7,
367 rtems_record_data data_8
368);
369
370void _Record_Entry_10(
371 void *return_address,
372 rtems_record_event event,
373 rtems_record_data data_0,
374 rtems_record_data data_1,
375 rtems_record_data data_2,
376 rtems_record_data data_3,
377 rtems_record_data data_4,
378 rtems_record_data data_5,
379 rtems_record_data data_6,
380 rtems_record_data data_7,
381 rtems_record_data data_8,
382 rtems_record_data data_9
383);
384
385void _Record_Exit_2(
386 void *return_address,
387 rtems_record_event event,
388 rtems_record_data data_0,
389 rtems_record_data data_1
390);
391
392void _Record_Exit_3(
393 void *return_address,
394 rtems_record_event event,
395 rtems_record_data data_0,
396 rtems_record_data data_1,
397 rtems_record_data data_2
398);
399
400void _Record_Exit_4(
401 void *return_address,
402 rtems_record_event event,
403 rtems_record_data data_0,
404 rtems_record_data data_1,
405 rtems_record_data data_2,
406 rtems_record_data data_3
407);
408
409void _Record_Exit_5(
410 void *return_address,
411 rtems_record_event event,
412 rtems_record_data data_0,
413 rtems_record_data data_1,
414 rtems_record_data data_2,
415 rtems_record_data data_3,
416 rtems_record_data data_4
417);
418
419void _Record_Exit_6(
420 void *return_address,
421 rtems_record_event event,
422 rtems_record_data data_0,
423 rtems_record_data data_1,
424 rtems_record_data data_2,
425 rtems_record_data data_3,
426 rtems_record_data data_4,
427 rtems_record_data data_5
428);
429
430void _Record_Exit_7(
431 void *return_address,
432 rtems_record_event event,
433 rtems_record_data data_0,
434 rtems_record_data data_1,
435 rtems_record_data data_2,
436 rtems_record_data data_3,
437 rtems_record_data data_4,
438 rtems_record_data data_5,
439 rtems_record_data data_6
440);
441
442void _Record_Exit_8(
443 void *return_address,
444 rtems_record_event event,
445 rtems_record_data data_0,
446 rtems_record_data data_1,
447 rtems_record_data data_2,
448 rtems_record_data data_3,
449 rtems_record_data data_4,
450 rtems_record_data data_5,
451 rtems_record_data data_6,
452 rtems_record_data data_7
453);
454
455void _Record_Exit_9(
456 void *return_address,
457 rtems_record_event event,
458 rtems_record_data data_0,
459 rtems_record_data data_1,
460 rtems_record_data data_2,
461 rtems_record_data data_3,
462 rtems_record_data data_4,
463 rtems_record_data data_5,
464 rtems_record_data data_6,
465 rtems_record_data data_7,
466 rtems_record_data data_8
467);
468
469void _Record_Exit_10(
470 void *return_address,
471 rtems_record_event event,
472 rtems_record_data data_0,
473 rtems_record_data data_1,
474 rtems_record_data data_2,
475 rtems_record_data data_3,
476 rtems_record_data data_4,
477 rtems_record_data data_5,
478 rtems_record_data data_6,
479 rtems_record_data data_7,
480 rtems_record_data data_8,
481 rtems_record_data data_9
482);
483
503static inline void rtems_record_prepare_critical(
505 const Per_CPU_Control *cpu_self
506)
507{
509 unsigned int head;
510
511 context->now = RTEMS_RECORD_TIME_EVENT( _Record_Now(), 0 );
512 control = cpu_self->record;
513 context->control = control;
514 head = _Record_Head( control );
515 context->head = head;
516}
517
529static inline void rtems_record_prepare( rtems_record_context *context )
530{
531 uint32_t level;
532 const Per_CPU_Control *cpu_self;
534 unsigned int head;
535
536 _CPU_ISR_Disable( level );
538 context->now = RTEMS_RECORD_TIME_EVENT( _Record_Now(), 0 );
539 context->level = level;
540 cpu_self = _Per_CPU_Get();
541 control = cpu_self->record;
542 context->control = control;
543 head = _Record_Head( control );
544 context->head = head;
545}
546
554static inline void rtems_record_add(
556 rtems_record_event event,
558)
559{
561 rtems_record_item *item;
562 unsigned int head;
563
564 control = context->control;
565 head = context->head;
566 item = &control->Items[ _Record_Index( control, head ) ];
567 context->head = head + 1;
568
569 item->event = context->now | event;
570 item->data = data;
571}
572
580static inline void rtems_record_commit_critical( rtems_record_context *context )
581{
582 _Atomic_Store_uint(
583 &context->control->head,
584 context->head,
585 ATOMIC_ORDER_RELEASE
586 );
587}
588
594static inline void rtems_record_commit( rtems_record_context *context )
595{
596 rtems_record_commit_critical( context );
598 _CPU_ISR_Enable( context->level );
599}
600
608
618 rtems_record_event event_0,
619 rtems_record_data data_0,
620 rtems_record_event event_1,
621 rtems_record_data data_1
622);
623
631 const rtems_record_item *items,
632 size_t n
633);
634
640void rtems_record_line( void );
641
651 rtems_record_event event,
653);
654
666 rtems_record_event event_0,
667 rtems_record_data data_0,
668 rtems_record_event event_1,
669 rtems_record_data data_1
670);
671
681
692 rtems_record_data data_0,
693 rtems_record_data data_1
694);
695
707 rtems_record_data data_0,
708 rtems_record_data data_1,
709 rtems_record_data data_2
710);
711
724 rtems_record_data data_0,
725 rtems_record_data data_1,
726 rtems_record_data data_2,
727 rtems_record_data data_3
728);
729
743 rtems_record_data data_0,
744 rtems_record_data data_1,
745 rtems_record_data data_2,
746 rtems_record_data data_3,
747 rtems_record_data data_4
748);
749
764 rtems_record_data data_0,
765 rtems_record_data data_1,
766 rtems_record_data data_2,
767 rtems_record_data data_3,
768 rtems_record_data data_4,
769 rtems_record_data data_5
770);
771
787 rtems_record_data data_0,
788 rtems_record_data data_1,
789 rtems_record_data data_2,
790 rtems_record_data data_3,
791 rtems_record_data data_4,
792 rtems_record_data data_5,
793 rtems_record_data data_6
794);
795
812 rtems_record_data data_0,
813 rtems_record_data data_1,
814 rtems_record_data data_2,
815 rtems_record_data data_3,
816 rtems_record_data data_4,
817 rtems_record_data data_5,
818 rtems_record_data data_6,
819 rtems_record_data data_7
820);
821
839 rtems_record_data data_0,
840 rtems_record_data data_1,
841 rtems_record_data data_2,
842 rtems_record_data data_3,
843 rtems_record_data data_4,
844 rtems_record_data data_5,
845 rtems_record_data data_6,
846 rtems_record_data data_7,
847 rtems_record_data data_8
848);
849
868 rtems_record_data data_0,
869 rtems_record_data data_1,
870 rtems_record_data data_2,
871 rtems_record_data data_3,
872 rtems_record_data data_4,
873 rtems_record_data data_5,
874 rtems_record_data data_6,
875 rtems_record_data data_7,
876 rtems_record_data data_8,
877 rtems_record_data data_9
878);
879
889#define rtems_record_caller() _Record_Caller( RTEMS_RETURN_ADDRESS() )
890
904#define rtems_record_caller_3( event, data ) \
905 _Record_Caller_3( RTEMS_RETURN_ADDRESS(), event, data )
906
922#define rtems_record_caller_4( event_0, data_0, event_1, data_1 ) \
923 _Record_Caller_4( \
924 RTEMS_RETURN_ADDRESS(), \
925 event_0, \
926 data_0, \
927 event_1, \
928 data_1 \
929 )
930
943#define rtems_record_caller_arg( data ) \
944 _Record_Caller_arg( RTEMS_RETURN_ADDRESS(), data )
945
959#define rtems_record_caller_arg_2( data_0, data_1 ) \
960 _Record_Caller_arg_2( \
961 RTEMS_RETURN_ADDRESS(), \
962 data_0, \
963 data_1 \
964 )
965
980#define rtems_record_caller_arg_3( data_0, data_1, data_2 ) \
981 _Record_Caller_arg_3( \
982 RTEMS_RETURN_ADDRESS(), \
983 data_0, \
984 data_1, \
985 data_2 \
986 )
987
1003#define rtems_record_caller_arg_4( data_0, data_1, data_2, data_3 ) \
1004 _Record_Caller_arg_4( \
1005 RTEMS_RETURN_ADDRESS(), \
1006 data_0, \
1007 data_1, \
1008 data_2, \
1009 data_3 \
1010 )
1011
1028#define rtems_record_caller_arg_5( data_0, data_1, data_2, data_3, data_4 ) \
1029 _Record_Caller_arg_5( \
1030 RTEMS_RETURN_ADDRESS(), \
1031 data_0, \
1032 data_1, \
1033 data_2, \
1034 data_3, \
1035 data_4 \
1036 )
1037
1055#define rtems_record_caller_arg_6( \
1056 data_0, \
1057 data_1, \
1058 data_2, \
1059 data_3, \
1060 data_4, \
1061 data_5 \
1062) \
1063 _Record_Caller_arg_6( \
1064 RTEMS_RETURN_ADDRESS(), \
1065 data_0, \
1066 data_1, \
1067 data_2, \
1068 data_3, \
1069 data_4, \
1070 data_5 \
1071 )
1072
1091#define rtems_record_caller_arg_7( \
1092 data_0, \
1093 data_1, \
1094 data_2, \
1095 data_3, \
1096 data_4, \
1097 data_5, \
1098 data_6 \
1099) \
1100 _Record_Caller_arg_7( \
1101 RTEMS_RETURN_ADDRESS(), \
1102 data_0, \
1103 data_1, \
1104 data_2, \
1105 data_3, \
1106 data_4, \
1107 data_5, \
1108 data_6 \
1109 )
1110
1130#define rtems_record_caller_arg_8( \
1131 data_0, \
1132 data_1, \
1133 data_2, \
1134 data_3, \
1135 data_4, \
1136 data_5, \
1137 data_6, \
1138 data_7 \
1139) \
1140 _Record_Caller_arg_8( \
1141 RTEMS_RETURN_ADDRESS(), \
1142 data_0, \
1143 data_1, \
1144 data_2, \
1145 data_3, \
1146 data_4, \
1147 data_5, \
1148 data_6, \
1149 data_7 \
1150 )
1151
1172#define rtems_record_caller_arg_9( \
1173 data_0, \
1174 data_1, \
1175 data_2, \
1176 data_3, \
1177 data_4, \
1178 data_5, \
1179 data_6, \
1180 data_7, \
1181 data_8 \
1182) \
1183 _Record_Caller_arg_9( \
1184 RTEMS_RETURN_ADDRESS(), \
1185 data_0, \
1186 data_1, \
1187 data_2, \
1188 data_3, \
1189 data_4, \
1190 data_5, \
1191 data_6, \
1192 data_7, \
1193 data_8 \
1194 )
1195
1217#define rtems_record_caller_arg_10( \
1218 data_0, \
1219 data_1, \
1220 data_2, \
1221 data_3, \
1222 data_4, \
1223 data_5, \
1224 data_6, \
1225 data_7, \
1226 data_8, \
1227 data_9 \
1228) \
1229 _Record_Caller_arg_10( \
1230 RTEMS_RETURN_ADDRESS(), \
1231 data_0, \
1232 data_1, \
1233 data_2, \
1234 data_3, \
1235 data_4, \
1236 data_5, \
1237 data_6, \
1238 data_7, \
1239 data_8, \
1240 data_9 \
1241 )
1242
1251#define rtems_record_entry( event ) \
1252 rtems_record_produce( event, (rtems_record_data) RTEMS_RETURN_ADDRESS() )
1253
1263#define rtems_record_entry_1( event, data ) \
1264 rtems_record_produce_2( \
1265 event, \
1266 (rtems_record_data) RTEMS_RETURN_ADDRESS(), \
1267 RTEMS_RECORD_ARG_0, \
1268 data \
1269 )
1270
1281#define rtems_record_entry_2( event, data_0, data_1 ) \
1282 _Record_Entry_2( RTEMS_RETURN_ADDRESS(), event, data_0, data_1 )
1283
1295#define rtems_record_entry_3( event, data_0, data_1, data_2 ) \
1296 _Record_Entry_3( \
1297 RTEMS_RETURN_ADDRESS(), \
1298 event, \
1299 data_0, \
1300 data_1, \
1301 data_2 \
1302 )
1303
1316#define rtems_record_entry_4( event, data_0, data_1, data_2, data_3 ) \
1317 _Record_Entry_4( \
1318 RTEMS_RETURN_ADDRESS(), \
1319 event, \
1320 data_0, \
1321 data_1, \
1322 data_2, \
1323 data_3 \
1324 )
1325
1339#define rtems_record_entry_5( \
1340 event, \
1341 data_0, \
1342 data_1, \
1343 data_2, \
1344 data_3, \
1345 data_4 \
1346) \
1347 _Record_Entry_5( \
1348 RTEMS_RETURN_ADDRESS(), \
1349 event, \
1350 data_0, \
1351 data_1, \
1352 data_2, \
1353 data_3, \
1354 data_4 \
1355 )
1356
1371#define rtems_record_entry_6( \
1372 event, \
1373 data_0, \
1374 data_1, \
1375 data_2, \
1376 data_3, \
1377 data_4, \
1378 data_5 \
1379) \
1380 _Record_Entry_6( \
1381 RTEMS_RETURN_ADDRESS(), \
1382 event, \
1383 data_0, \
1384 data_1, \
1385 data_2, \
1386 data_3, \
1387 data_4, \
1388 data_5 \
1389 )
1390
1406#define rtems_record_entry_7( \
1407 event, \
1408 data_0, \
1409 data_1, \
1410 data_2, \
1411 data_3, \
1412 data_4, \
1413 data_5, \
1414 data_6 \
1415) \
1416 _Record_Entry_7( \
1417 RTEMS_RETURN_ADDRESS(), \
1418 event, \
1419 data_0, \
1420 data_1, \
1421 data_2, \
1422 data_3, \
1423 data_4, \
1424 data_5, \
1425 data_6 \
1426 )
1427
1444#define rtems_record_entry_8( \
1445 event, \
1446 data_0, \
1447 data_1, \
1448 data_2, \
1449 data_3, \
1450 data_4, \
1451 data_5, \
1452 data_6, \
1453 data_7 \
1454) \
1455 _Record_Entry_8( \
1456 RTEMS_RETURN_ADDRESS(), \
1457 event, \
1458 data_0, \
1459 data_1, \
1460 data_2, \
1461 data_3, \
1462 data_4, \
1463 data_5, \
1464 data_6, \
1465 data_7 \
1466 )
1467
1485#define rtems_record_entry_9( \
1486 event, \
1487 data_0, \
1488 data_1, \
1489 data_2, \
1490 data_3, \
1491 data_4, \
1492 data_5, \
1493 data_6, \
1494 data_7, \
1495 data_8 \
1496) \
1497 _Record_Entry_9( \
1498 RTEMS_RETURN_ADDRESS(), \
1499 event, \
1500 data_0, \
1501 data_1, \
1502 data_2, \
1503 data_3, \
1504 data_4, \
1505 data_5, \
1506 data_6, \
1507 data_7, \
1508 data_8 \
1509 )
1510
1529#define rtems_record_entry_10( \
1530 event, \
1531 data_0, \
1532 data_1, \
1533 data_2, \
1534 data_3, \
1535 data_4, \
1536 data_5, \
1537 data_6, \
1538 data_7, \
1539 data_8, \
1540 data_9 \
1541) \
1542 _Record_Entry_10( \
1543 RTEMS_RETURN_ADDRESS(), \
1544 event, \
1545 data_0, \
1546 data_1, \
1547 data_2, \
1548 data_3, \
1549 data_4, \
1550 data_5, \
1551 data_6, \
1552 data_7, \
1553 data_8, \
1554 data_9 \
1555 )
1556
1565#define rtems_record_exit( event ) \
1566 rtems_record_produce( event, (rtems_record_data) RTEMS_RETURN_ADDRESS() )
1567
1577#define rtems_record_exit_1( event, data ) \
1578 rtems_record_produce_2( \
1579 event, \
1580 (rtems_record_data) RTEMS_RETURN_ADDRESS(), \
1581 RTEMS_RECORD_RETURN_0, \
1582 data \
1583 )
1584
1595#define rtems_record_exit_2( event, data_0, data_1 ) \
1596 _Record_Entry_2( RTEMS_RETURN_ADDRESS(), event, data_0, data_1 )
1597
1609#define rtems_record_exit_3( event, data_0, data_1, data_2 ) \
1610 _Record_Exit_3( \
1611 RTEMS_RETURN_ADDRESS(), \
1612 event, \
1613 data_0, \
1614 data_1, \
1615 data_2 \
1616 )
1617
1630#define rtems_record_exit_4( event, data_0, data_1, data_2, data_3 ) \
1631 _Record_Exit_4( \
1632 RTEMS_RETURN_ADDRESS(), \
1633 event, \
1634 data_0, \
1635 data_1, \
1636 data_2, \
1637 data_3 \
1638 )
1639
1653#define rtems_record_exit_5( \
1654 event, \
1655 data_0, \
1656 data_1, \
1657 data_2, \
1658 data_3, \
1659 data_4 \
1660) \
1661 _Record_Exit_5( \
1662 RTEMS_RETURN_ADDRESS(), \
1663 event, \
1664 data_0, \
1665 data_1, \
1666 data_2, \
1667 data_3, \
1668 data_4 \
1669 )
1670
1685#define rtems_record_exit_6( \
1686 event, \
1687 data_0, \
1688 data_1, \
1689 data_2, \
1690 data_3, \
1691 data_4, \
1692 data_5 \
1693) \
1694 _Record_Exit_6( \
1695 RTEMS_RETURN_ADDRESS(), \
1696 event, \
1697 data_0, \
1698 data_1, \
1699 data_2, \
1700 data_3, \
1701 data_4, \
1702 data_5 \
1703 )
1704
1720#define rtems_record_exit_7( \
1721 event, \
1722 data_0, \
1723 data_1, \
1724 data_2, \
1725 data_3, \
1726 data_4, \
1727 data_5, \
1728 data_6 \
1729) \
1730 _Record_Exit_7( \
1731 RTEMS_RETURN_ADDRESS(), \
1732 event, \
1733 data_0, \
1734 data_1, \
1735 data_2, \
1736 data_3, \
1737 data_4, \
1738 data_5, \
1739 data_6 \
1740 )
1741
1758#define rtems_record_exit_8( \
1759 event, \
1760 data_0, \
1761 data_1, \
1762 data_2, \
1763 data_3, \
1764 data_4, \
1765 data_5, \
1766 data_6, \
1767 data_7 \
1768) \
1769 _Record_Exit_8( \
1770 RTEMS_RETURN_ADDRESS(), \
1771 event, \
1772 data_0, \
1773 data_1, \
1774 data_2, \
1775 data_3, \
1776 data_4, \
1777 data_5, \
1778 data_6, \
1779 data_7 \
1780 )
1781
1799#define rtems_record_exit_9( \
1800 event, \
1801 data_0, \
1802 data_1, \
1803 data_2, \
1804 data_3, \
1805 data_4, \
1806 data_5, \
1807 data_6, \
1808 data_7, \
1809 data_8 \
1810) \
1811 _Record_Exit_9( \
1812 RTEMS_RETURN_ADDRESS(), \
1813 event, \
1814 data_0, \
1815 data_1, \
1816 data_2, \
1817 data_3, \
1818 data_4, \
1819 data_5, \
1820 data_6, \
1821 data_7, \
1822 data_8 \
1823 )
1824
1843#define rtems_record_exit_10( \
1844 event, \
1845 data_0, \
1846 data_1, \
1847 data_2, \
1848 data_3, \
1849 data_4, \
1850 data_5, \
1851 data_6, \
1852 data_7, \
1853 data_8, \
1854 data_9 \
1855) \
1856 _Record_Exit_10( \
1857 RTEMS_RETURN_ADDRESS(), \
1858 event, \
1859 data_0, \
1860 data_1, \
1861 data_2, \
1862 data_3, \
1863 data_4, \
1864 data_5, \
1865 data_6, \
1866 data_7, \
1867 data_8, \
1868 data_9 \
1869 )
1870
1876uint32_t rtems_record_interrupt_disable( void );
1877
1885void rtems_record_interrupt_enable( uint32_t level );
1886
1887typedef void ( *rtems_record_drain_visitor )(
1888 const rtems_record_item *items,
1889 size_t count,
1890 void *arg
1891);
1892
1893void _Record_Drain(
1895 uint32_t cpu_index,
1896 rtems_record_drain_visitor visitor,
1897 void *arg
1898);
1899
1908void rtems_record_drain( rtems_record_drain_visitor visitor, void *arg );
1909
1912#ifdef __cplusplus
1913}
1914#endif /* __cplusplus */
1915
1916#endif /* _RTEMS_RECORD_H */
This header file defines the Free-Running Counter and Busy Wait Delay API.
This header file provides interfaces of the Watchdog Handler which are used by the implementation and...
#define RTEMS_ALIGNED(_alignment)
Instructs the compiler in a declaration or definition to enforce the alignment.
Definition: basedefs.h:157
#define RTEMS_COMPILER_MEMORY_BARRIER()
This macro forbids the compiler to reorder read and write commands around it.
Definition: basedefs.h:258
#define RTEMS_ZERO_LENGTH_ARRAY
This constant represents the element count of a zero-length array.
Definition: basedefs.h:1032
CPU_Counter_ticks rtems_counter_ticks
Unsigned integer type for counter values.
Definition: counter.h:76
void rtems_record_line_arg(rtems_record_data data)
Generates an RTEMS_RECORD_LINE event and one argument event.
Definition: record-util.c:73
void rtems_record_produce(rtems_record_event event, rtems_record_data data)
Produces a record item.
Definition: record.c:47
#define RTEMS_RECORD_TIME_EVENT(time, event)
Builds a time event for the specified time stamp and event.
Definition: recorddata.h:1150
void rtems_record_line_arg_10(rtems_record_data data_0, rtems_record_data data_1, rtems_record_data data_2, rtems_record_data data_3, rtems_record_data data_4, rtems_record_data data_5, rtems_record_data data_6, rtems_record_data data_7, rtems_record_data data_8, rtems_record_data data_9)
Generates an RTEMS_RECORD_LINE event and ten argument events.
Definition: record-util.c:295
void rtems_record_line_arg_4(rtems_record_data data_0, rtems_record_data data_1, rtems_record_data data_2, rtems_record_data data_3)
Generates an RTEMS_RECORD_LINE event and four argument events.
Definition: record-util.c:118
void rtems_record_line_arg_6(rtems_record_data data_0, rtems_record_data data_1, rtems_record_data data_2, rtems_record_data data_3, rtems_record_data data_4, rtems_record_data data_5)
Generates an RTEMS_RECORD_LINE event and six argument events.
Definition: record-util.c:165
void rtems_record_line_arg_2(rtems_record_data data_0, rtems_record_data data_1)
Generates an RTEMS_RECORD_LINE event and two argument events.
Definition: record-util.c:83
void rtems_record_line_arg_9(rtems_record_data data_0, rtems_record_data data_1, rtems_record_data data_2, rtems_record_data data_3, rtems_record_data data_4, rtems_record_data data_5, rtems_record_data data_6, rtems_record_data data_7, rtems_record_data data_8)
Generates an RTEMS_RECORD_LINE event and nine argument events.
Definition: record-util.c:258
void rtems_record_line_arg_5(rtems_record_data data_0, rtems_record_data data_1, rtems_record_data data_2, rtems_record_data data_3, rtems_record_data data_4)
Generates an RTEMS_RECORD_LINE event and five argument events.
Definition: record-util.c:140
void rtems_record_produce_n(const rtems_record_item *items, size_t n)
Produces n record items.
Definition: record.c:71
void rtems_record_line_2(rtems_record_event event, rtems_record_data data)
Generates an RTEMS_RECORD_LINE event and an extra event.
Definition: record-util.c:42
void rtems_record_line_arg_8(rtems_record_data data_0, rtems_record_data data_1, rtems_record_data data_2, rtems_record_data data_3, rtems_record_data data_4, rtems_record_data data_5, rtems_record_data data_6, rtems_record_data data_7)
Generates an RTEMS_RECORD_LINE event and eight argument events.
Definition: record-util.c:224
uint32_t rtems_record_interrupt_disable(void)
Disables interrupts and generates an RTEMS_RECORD_ISR_DISABLE event.
Definition: record-util.c:1215
void rtems_record_drain(rtems_record_drain_visitor visitor, void *arg)
Drains the record items on all processors.
Definition: record.c:172
void rtems_record_produce_2(rtems_record_event event_0, rtems_record_data data_0, rtems_record_event event_1, rtems_record_data data_1)
Produces two record items.
Definition: record.c:56
void rtems_record_line_arg_3(rtems_record_data data_0, rtems_record_data data_1, rtems_record_data data_2)
Generates an RTEMS_RECORD_LINE event and three argument events.
Definition: record-util.c:99
unsigned long rtems_record_data
The record data integer type.
Definition: recorddata.h:1170
rtems_record_event
The record events.
Definition: recorddata.h:90
void rtems_record_interrupt_enable(uint32_t level)
Restores the previous interrupt level and generates an RTEMS_RECORD_ISR_ENABLE event.
Definition: record-util.c:1232
void rtems_record_line_arg_7(rtems_record_data data_0, rtems_record_data data_1, rtems_record_data data_2, rtems_record_data data_3, rtems_record_data data_4, rtems_record_data data_5, rtems_record_data data_6)
Generates an RTEMS_RECORD_LINE event and seven argument events.
Definition: record-util.c:193
void rtems_record_line_3(rtems_record_event event_0, rtems_record_data data_0, rtems_record_event event_1, rtems_record_data data_1)
Generates an RTEMS_RECORD_LINE event and two extra events.
Definition: record-util.c:55
void rtems_record_line(void)
Generates an RTEMS_RECORD_LINE event.
Definition: record-util.c:34
Internal_errors_Source
This type lists the possible sources from which an error can be reported.
Definition: interr.h:63
This header file provides the interfaces of the Atomic Operations.
This header file provides the interfaces of the Internal Error Handler.
rtems_termios_device_context * context
Definition: console-config.c:62
This header file provides the interfaces of the Per-CPU Information.
Per CPU Core Structure.
Definition: percpu.h:384
Used for passing and retrieving registers content to/from real mode interrupt call.
Definition: realmode_int.h:43
Definition: record.h:54
Definition: record.h:44
The control block used to manage each watchdog timer.
Definition: watchdog.h:109
Definition: thread.h:812
Definition: inftrees.h:24
Definition: intercom.c:87
Definition: mknod-pack_dev.c:254
Definition: record.h:59