RTEMS 6.1-rc7
Loading...
Searching...
No Matches
record.h
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/*
4 * Copyright (C) 2018, 2024 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_ALIGNED( CPU_CACHE_LINE_BYTES )
50 rtems_record_item Items[ RTEMS_ZERO_LENGTH_ARRAY ];
52
53typedef struct {
54 unsigned int item_count;
55 Record_Control *controls;
57
58typedef struct {
60 unsigned int head;
61 uint32_t now;
62 uint32_t level;
64
65extern const Record_Configuration _Record_Configuration;
66
67void _Record_Initialize( void );
68
69void _Record_Interrupt_initialize( void );
70
71bool _Record_Thread_create(
72 struct _Thread_Control *executing,
73 struct _Thread_Control *created
74);
75
76void _Record_Thread_start(
77 struct _Thread_Control *executing,
78 struct _Thread_Control *started
79);
80
81void _Record_Thread_restart(
82 struct _Thread_Control *executing,
83 struct _Thread_Control *restarted
84);
85
86void _Record_Thread_delete(
87 struct _Thread_Control *executing,
88 struct _Thread_Control *deleted
89);
90
91void _Record_Thread_switch(
92 struct _Thread_Control *executing,
93 struct _Thread_Control *heir
94);
95
96void _Record_Thread_begin( struct _Thread_Control *executing );
97
98void _Record_Thread_exitted( struct _Thread_Control *executing );
99
100void _Record_Fatal_dump_base64(
102 bool always_set_to_false,
103 Internal_errors_t code
104);
105
106void _Record_Fatal_dump_base64_zlib(
108 bool always_set_to_false,
109 Internal_errors_t code
110);
111
112void _Record_Thread_terminate(
113 struct _Thread_Control *executing
114);
115
116static inline unsigned int _Record_Index(
117 const Record_Control *control,
118 unsigned int index
119)
120{
121 return index & control->mask;
122}
123
124static inline unsigned int _Record_Head( Record_Control *control )
125{
126#ifdef RTEMS_SMP
127 /*
128 * Use a read-modify-write operation to get the last value stored by the
129 * record producer.
130 */
131 return _Atomic_Fetch_add_uint( &control->head, 0, ATOMIC_ORDER_ACQUIRE );
132#else
133 return _Atomic_Load_uint( &control->head, ATOMIC_ORDER_ACQUIRE );
134#endif
135}
136
137static inline unsigned int _Record_Tail( const Record_Control *control )
138{
139 return control->tail;
140}
141
142static inline bool _Record_Is_overflow(
143 const Record_Control *control,
144 unsigned int tail,
145 unsigned int head
146)
147{
148 return head - tail >= control->mask + 1U;
149}
150
151static inline unsigned int _Record_Capacity(
152 const Record_Control *control,
153 unsigned int tail,
154 unsigned int head
155)
156{
157 return ( tail - head - 1U ) & control->mask;
158}
159
160static inline rtems_counter_ticks _Record_Now( void )
161{
162 return rtems_counter_read();
163}
164
165typedef struct RTEMS_PACKED {
166 uint32_t format;
167 uint32_t magic;
168 rtems_record_item Version;
169 rtems_record_item Processor_maximum;
170 rtems_record_item Count;
171 rtems_record_item Frequency;
172 rtems_record_item Info[64];
174
175size_t _Record_Stream_header_initialize( Record_Stream_header *header );
176
177size_t _Record_String_to_items(
178 rtems_record_event event,
179 const char *str,
180 size_t len,
181 rtems_record_item *items,
182 size_t item_count
183);
184
185void _Record_Caller( void *return_address );
186
187void _Record_Caller_3(
188 void *return_address,
189 rtems_record_event event,
191);
192
193void _Record_Caller_4(
194 void *return_address,
195 rtems_record_event event_0,
196 rtems_record_data data_0,
197 rtems_record_event event_1,
198 rtems_record_data data_1
199);
200
201void _Record_Caller_arg( void *return_address, rtems_record_data data );
202
203void _Record_Caller_arg_2(
204 void *return_address,
205 rtems_record_data data_0,
206 rtems_record_data data_1
207);
208
209void _Record_Caller_arg_3(
210 void *return_address,
211 rtems_record_data data_0,
212 rtems_record_data data_1,
213 rtems_record_data data_2
214);
215
216void _Record_Caller_arg_4(
217 void *return_address,
218 rtems_record_data data_0,
219 rtems_record_data data_1,
220 rtems_record_data data_2,
221 rtems_record_data data_3
222);
223
224void _Record_Caller_arg_5(
225 void *return_address,
226 rtems_record_data data_0,
227 rtems_record_data data_1,
228 rtems_record_data data_2,
229 rtems_record_data data_3,
230 rtems_record_data data_4
231);
232
233void _Record_Caller_arg_6(
234 void *return_address,
235 rtems_record_data data_0,
236 rtems_record_data data_1,
237 rtems_record_data data_2,
238 rtems_record_data data_3,
239 rtems_record_data data_4,
240 rtems_record_data data_5
241);
242
243void _Record_Caller_arg_7(
244 void *return_address,
245 rtems_record_data data_0,
246 rtems_record_data data_1,
247 rtems_record_data data_2,
248 rtems_record_data data_3,
249 rtems_record_data data_4,
250 rtems_record_data data_5,
251 rtems_record_data data_6
252);
253
254void _Record_Caller_arg_8(
255 void *return_address,
256 rtems_record_data data_0,
257 rtems_record_data data_1,
258 rtems_record_data data_2,
259 rtems_record_data data_3,
260 rtems_record_data data_4,
261 rtems_record_data data_5,
262 rtems_record_data data_6,
263 rtems_record_data data_7
264);
265
266void _Record_Caller_arg_9(
267 void *return_address,
268 rtems_record_data data_0,
269 rtems_record_data data_1,
270 rtems_record_data data_2,
271 rtems_record_data data_3,
272 rtems_record_data data_4,
273 rtems_record_data data_5,
274 rtems_record_data data_6,
275 rtems_record_data data_7,
276 rtems_record_data data_8
277);
278
279void _Record_Caller_arg_10(
280 void *return_address,
281 rtems_record_data data_0,
282 rtems_record_data data_1,
283 rtems_record_data data_2,
284 rtems_record_data data_3,
285 rtems_record_data data_4,
286 rtems_record_data data_5,
287 rtems_record_data data_6,
288 rtems_record_data data_7,
289 rtems_record_data data_8,
290 rtems_record_data data_9
291);
292
293void _Record_Entry_2(
294 void *return_address,
295 rtems_record_event event,
296 rtems_record_data data_0,
297 rtems_record_data data_1
298);
299
300void _Record_Entry_3(
301 void *return_address,
302 rtems_record_event event,
303 rtems_record_data data_0,
304 rtems_record_data data_1,
305 rtems_record_data data_2
306);
307
308void _Record_Entry_4(
309 void *return_address,
310 rtems_record_event event,
311 rtems_record_data data_0,
312 rtems_record_data data_1,
313 rtems_record_data data_2,
314 rtems_record_data data_3
315);
316
317void _Record_Entry_5(
318 void *return_address,
319 rtems_record_event event,
320 rtems_record_data data_0,
321 rtems_record_data data_1,
322 rtems_record_data data_2,
323 rtems_record_data data_3,
324 rtems_record_data data_4
325);
326
327void _Record_Entry_6(
328 void *return_address,
329 rtems_record_event event,
330 rtems_record_data data_0,
331 rtems_record_data data_1,
332 rtems_record_data data_2,
333 rtems_record_data data_3,
334 rtems_record_data data_4,
335 rtems_record_data data_5
336);
337
338void _Record_Entry_7(
339 void *return_address,
340 rtems_record_event event,
341 rtems_record_data data_0,
342 rtems_record_data data_1,
343 rtems_record_data data_2,
344 rtems_record_data data_3,
345 rtems_record_data data_4,
346 rtems_record_data data_5,
347 rtems_record_data data_6
348);
349
350void _Record_Entry_8(
351 void *return_address,
352 rtems_record_event event,
353 rtems_record_data data_0,
354 rtems_record_data data_1,
355 rtems_record_data data_2,
356 rtems_record_data data_3,
357 rtems_record_data data_4,
358 rtems_record_data data_5,
359 rtems_record_data data_6,
360 rtems_record_data data_7
361);
362
363void _Record_Entry_9(
364 void *return_address,
365 rtems_record_event event,
366 rtems_record_data data_0,
367 rtems_record_data data_1,
368 rtems_record_data data_2,
369 rtems_record_data data_3,
370 rtems_record_data data_4,
371 rtems_record_data data_5,
372 rtems_record_data data_6,
373 rtems_record_data data_7,
374 rtems_record_data data_8
375);
376
377void _Record_Entry_10(
378 void *return_address,
379 rtems_record_event event,
380 rtems_record_data data_0,
381 rtems_record_data data_1,
382 rtems_record_data data_2,
383 rtems_record_data data_3,
384 rtems_record_data data_4,
385 rtems_record_data data_5,
386 rtems_record_data data_6,
387 rtems_record_data data_7,
388 rtems_record_data data_8,
389 rtems_record_data data_9
390);
391
392void _Record_Exit_2(
393 void *return_address,
394 rtems_record_event event,
395 rtems_record_data data_0,
396 rtems_record_data data_1
397);
398
399void _Record_Exit_3(
400 void *return_address,
401 rtems_record_event event,
402 rtems_record_data data_0,
403 rtems_record_data data_1,
404 rtems_record_data data_2
405);
406
407void _Record_Exit_4(
408 void *return_address,
409 rtems_record_event event,
410 rtems_record_data data_0,
411 rtems_record_data data_1,
412 rtems_record_data data_2,
413 rtems_record_data data_3
414);
415
416void _Record_Exit_5(
417 void *return_address,
418 rtems_record_event event,
419 rtems_record_data data_0,
420 rtems_record_data data_1,
421 rtems_record_data data_2,
422 rtems_record_data data_3,
423 rtems_record_data data_4
424);
425
426void _Record_Exit_6(
427 void *return_address,
428 rtems_record_event event,
429 rtems_record_data data_0,
430 rtems_record_data data_1,
431 rtems_record_data data_2,
432 rtems_record_data data_3,
433 rtems_record_data data_4,
434 rtems_record_data data_5
435);
436
437void _Record_Exit_7(
438 void *return_address,
439 rtems_record_event event,
440 rtems_record_data data_0,
441 rtems_record_data data_1,
442 rtems_record_data data_2,
443 rtems_record_data data_3,
444 rtems_record_data data_4,
445 rtems_record_data data_5,
446 rtems_record_data data_6
447);
448
449void _Record_Exit_8(
450 void *return_address,
451 rtems_record_event event,
452 rtems_record_data data_0,
453 rtems_record_data data_1,
454 rtems_record_data data_2,
455 rtems_record_data data_3,
456 rtems_record_data data_4,
457 rtems_record_data data_5,
458 rtems_record_data data_6,
459 rtems_record_data data_7
460);
461
462void _Record_Exit_9(
463 void *return_address,
464 rtems_record_event event,
465 rtems_record_data data_0,
466 rtems_record_data data_1,
467 rtems_record_data data_2,
468 rtems_record_data data_3,
469 rtems_record_data data_4,
470 rtems_record_data data_5,
471 rtems_record_data data_6,
472 rtems_record_data data_7,
473 rtems_record_data data_8
474);
475
476void _Record_Exit_10(
477 void *return_address,
478 rtems_record_event event,
479 rtems_record_data data_0,
480 rtems_record_data data_1,
481 rtems_record_data data_2,
482 rtems_record_data data_3,
483 rtems_record_data data_4,
484 rtems_record_data data_5,
485 rtems_record_data data_6,
486 rtems_record_data data_7,
487 rtems_record_data data_8,
488 rtems_record_data data_9
489);
490
510static inline void rtems_record_prepare_critical(
512 const Per_CPU_Control *cpu_self
513)
514{
516 unsigned int head;
517
518 context->now = RTEMS_RECORD_TIME_EVENT( _Record_Now(), 0 );
519 control = cpu_self->record;
520 context->control = control;
521 head = _Record_Head( control );
522 context->head = head;
523}
524
536static inline void rtems_record_prepare( rtems_record_context *context )
537{
538 uint32_t level;
539 const Per_CPU_Control *cpu_self;
541 unsigned int head;
542
543 _CPU_ISR_Disable( level );
545 context->now = RTEMS_RECORD_TIME_EVENT( _Record_Now(), 0 );
546 context->level = level;
547 cpu_self = _Per_CPU_Get();
548 control = cpu_self->record;
549 context->control = control;
550 head = _Record_Head( control );
551 context->head = head;
552}
553
561static inline void rtems_record_add(
563 rtems_record_event event,
565)
566{
568 rtems_record_item *item;
569 unsigned int head;
570
571 control = context->control;
572 head = context->head;
573 item = &control->Items[ _Record_Index( control, head ) ];
574 context->head = head + 1;
575
576 item->event = context->now | event;
577 item->data = data;
578}
579
587static inline void rtems_record_commit_critical( rtems_record_context *context )
588{
589 _Atomic_Store_uint(
590 &context->control->head,
591 context->head,
592 ATOMIC_ORDER_RELEASE
593 );
594}
595
601static inline void rtems_record_commit( rtems_record_context *context )
602{
603 rtems_record_commit_critical( context );
605 _CPU_ISR_Enable( context->level );
606}
607
615
625 rtems_record_event event_0,
626 rtems_record_data data_0,
627 rtems_record_event event_1,
628 rtems_record_data data_1
629);
630
638 const rtems_record_item *items,
639 size_t n
640);
641
647void rtems_record_line( void );
648
658 rtems_record_event event,
660);
661
673 rtems_record_event event_0,
674 rtems_record_data data_0,
675 rtems_record_event event_1,
676 rtems_record_data data_1
677);
678
688
699 rtems_record_data data_0,
700 rtems_record_data data_1
701);
702
714 rtems_record_data data_0,
715 rtems_record_data data_1,
716 rtems_record_data data_2
717);
718
731 rtems_record_data data_0,
732 rtems_record_data data_1,
733 rtems_record_data data_2,
734 rtems_record_data data_3
735);
736
750 rtems_record_data data_0,
751 rtems_record_data data_1,
752 rtems_record_data data_2,
753 rtems_record_data data_3,
754 rtems_record_data data_4
755);
756
771 rtems_record_data data_0,
772 rtems_record_data data_1,
773 rtems_record_data data_2,
774 rtems_record_data data_3,
775 rtems_record_data data_4,
776 rtems_record_data data_5
777);
778
794 rtems_record_data data_0,
795 rtems_record_data data_1,
796 rtems_record_data data_2,
797 rtems_record_data data_3,
798 rtems_record_data data_4,
799 rtems_record_data data_5,
800 rtems_record_data data_6
801);
802
819 rtems_record_data data_0,
820 rtems_record_data data_1,
821 rtems_record_data data_2,
822 rtems_record_data data_3,
823 rtems_record_data data_4,
824 rtems_record_data data_5,
825 rtems_record_data data_6,
826 rtems_record_data data_7
827);
828
846 rtems_record_data data_0,
847 rtems_record_data data_1,
848 rtems_record_data data_2,
849 rtems_record_data data_3,
850 rtems_record_data data_4,
851 rtems_record_data data_5,
852 rtems_record_data data_6,
853 rtems_record_data data_7,
854 rtems_record_data data_8
855);
856
875 rtems_record_data data_0,
876 rtems_record_data data_1,
877 rtems_record_data data_2,
878 rtems_record_data data_3,
879 rtems_record_data data_4,
880 rtems_record_data data_5,
881 rtems_record_data data_6,
882 rtems_record_data data_7,
883 rtems_record_data data_8,
884 rtems_record_data data_9
885);
886
896#define rtems_record_caller() _Record_Caller( RTEMS_RETURN_ADDRESS() )
897
911#define rtems_record_caller_3( event, data ) \
912 _Record_Caller_3( RTEMS_RETURN_ADDRESS(), event, data )
913
929#define rtems_record_caller_4( event_0, data_0, event_1, data_1 ) \
930 _Record_Caller_4( \
931 RTEMS_RETURN_ADDRESS(), \
932 event_0, \
933 data_0, \
934 event_1, \
935 data_1 \
936 )
937
950#define rtems_record_caller_arg( data ) \
951 _Record_Caller_arg( RTEMS_RETURN_ADDRESS(), data )
952
966#define rtems_record_caller_arg_2( data_0, data_1 ) \
967 _Record_Caller_arg_2( \
968 RTEMS_RETURN_ADDRESS(), \
969 data_0, \
970 data_1 \
971 )
972
987#define rtems_record_caller_arg_3( data_0, data_1, data_2 ) \
988 _Record_Caller_arg_3( \
989 RTEMS_RETURN_ADDRESS(), \
990 data_0, \
991 data_1, \
992 data_2 \
993 )
994
1010#define rtems_record_caller_arg_4( data_0, data_1, data_2, data_3 ) \
1011 _Record_Caller_arg_4( \
1012 RTEMS_RETURN_ADDRESS(), \
1013 data_0, \
1014 data_1, \
1015 data_2, \
1016 data_3 \
1017 )
1018
1035#define rtems_record_caller_arg_5( data_0, data_1, data_2, data_3, data_4 ) \
1036 _Record_Caller_arg_5( \
1037 RTEMS_RETURN_ADDRESS(), \
1038 data_0, \
1039 data_1, \
1040 data_2, \
1041 data_3, \
1042 data_4 \
1043 )
1044
1062#define rtems_record_caller_arg_6( \
1063 data_0, \
1064 data_1, \
1065 data_2, \
1066 data_3, \
1067 data_4, \
1068 data_5 \
1069) \
1070 _Record_Caller_arg_6( \
1071 RTEMS_RETURN_ADDRESS(), \
1072 data_0, \
1073 data_1, \
1074 data_2, \
1075 data_3, \
1076 data_4, \
1077 data_5 \
1078 )
1079
1098#define rtems_record_caller_arg_7( \
1099 data_0, \
1100 data_1, \
1101 data_2, \
1102 data_3, \
1103 data_4, \
1104 data_5, \
1105 data_6 \
1106) \
1107 _Record_Caller_arg_7( \
1108 RTEMS_RETURN_ADDRESS(), \
1109 data_0, \
1110 data_1, \
1111 data_2, \
1112 data_3, \
1113 data_4, \
1114 data_5, \
1115 data_6 \
1116 )
1117
1137#define rtems_record_caller_arg_8( \
1138 data_0, \
1139 data_1, \
1140 data_2, \
1141 data_3, \
1142 data_4, \
1143 data_5, \
1144 data_6, \
1145 data_7 \
1146) \
1147 _Record_Caller_arg_8( \
1148 RTEMS_RETURN_ADDRESS(), \
1149 data_0, \
1150 data_1, \
1151 data_2, \
1152 data_3, \
1153 data_4, \
1154 data_5, \
1155 data_6, \
1156 data_7 \
1157 )
1158
1179#define rtems_record_caller_arg_9( \
1180 data_0, \
1181 data_1, \
1182 data_2, \
1183 data_3, \
1184 data_4, \
1185 data_5, \
1186 data_6, \
1187 data_7, \
1188 data_8 \
1189) \
1190 _Record_Caller_arg_9( \
1191 RTEMS_RETURN_ADDRESS(), \
1192 data_0, \
1193 data_1, \
1194 data_2, \
1195 data_3, \
1196 data_4, \
1197 data_5, \
1198 data_6, \
1199 data_7, \
1200 data_8 \
1201 )
1202
1224#define rtems_record_caller_arg_10( \
1225 data_0, \
1226 data_1, \
1227 data_2, \
1228 data_3, \
1229 data_4, \
1230 data_5, \
1231 data_6, \
1232 data_7, \
1233 data_8, \
1234 data_9 \
1235) \
1236 _Record_Caller_arg_10( \
1237 RTEMS_RETURN_ADDRESS(), \
1238 data_0, \
1239 data_1, \
1240 data_2, \
1241 data_3, \
1242 data_4, \
1243 data_5, \
1244 data_6, \
1245 data_7, \
1246 data_8, \
1247 data_9 \
1248 )
1249
1258#define rtems_record_entry( event ) \
1259 rtems_record_produce( event, (rtems_record_data) RTEMS_RETURN_ADDRESS() )
1260
1270#define rtems_record_entry_1( event, data ) \
1271 rtems_record_produce_2( \
1272 event, \
1273 (rtems_record_data) RTEMS_RETURN_ADDRESS(), \
1274 RTEMS_RECORD_ARG_0, \
1275 data \
1276 )
1277
1288#define rtems_record_entry_2( event, data_0, data_1 ) \
1289 _Record_Entry_2( RTEMS_RETURN_ADDRESS(), event, data_0, data_1 )
1290
1302#define rtems_record_entry_3( event, data_0, data_1, data_2 ) \
1303 _Record_Entry_3( \
1304 RTEMS_RETURN_ADDRESS(), \
1305 event, \
1306 data_0, \
1307 data_1, \
1308 data_2 \
1309 )
1310
1323#define rtems_record_entry_4( event, data_0, data_1, data_2, data_3 ) \
1324 _Record_Entry_4( \
1325 RTEMS_RETURN_ADDRESS(), \
1326 event, \
1327 data_0, \
1328 data_1, \
1329 data_2, \
1330 data_3 \
1331 )
1332
1346#define rtems_record_entry_5( \
1347 event, \
1348 data_0, \
1349 data_1, \
1350 data_2, \
1351 data_3, \
1352 data_4 \
1353) \
1354 _Record_Entry_5( \
1355 RTEMS_RETURN_ADDRESS(), \
1356 event, \
1357 data_0, \
1358 data_1, \
1359 data_2, \
1360 data_3, \
1361 data_4 \
1362 )
1363
1378#define rtems_record_entry_6( \
1379 event, \
1380 data_0, \
1381 data_1, \
1382 data_2, \
1383 data_3, \
1384 data_4, \
1385 data_5 \
1386) \
1387 _Record_Entry_6( \
1388 RTEMS_RETURN_ADDRESS(), \
1389 event, \
1390 data_0, \
1391 data_1, \
1392 data_2, \
1393 data_3, \
1394 data_4, \
1395 data_5 \
1396 )
1397
1413#define rtems_record_entry_7( \
1414 event, \
1415 data_0, \
1416 data_1, \
1417 data_2, \
1418 data_3, \
1419 data_4, \
1420 data_5, \
1421 data_6 \
1422) \
1423 _Record_Entry_7( \
1424 RTEMS_RETURN_ADDRESS(), \
1425 event, \
1426 data_0, \
1427 data_1, \
1428 data_2, \
1429 data_3, \
1430 data_4, \
1431 data_5, \
1432 data_6 \
1433 )
1434
1451#define rtems_record_entry_8( \
1452 event, \
1453 data_0, \
1454 data_1, \
1455 data_2, \
1456 data_3, \
1457 data_4, \
1458 data_5, \
1459 data_6, \
1460 data_7 \
1461) \
1462 _Record_Entry_8( \
1463 RTEMS_RETURN_ADDRESS(), \
1464 event, \
1465 data_0, \
1466 data_1, \
1467 data_2, \
1468 data_3, \
1469 data_4, \
1470 data_5, \
1471 data_6, \
1472 data_7 \
1473 )
1474
1492#define rtems_record_entry_9( \
1493 event, \
1494 data_0, \
1495 data_1, \
1496 data_2, \
1497 data_3, \
1498 data_4, \
1499 data_5, \
1500 data_6, \
1501 data_7, \
1502 data_8 \
1503) \
1504 _Record_Entry_9( \
1505 RTEMS_RETURN_ADDRESS(), \
1506 event, \
1507 data_0, \
1508 data_1, \
1509 data_2, \
1510 data_3, \
1511 data_4, \
1512 data_5, \
1513 data_6, \
1514 data_7, \
1515 data_8 \
1516 )
1517
1536#define rtems_record_entry_10( \
1537 event, \
1538 data_0, \
1539 data_1, \
1540 data_2, \
1541 data_3, \
1542 data_4, \
1543 data_5, \
1544 data_6, \
1545 data_7, \
1546 data_8, \
1547 data_9 \
1548) \
1549 _Record_Entry_10( \
1550 RTEMS_RETURN_ADDRESS(), \
1551 event, \
1552 data_0, \
1553 data_1, \
1554 data_2, \
1555 data_3, \
1556 data_4, \
1557 data_5, \
1558 data_6, \
1559 data_7, \
1560 data_8, \
1561 data_9 \
1562 )
1563
1572#define rtems_record_exit( event ) \
1573 rtems_record_produce( event, (rtems_record_data) RTEMS_RETURN_ADDRESS() )
1574
1584#define rtems_record_exit_1( event, data ) \
1585 rtems_record_produce_2( \
1586 event, \
1587 (rtems_record_data) RTEMS_RETURN_ADDRESS(), \
1588 RTEMS_RECORD_RETURN_0, \
1589 data \
1590 )
1591
1602#define rtems_record_exit_2( event, data_0, data_1 ) \
1603 _Record_Entry_2( RTEMS_RETURN_ADDRESS(), event, data_0, data_1 )
1604
1616#define rtems_record_exit_3( event, data_0, data_1, data_2 ) \
1617 _Record_Exit_3( \
1618 RTEMS_RETURN_ADDRESS(), \
1619 event, \
1620 data_0, \
1621 data_1, \
1622 data_2 \
1623 )
1624
1637#define rtems_record_exit_4( event, data_0, data_1, data_2, data_3 ) \
1638 _Record_Exit_4( \
1639 RTEMS_RETURN_ADDRESS(), \
1640 event, \
1641 data_0, \
1642 data_1, \
1643 data_2, \
1644 data_3 \
1645 )
1646
1660#define rtems_record_exit_5( \
1661 event, \
1662 data_0, \
1663 data_1, \
1664 data_2, \
1665 data_3, \
1666 data_4 \
1667) \
1668 _Record_Exit_5( \
1669 RTEMS_RETURN_ADDRESS(), \
1670 event, \
1671 data_0, \
1672 data_1, \
1673 data_2, \
1674 data_3, \
1675 data_4 \
1676 )
1677
1692#define rtems_record_exit_6( \
1693 event, \
1694 data_0, \
1695 data_1, \
1696 data_2, \
1697 data_3, \
1698 data_4, \
1699 data_5 \
1700) \
1701 _Record_Exit_6( \
1702 RTEMS_RETURN_ADDRESS(), \
1703 event, \
1704 data_0, \
1705 data_1, \
1706 data_2, \
1707 data_3, \
1708 data_4, \
1709 data_5 \
1710 )
1711
1727#define rtems_record_exit_7( \
1728 event, \
1729 data_0, \
1730 data_1, \
1731 data_2, \
1732 data_3, \
1733 data_4, \
1734 data_5, \
1735 data_6 \
1736) \
1737 _Record_Exit_7( \
1738 RTEMS_RETURN_ADDRESS(), \
1739 event, \
1740 data_0, \
1741 data_1, \
1742 data_2, \
1743 data_3, \
1744 data_4, \
1745 data_5, \
1746 data_6 \
1747 )
1748
1765#define rtems_record_exit_8( \
1766 event, \
1767 data_0, \
1768 data_1, \
1769 data_2, \
1770 data_3, \
1771 data_4, \
1772 data_5, \
1773 data_6, \
1774 data_7 \
1775) \
1776 _Record_Exit_8( \
1777 RTEMS_RETURN_ADDRESS(), \
1778 event, \
1779 data_0, \
1780 data_1, \
1781 data_2, \
1782 data_3, \
1783 data_4, \
1784 data_5, \
1785 data_6, \
1786 data_7 \
1787 )
1788
1806#define rtems_record_exit_9( \
1807 event, \
1808 data_0, \
1809 data_1, \
1810 data_2, \
1811 data_3, \
1812 data_4, \
1813 data_5, \
1814 data_6, \
1815 data_7, \
1816 data_8 \
1817) \
1818 _Record_Exit_9( \
1819 RTEMS_RETURN_ADDRESS(), \
1820 event, \
1821 data_0, \
1822 data_1, \
1823 data_2, \
1824 data_3, \
1825 data_4, \
1826 data_5, \
1827 data_6, \
1828 data_7, \
1829 data_8 \
1830 )
1831
1850#define rtems_record_exit_10( \
1851 event, \
1852 data_0, \
1853 data_1, \
1854 data_2, \
1855 data_3, \
1856 data_4, \
1857 data_5, \
1858 data_6, \
1859 data_7, \
1860 data_8, \
1861 data_9 \
1862) \
1863 _Record_Exit_10( \
1864 RTEMS_RETURN_ADDRESS(), \
1865 event, \
1866 data_0, \
1867 data_1, \
1868 data_2, \
1869 data_3, \
1870 data_4, \
1871 data_5, \
1872 data_6, \
1873 data_7, \
1874 data_8, \
1875 data_9 \
1876 )
1877
1883uint32_t rtems_record_interrupt_disable( void );
1884
1892void rtems_record_interrupt_enable( uint32_t level );
1893
1899typedef struct {
1904 rtems_record_item *fetched_items;
1905
1911
1916 struct {
1917#ifdef RTEMS_SMP
1922 uint32_t cpu_index;
1923#endif
1924
1929 size_t cpu_todo;
1930
1934 rtems_record_item *storage_items;
1935
1941 } internal;
1943
1948typedef enum {
1954
1960
1967
1976
1993 rtems_record_item *items,
1994 size_t count
1995);
1996
2019);
2020
2023#ifdef __cplusplus
2024}
2025#endif /* __cplusplus */
2026
2027#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
rtems_record_fetch_status rtems_record_fetch(rtems_record_fetch_control *control)
Fetches records from the record buffers of the processors.
Definition: record-fetch.c:73
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:1167
rtems_record_fetch_status
This enumeration provides status codes returned by rtems_record_fetch().
Definition: record.h:1948
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_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:1187
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_fetch_initialize(rtems_record_fetch_control *control, rtems_record_item *items, size_t count)
Initializes the record fetch control structure.
Definition: record-fetch.c:61
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
size_t rtems_record_get_item_count_for_fetch(void)
Returns the count of items which allows getting all available items for one processor through one cal...
Definition: record-fetch.c:51
void rtems_record_line(void)
Generates an RTEMS_RECORD_LINE event.
Definition: record-util.c:34
@ RTEMS_RECORD_FETCH_CONTINUE
This enumerator indicates that the current round of record fetches for all configure processors has t...
Definition: record.h:1959
@ RTEMS_RECORD_FETCH_DONE
This enumerator indicates that the current round of record fetches for all configure processors is do...
Definition: record.h:1953
@ RTEMS_RECORD_FETCH_INVALID_ITEM_COUNT
This enumerator indicates that the item count passed to rtems_record_fetch() is invalid.
Definition: record.h:1965
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:53
Definition: record.h:44
The control block used to manage each watchdog timer.
Definition: watchdog.h:109
Definition: thread.h:837
Definition: inftrees.h:24
Definition: intercom.c:87
Definition: mknod-pack_dev.c:254
Definition: record.h:58
This structure controls the record fetching performed by rtems_record_fetch().
Definition: record.h:1899
size_t cpu_todo
This member contains the count of records which need to be fetched from the current processor before ...
Definition: record.h:1929
rtems_record_item * fetched_items
This member references the first item fetched by the last call to rtems_record_fetch().
Definition: record.h:1904
size_t storage_item_count
This member contains the count of items of the array referenced by storage_items.
Definition: record.h:1940
rtems_record_item * storage_items
This member references the item array used to store fetched items.
Definition: record.h:1934
size_t fetched_count
This member contains the count of items fetched by the last call to rtems_record_fetch().
Definition: record.h:1910