RTEMS 7.0-rc1
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/rtems/intr.h>
34#include <rtems/score/atomic.h>
35#include <rtems/score/cpu.h>
36#include <rtems/score/interr.h>
37#include <rtems/score/percpu.h>
39#include <rtems/counter.h>
40
41#ifdef __cplusplus
42extern "C" {
43#endif /* __cplusplus */
44
45typedef struct Record_Control {
46 Atomic_Uint head;
47 unsigned int tail;
48 unsigned int mask;
49 Watchdog_Control Watchdog;
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
72extern rtems_interrupt_entry *_Record_Interrupt_dispatch_table[];
73
74bool _Record_Thread_create(
75 struct _Thread_Control *executing,
76 struct _Thread_Control *created
77);
78
79void _Record_Thread_start(
80 struct _Thread_Control *executing,
81 struct _Thread_Control *started
82);
83
84void _Record_Thread_restart(
85 struct _Thread_Control *executing,
86 struct _Thread_Control *restarted
87);
88
89void _Record_Thread_delete(
90 struct _Thread_Control *executing,
91 struct _Thread_Control *deleted
92);
93
94void _Record_Thread_switch(
95 struct _Thread_Control *executing,
96 struct _Thread_Control *heir
97);
98
99void _Record_Thread_begin( struct _Thread_Control *executing );
100
101void _Record_Thread_exitted( struct _Thread_Control *executing );
102
103void _Record_Fatal_dump_base64(
105 bool always_set_to_false,
106 Internal_errors_t code
107);
108
109void _Record_Fatal_dump_base64_zlib(
111 bool always_set_to_false,
112 Internal_errors_t code
113);
114
115void _Record_Thread_terminate(
116 struct _Thread_Control *executing
117);
118
119static inline unsigned int _Record_Index(
120 const Record_Control *control,
121 unsigned int index
122)
123{
124 return index & control->mask;
125}
126
127static inline unsigned int _Record_Head( Record_Control *control )
128{
129#ifdef RTEMS_SMP
130 /*
131 * Use a read-modify-write operation to get the last value stored by the
132 * record producer.
133 */
134 return _Atomic_Fetch_add_uint( &control->head, 0, ATOMIC_ORDER_ACQUIRE );
135#else
136 return _Atomic_Load_uint( &control->head, ATOMIC_ORDER_ACQUIRE );
137#endif
138}
139
140static inline unsigned int _Record_Tail( const Record_Control *control )
141{
142 return control->tail;
143}
144
145static inline bool _Record_Is_overflow(
146 const Record_Control *control,
147 unsigned int tail,
148 unsigned int head
149)
150{
151 return head - tail >= control->mask + 1U;
152}
153
154static inline unsigned int _Record_Capacity(
155 const Record_Control *control,
156 unsigned int tail,
157 unsigned int head
158)
159{
160 return ( tail - head - 1U ) & control->mask;
161}
162
163static inline rtems_counter_ticks _Record_Now( void )
164{
165 return rtems_counter_read();
166}
167
168typedef struct RTEMS_PACKED {
169 uint32_t format;
170 uint32_t magic;
171 rtems_record_item Version;
172 rtems_record_item Processor_maximum;
173 rtems_record_item Count;
174 rtems_record_item Frequency;
175 rtems_record_item Info[64];
177
178size_t _Record_Stream_header_initialize( Record_Stream_header *header );
179
180size_t _Record_String_to_items(
181 rtems_record_event event,
182 const char *str,
183 size_t len,
184 rtems_record_item *items,
185 size_t item_count
186);
187
188void _Record_Caller( void *return_address );
189
190void _Record_Caller_3(
191 void *return_address,
192 rtems_record_event event,
194);
195
196void _Record_Caller_4(
197 void *return_address,
198 rtems_record_event event_0,
199 rtems_record_data data_0,
200 rtems_record_event event_1,
201 rtems_record_data data_1
202);
203
204void _Record_Caller_arg( void *return_address, rtems_record_data data );
205
206void _Record_Caller_arg_2(
207 void *return_address,
208 rtems_record_data data_0,
209 rtems_record_data data_1
210);
211
212void _Record_Caller_arg_3(
213 void *return_address,
214 rtems_record_data data_0,
215 rtems_record_data data_1,
216 rtems_record_data data_2
217);
218
219void _Record_Caller_arg_4(
220 void *return_address,
221 rtems_record_data data_0,
222 rtems_record_data data_1,
223 rtems_record_data data_2,
224 rtems_record_data data_3
225);
226
227void _Record_Caller_arg_5(
228 void *return_address,
229 rtems_record_data data_0,
230 rtems_record_data data_1,
231 rtems_record_data data_2,
232 rtems_record_data data_3,
233 rtems_record_data data_4
234);
235
236void _Record_Caller_arg_6(
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);
245
246void _Record_Caller_arg_7(
247 void *return_address,
248 rtems_record_data data_0,
249 rtems_record_data data_1,
250 rtems_record_data data_2,
251 rtems_record_data data_3,
252 rtems_record_data data_4,
253 rtems_record_data data_5,
254 rtems_record_data data_6
255);
256
257void _Record_Caller_arg_8(
258 void *return_address,
259 rtems_record_data data_0,
260 rtems_record_data data_1,
261 rtems_record_data data_2,
262 rtems_record_data data_3,
263 rtems_record_data data_4,
264 rtems_record_data data_5,
265 rtems_record_data data_6,
266 rtems_record_data data_7
267);
268
269void _Record_Caller_arg_9(
270 void *return_address,
271 rtems_record_data data_0,
272 rtems_record_data data_1,
273 rtems_record_data data_2,
274 rtems_record_data data_3,
275 rtems_record_data data_4,
276 rtems_record_data data_5,
277 rtems_record_data data_6,
278 rtems_record_data data_7,
279 rtems_record_data data_8
280);
281
282void _Record_Caller_arg_10(
283 void *return_address,
284 rtems_record_data data_0,
285 rtems_record_data data_1,
286 rtems_record_data data_2,
287 rtems_record_data data_3,
288 rtems_record_data data_4,
289 rtems_record_data data_5,
290 rtems_record_data data_6,
291 rtems_record_data data_7,
292 rtems_record_data data_8,
293 rtems_record_data data_9
294);
295
296void _Record_Entry_2(
297 void *return_address,
298 rtems_record_event event,
299 rtems_record_data data_0,
300 rtems_record_data data_1
301);
302
303void _Record_Entry_3(
304 void *return_address,
305 rtems_record_event event,
306 rtems_record_data data_0,
307 rtems_record_data data_1,
308 rtems_record_data data_2
309);
310
311void _Record_Entry_4(
312 void *return_address,
313 rtems_record_event event,
314 rtems_record_data data_0,
315 rtems_record_data data_1,
316 rtems_record_data data_2,
317 rtems_record_data data_3
318);
319
320void _Record_Entry_5(
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);
329
330void _Record_Entry_6(
331 void *return_address,
332 rtems_record_event event,
333 rtems_record_data data_0,
334 rtems_record_data data_1,
335 rtems_record_data data_2,
336 rtems_record_data data_3,
337 rtems_record_data data_4,
338 rtems_record_data data_5
339);
340
341void _Record_Entry_7(
342 void *return_address,
343 rtems_record_event event,
344 rtems_record_data data_0,
345 rtems_record_data data_1,
346 rtems_record_data data_2,
347 rtems_record_data data_3,
348 rtems_record_data data_4,
349 rtems_record_data data_5,
350 rtems_record_data data_6
351);
352
353void _Record_Entry_8(
354 void *return_address,
355 rtems_record_event event,
356 rtems_record_data data_0,
357 rtems_record_data data_1,
358 rtems_record_data data_2,
359 rtems_record_data data_3,
360 rtems_record_data data_4,
361 rtems_record_data data_5,
362 rtems_record_data data_6,
363 rtems_record_data data_7
364);
365
366void _Record_Entry_9(
367 void *return_address,
368 rtems_record_event event,
369 rtems_record_data data_0,
370 rtems_record_data data_1,
371 rtems_record_data data_2,
372 rtems_record_data data_3,
373 rtems_record_data data_4,
374 rtems_record_data data_5,
375 rtems_record_data data_6,
376 rtems_record_data data_7,
377 rtems_record_data data_8
378);
379
380void _Record_Entry_10(
381 void *return_address,
382 rtems_record_event event,
383 rtems_record_data data_0,
384 rtems_record_data data_1,
385 rtems_record_data data_2,
386 rtems_record_data data_3,
387 rtems_record_data data_4,
388 rtems_record_data data_5,
389 rtems_record_data data_6,
390 rtems_record_data data_7,
391 rtems_record_data data_8,
392 rtems_record_data data_9
393);
394
395void _Record_Exit_2(
396 void *return_address,
397 rtems_record_event event,
398 rtems_record_data data_0,
399 rtems_record_data data_1
400);
401
402void _Record_Exit_3(
403 void *return_address,
404 rtems_record_event event,
405 rtems_record_data data_0,
406 rtems_record_data data_1,
407 rtems_record_data data_2
408);
409
410void _Record_Exit_4(
411 void *return_address,
412 rtems_record_event event,
413 rtems_record_data data_0,
414 rtems_record_data data_1,
415 rtems_record_data data_2,
416 rtems_record_data data_3
417);
418
419void _Record_Exit_5(
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);
428
429void _Record_Exit_6(
430 void *return_address,
431 rtems_record_event event,
432 rtems_record_data data_0,
433 rtems_record_data data_1,
434 rtems_record_data data_2,
435 rtems_record_data data_3,
436 rtems_record_data data_4,
437 rtems_record_data data_5
438);
439
440void _Record_Exit_7(
441 void *return_address,
442 rtems_record_event event,
443 rtems_record_data data_0,
444 rtems_record_data data_1,
445 rtems_record_data data_2,
446 rtems_record_data data_3,
447 rtems_record_data data_4,
448 rtems_record_data data_5,
449 rtems_record_data data_6
450);
451
452void _Record_Exit_8(
453 void *return_address,
454 rtems_record_event event,
455 rtems_record_data data_0,
456 rtems_record_data data_1,
457 rtems_record_data data_2,
458 rtems_record_data data_3,
459 rtems_record_data data_4,
460 rtems_record_data data_5,
461 rtems_record_data data_6,
462 rtems_record_data data_7
463);
464
465void _Record_Exit_9(
466 void *return_address,
467 rtems_record_event event,
468 rtems_record_data data_0,
469 rtems_record_data data_1,
470 rtems_record_data data_2,
471 rtems_record_data data_3,
472 rtems_record_data data_4,
473 rtems_record_data data_5,
474 rtems_record_data data_6,
475 rtems_record_data data_7,
476 rtems_record_data data_8
477);
478
479void _Record_Exit_10(
480 void *return_address,
481 rtems_record_event event,
482 rtems_record_data data_0,
483 rtems_record_data data_1,
484 rtems_record_data data_2,
485 rtems_record_data data_3,
486 rtems_record_data data_4,
487 rtems_record_data data_5,
488 rtems_record_data data_6,
489 rtems_record_data data_7,
490 rtems_record_data data_8,
491 rtems_record_data data_9
492);
493
513static inline void rtems_record_prepare_critical(
514 rtems_record_context *context,
515 const Per_CPU_Control *cpu_self
516)
517{
519 unsigned int head;
520
521 context->now = RTEMS_RECORD_TIME_EVENT( _Record_Now(), 0 );
522 control = cpu_self->record;
523 context->control = control;
524 head = _Record_Head( control );
525 context->head = head;
526}
527
539static inline void rtems_record_prepare( rtems_record_context *context )
540{
541 uint32_t level;
542 const Per_CPU_Control *cpu_self;
544 unsigned int head;
545
546 _CPU_ISR_Disable( level );
548 context->now = RTEMS_RECORD_TIME_EVENT( _Record_Now(), 0 );
549 context->level = level;
550 cpu_self = _Per_CPU_Get();
551 control = cpu_self->record;
552 context->control = control;
553 head = _Record_Head( control );
554 context->head = head;
555}
556
564static inline void rtems_record_add(
565 rtems_record_context *context,
566 rtems_record_event event,
568)
569{
571 rtems_record_item *item;
572 unsigned int head;
573
574 control = context->control;
575 head = context->head;
576 item = &control->Items[ _Record_Index( control, head ) ];
577 context->head = head + 1;
578
579 item->event = context->now | event;
580 item->data = data;
581}
582
590static inline void rtems_record_commit_critical( rtems_record_context *context )
591{
592 _Atomic_Store_uint(
593 &context->control->head,
594 context->head,
595 ATOMIC_ORDER_RELEASE
596 );
597}
598
604static inline void rtems_record_commit( rtems_record_context *context )
605{
606 rtems_record_commit_critical( context );
608 _CPU_ISR_Enable( context->level );
609}
610
618
628 rtems_record_event event_0,
629 rtems_record_data data_0,
630 rtems_record_event event_1,
631 rtems_record_data data_1
632);
633
641 const rtems_record_item *items,
642 size_t n
643);
644
650void rtems_record_line( void );
651
661 rtems_record_event event,
663);
664
676 rtems_record_event event_0,
677 rtems_record_data data_0,
678 rtems_record_event event_1,
679 rtems_record_data data_1
680);
681
691
702 rtems_record_data data_0,
703 rtems_record_data data_1
704);
705
717 rtems_record_data data_0,
718 rtems_record_data data_1,
719 rtems_record_data data_2
720);
721
734 rtems_record_data data_0,
735 rtems_record_data data_1,
736 rtems_record_data data_2,
737 rtems_record_data data_3
738);
739
753 rtems_record_data data_0,
754 rtems_record_data data_1,
755 rtems_record_data data_2,
756 rtems_record_data data_3,
757 rtems_record_data data_4
758);
759
774 rtems_record_data data_0,
775 rtems_record_data data_1,
776 rtems_record_data data_2,
777 rtems_record_data data_3,
778 rtems_record_data data_4,
779 rtems_record_data data_5
780);
781
797 rtems_record_data data_0,
798 rtems_record_data data_1,
799 rtems_record_data data_2,
800 rtems_record_data data_3,
801 rtems_record_data data_4,
802 rtems_record_data data_5,
803 rtems_record_data data_6
804);
805
822 rtems_record_data data_0,
823 rtems_record_data data_1,
824 rtems_record_data data_2,
825 rtems_record_data data_3,
826 rtems_record_data data_4,
827 rtems_record_data data_5,
828 rtems_record_data data_6,
829 rtems_record_data data_7
830);
831
849 rtems_record_data data_0,
850 rtems_record_data data_1,
851 rtems_record_data data_2,
852 rtems_record_data data_3,
853 rtems_record_data data_4,
854 rtems_record_data data_5,
855 rtems_record_data data_6,
856 rtems_record_data data_7,
857 rtems_record_data data_8
858);
859
878 rtems_record_data data_0,
879 rtems_record_data data_1,
880 rtems_record_data data_2,
881 rtems_record_data data_3,
882 rtems_record_data data_4,
883 rtems_record_data data_5,
884 rtems_record_data data_6,
885 rtems_record_data data_7,
886 rtems_record_data data_8,
887 rtems_record_data data_9
888);
889
899#define rtems_record_caller() _Record_Caller( RTEMS_RETURN_ADDRESS() )
900
914#define rtems_record_caller_3( event, data ) \
915 _Record_Caller_3( RTEMS_RETURN_ADDRESS(), event, data )
916
932#define rtems_record_caller_4( event_0, data_0, event_1, data_1 ) \
933 _Record_Caller_4( \
934 RTEMS_RETURN_ADDRESS(), \
935 event_0, \
936 data_0, \
937 event_1, \
938 data_1 \
939 )
940
953#define rtems_record_caller_arg( data ) \
954 _Record_Caller_arg( RTEMS_RETURN_ADDRESS(), data )
955
969#define rtems_record_caller_arg_2( data_0, data_1 ) \
970 _Record_Caller_arg_2( \
971 RTEMS_RETURN_ADDRESS(), \
972 data_0, \
973 data_1 \
974 )
975
990#define rtems_record_caller_arg_3( data_0, data_1, data_2 ) \
991 _Record_Caller_arg_3( \
992 RTEMS_RETURN_ADDRESS(), \
993 data_0, \
994 data_1, \
995 data_2 \
996 )
997
1013#define rtems_record_caller_arg_4( data_0, data_1, data_2, data_3 ) \
1014 _Record_Caller_arg_4( \
1015 RTEMS_RETURN_ADDRESS(), \
1016 data_0, \
1017 data_1, \
1018 data_2, \
1019 data_3 \
1020 )
1021
1038#define rtems_record_caller_arg_5( data_0, data_1, data_2, data_3, data_4 ) \
1039 _Record_Caller_arg_5( \
1040 RTEMS_RETURN_ADDRESS(), \
1041 data_0, \
1042 data_1, \
1043 data_2, \
1044 data_3, \
1045 data_4 \
1046 )
1047
1065#define rtems_record_caller_arg_6( \
1066 data_0, \
1067 data_1, \
1068 data_2, \
1069 data_3, \
1070 data_4, \
1071 data_5 \
1072) \
1073 _Record_Caller_arg_6( \
1074 RTEMS_RETURN_ADDRESS(), \
1075 data_0, \
1076 data_1, \
1077 data_2, \
1078 data_3, \
1079 data_4, \
1080 data_5 \
1081 )
1082
1101#define rtems_record_caller_arg_7( \
1102 data_0, \
1103 data_1, \
1104 data_2, \
1105 data_3, \
1106 data_4, \
1107 data_5, \
1108 data_6 \
1109) \
1110 _Record_Caller_arg_7( \
1111 RTEMS_RETURN_ADDRESS(), \
1112 data_0, \
1113 data_1, \
1114 data_2, \
1115 data_3, \
1116 data_4, \
1117 data_5, \
1118 data_6 \
1119 )
1120
1140#define rtems_record_caller_arg_8( \
1141 data_0, \
1142 data_1, \
1143 data_2, \
1144 data_3, \
1145 data_4, \
1146 data_5, \
1147 data_6, \
1148 data_7 \
1149) \
1150 _Record_Caller_arg_8( \
1151 RTEMS_RETURN_ADDRESS(), \
1152 data_0, \
1153 data_1, \
1154 data_2, \
1155 data_3, \
1156 data_4, \
1157 data_5, \
1158 data_6, \
1159 data_7 \
1160 )
1161
1182#define rtems_record_caller_arg_9( \
1183 data_0, \
1184 data_1, \
1185 data_2, \
1186 data_3, \
1187 data_4, \
1188 data_5, \
1189 data_6, \
1190 data_7, \
1191 data_8 \
1192) \
1193 _Record_Caller_arg_9( \
1194 RTEMS_RETURN_ADDRESS(), \
1195 data_0, \
1196 data_1, \
1197 data_2, \
1198 data_3, \
1199 data_4, \
1200 data_5, \
1201 data_6, \
1202 data_7, \
1203 data_8 \
1204 )
1205
1227#define rtems_record_caller_arg_10( \
1228 data_0, \
1229 data_1, \
1230 data_2, \
1231 data_3, \
1232 data_4, \
1233 data_5, \
1234 data_6, \
1235 data_7, \
1236 data_8, \
1237 data_9 \
1238) \
1239 _Record_Caller_arg_10( \
1240 RTEMS_RETURN_ADDRESS(), \
1241 data_0, \
1242 data_1, \
1243 data_2, \
1244 data_3, \
1245 data_4, \
1246 data_5, \
1247 data_6, \
1248 data_7, \
1249 data_8, \
1250 data_9 \
1251 )
1252
1261#define rtems_record_entry( event ) \
1262 rtems_record_produce( event, (rtems_record_data) RTEMS_RETURN_ADDRESS() )
1263
1273#define rtems_record_entry_1( event, data ) \
1274 rtems_record_produce_2( \
1275 event, \
1276 (rtems_record_data) RTEMS_RETURN_ADDRESS(), \
1277 RTEMS_RECORD_ARG_0, \
1278 data \
1279 )
1280
1291#define rtems_record_entry_2( event, data_0, data_1 ) \
1292 _Record_Entry_2( RTEMS_RETURN_ADDRESS(), event, data_0, data_1 )
1293
1305#define rtems_record_entry_3( event, data_0, data_1, data_2 ) \
1306 _Record_Entry_3( \
1307 RTEMS_RETURN_ADDRESS(), \
1308 event, \
1309 data_0, \
1310 data_1, \
1311 data_2 \
1312 )
1313
1326#define rtems_record_entry_4( event, data_0, data_1, data_2, data_3 ) \
1327 _Record_Entry_4( \
1328 RTEMS_RETURN_ADDRESS(), \
1329 event, \
1330 data_0, \
1331 data_1, \
1332 data_2, \
1333 data_3 \
1334 )
1335
1349#define rtems_record_entry_5( \
1350 event, \
1351 data_0, \
1352 data_1, \
1353 data_2, \
1354 data_3, \
1355 data_4 \
1356) \
1357 _Record_Entry_5( \
1358 RTEMS_RETURN_ADDRESS(), \
1359 event, \
1360 data_0, \
1361 data_1, \
1362 data_2, \
1363 data_3, \
1364 data_4 \
1365 )
1366
1381#define rtems_record_entry_6( \
1382 event, \
1383 data_0, \
1384 data_1, \
1385 data_2, \
1386 data_3, \
1387 data_4, \
1388 data_5 \
1389) \
1390 _Record_Entry_6( \
1391 RTEMS_RETURN_ADDRESS(), \
1392 event, \
1393 data_0, \
1394 data_1, \
1395 data_2, \
1396 data_3, \
1397 data_4, \
1398 data_5 \
1399 )
1400
1416#define rtems_record_entry_7( \
1417 event, \
1418 data_0, \
1419 data_1, \
1420 data_2, \
1421 data_3, \
1422 data_4, \
1423 data_5, \
1424 data_6 \
1425) \
1426 _Record_Entry_7( \
1427 RTEMS_RETURN_ADDRESS(), \
1428 event, \
1429 data_0, \
1430 data_1, \
1431 data_2, \
1432 data_3, \
1433 data_4, \
1434 data_5, \
1435 data_6 \
1436 )
1437
1454#define rtems_record_entry_8( \
1455 event, \
1456 data_0, \
1457 data_1, \
1458 data_2, \
1459 data_3, \
1460 data_4, \
1461 data_5, \
1462 data_6, \
1463 data_7 \
1464) \
1465 _Record_Entry_8( \
1466 RTEMS_RETURN_ADDRESS(), \
1467 event, \
1468 data_0, \
1469 data_1, \
1470 data_2, \
1471 data_3, \
1472 data_4, \
1473 data_5, \
1474 data_6, \
1475 data_7 \
1476 )
1477
1495#define rtems_record_entry_9( \
1496 event, \
1497 data_0, \
1498 data_1, \
1499 data_2, \
1500 data_3, \
1501 data_4, \
1502 data_5, \
1503 data_6, \
1504 data_7, \
1505 data_8 \
1506) \
1507 _Record_Entry_9( \
1508 RTEMS_RETURN_ADDRESS(), \
1509 event, \
1510 data_0, \
1511 data_1, \
1512 data_2, \
1513 data_3, \
1514 data_4, \
1515 data_5, \
1516 data_6, \
1517 data_7, \
1518 data_8 \
1519 )
1520
1539#define rtems_record_entry_10( \
1540 event, \
1541 data_0, \
1542 data_1, \
1543 data_2, \
1544 data_3, \
1545 data_4, \
1546 data_5, \
1547 data_6, \
1548 data_7, \
1549 data_8, \
1550 data_9 \
1551) \
1552 _Record_Entry_10( \
1553 RTEMS_RETURN_ADDRESS(), \
1554 event, \
1555 data_0, \
1556 data_1, \
1557 data_2, \
1558 data_3, \
1559 data_4, \
1560 data_5, \
1561 data_6, \
1562 data_7, \
1563 data_8, \
1564 data_9 \
1565 )
1566
1575#define rtems_record_exit( event ) \
1576 rtems_record_produce( event, (rtems_record_data) RTEMS_RETURN_ADDRESS() )
1577
1587#define rtems_record_exit_1( event, data ) \
1588 rtems_record_produce_2( \
1589 event, \
1590 (rtems_record_data) RTEMS_RETURN_ADDRESS(), \
1591 RTEMS_RECORD_RETURN_0, \
1592 data \
1593 )
1594
1605#define rtems_record_exit_2( event, data_0, data_1 ) \
1606 _Record_Entry_2( RTEMS_RETURN_ADDRESS(), event, data_0, data_1 )
1607
1619#define rtems_record_exit_3( event, data_0, data_1, data_2 ) \
1620 _Record_Exit_3( \
1621 RTEMS_RETURN_ADDRESS(), \
1622 event, \
1623 data_0, \
1624 data_1, \
1625 data_2 \
1626 )
1627
1640#define rtems_record_exit_4( event, data_0, data_1, data_2, data_3 ) \
1641 _Record_Exit_4( \
1642 RTEMS_RETURN_ADDRESS(), \
1643 event, \
1644 data_0, \
1645 data_1, \
1646 data_2, \
1647 data_3 \
1648 )
1649
1663#define rtems_record_exit_5( \
1664 event, \
1665 data_0, \
1666 data_1, \
1667 data_2, \
1668 data_3, \
1669 data_4 \
1670) \
1671 _Record_Exit_5( \
1672 RTEMS_RETURN_ADDRESS(), \
1673 event, \
1674 data_0, \
1675 data_1, \
1676 data_2, \
1677 data_3, \
1678 data_4 \
1679 )
1680
1695#define rtems_record_exit_6( \
1696 event, \
1697 data_0, \
1698 data_1, \
1699 data_2, \
1700 data_3, \
1701 data_4, \
1702 data_5 \
1703) \
1704 _Record_Exit_6( \
1705 RTEMS_RETURN_ADDRESS(), \
1706 event, \
1707 data_0, \
1708 data_1, \
1709 data_2, \
1710 data_3, \
1711 data_4, \
1712 data_5 \
1713 )
1714
1730#define rtems_record_exit_7( \
1731 event, \
1732 data_0, \
1733 data_1, \
1734 data_2, \
1735 data_3, \
1736 data_4, \
1737 data_5, \
1738 data_6 \
1739) \
1740 _Record_Exit_7( \
1741 RTEMS_RETURN_ADDRESS(), \
1742 event, \
1743 data_0, \
1744 data_1, \
1745 data_2, \
1746 data_3, \
1747 data_4, \
1748 data_5, \
1749 data_6 \
1750 )
1751
1768#define rtems_record_exit_8( \
1769 event, \
1770 data_0, \
1771 data_1, \
1772 data_2, \
1773 data_3, \
1774 data_4, \
1775 data_5, \
1776 data_6, \
1777 data_7 \
1778) \
1779 _Record_Exit_8( \
1780 RTEMS_RETURN_ADDRESS(), \
1781 event, \
1782 data_0, \
1783 data_1, \
1784 data_2, \
1785 data_3, \
1786 data_4, \
1787 data_5, \
1788 data_6, \
1789 data_7 \
1790 )
1791
1809#define rtems_record_exit_9( \
1810 event, \
1811 data_0, \
1812 data_1, \
1813 data_2, \
1814 data_3, \
1815 data_4, \
1816 data_5, \
1817 data_6, \
1818 data_7, \
1819 data_8 \
1820) \
1821 _Record_Exit_9( \
1822 RTEMS_RETURN_ADDRESS(), \
1823 event, \
1824 data_0, \
1825 data_1, \
1826 data_2, \
1827 data_3, \
1828 data_4, \
1829 data_5, \
1830 data_6, \
1831 data_7, \
1832 data_8 \
1833 )
1834
1853#define rtems_record_exit_10( \
1854 event, \
1855 data_0, \
1856 data_1, \
1857 data_2, \
1858 data_3, \
1859 data_4, \
1860 data_5, \
1861 data_6, \
1862 data_7, \
1863 data_8, \
1864 data_9 \
1865) \
1866 _Record_Exit_10( \
1867 RTEMS_RETURN_ADDRESS(), \
1868 event, \
1869 data_0, \
1870 data_1, \
1871 data_2, \
1872 data_3, \
1873 data_4, \
1874 data_5, \
1875 data_6, \
1876 data_7, \
1877 data_8, \
1878 data_9 \
1879 )
1880
1886uint32_t rtems_record_interrupt_disable( void );
1887
1895void rtems_record_interrupt_enable( uint32_t level );
1896
1902typedef struct {
1907 rtems_record_item *fetched_items;
1908
1914
1919 struct {
1920#ifdef RTEMS_SMP
1925 uint32_t cpu_index;
1926#endif
1927
1932 size_t cpu_todo;
1933
1937 rtems_record_item *storage_items;
1938
1944 } internal;
1946
1951typedef enum {
1957
1963
1970
1979
1996 rtems_record_item *items,
1997 size_t count
1998);
1999
2022);
2023
2026#ifdef __cplusplus
2027}
2028#endif /* __cplusplus */
2029
2030#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:1057
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:1951
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:1962
@ RTEMS_RECORD_FETCH_DONE
This enumerator indicates that the current round of record fetches for all configure processors is do...
Definition: record.h:1956
@ RTEMS_RECORD_FETCH_INVALID_ITEM_COUNT
This enumerator indicates that the item count passed to rtems_record_fetch() is invalid.
Definition: record.h:1968
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.
This header file defines the Interrupt Manager API.
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:45
Definition: record.h:54
Definition: record.h:45
The control block used to manage each watchdog timer.
Definition: watchdog.h:109
Definition: thread.h:837
Definition: intercom.c:87
Definition: mknod-pack_dev.c:254
This structure represents an interrupt entry.
Definition: intr.h:1070
Definition: record.h:59
This structure controls the record fetching performed by rtems_record_fetch().
Definition: record.h:1902
size_t cpu_todo
This member contains the count of records which need to be fetched from the current processor before ...
Definition: record.h:1932
rtems_record_item * fetched_items
This member references the first item fetched by the last call to rtems_record_fetch().
Definition: record.h:1907
size_t storage_item_count
This member contains the count of items of the array referenced by storage_items.
Definition: record.h:1943
rtems_record_item * storage_items
This member references the item array used to store fetched items.
Definition: record.h:1937
size_t fetched_count
This member contains the count of items fetched by the last call to rtems_record_fetch().
Definition: record.h:1913