RTEMS  5.1
record.h
1 /* SPDX-License-Identifier: BSD-2-Clause */
2 
3 /*
4  * Copyright (C) 2018, 2020 embedded brains GmbH (http://www.embedded-brains.de)
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>
37 #include <rtems/score/watchdog.h>
38 #include <rtems/counter.h>
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif /* __cplusplus */
43 
44 typedef 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 ];
51  rtems_record_item Items[ RTEMS_ZERO_LENGTH_ARRAY ];
53 
54 typedef struct {
55  unsigned int item_count;
56  Record_Control *controls;
58 
59 typedef struct {
61  unsigned int head;
62  uint32_t now;
63  uint32_t level;
65 
66 extern const Record_Configuration _Record_Configuration;
67 
68 void _Record_Initialize( void );
69 
70 bool _Record_Thread_create(
71  struct _Thread_Control *executing,
72  struct _Thread_Control *created
73 );
74 
75 void _Record_Thread_start(
76  struct _Thread_Control *executing,
77  struct _Thread_Control *started
78 );
79 
80 void _Record_Thread_restart(
81  struct _Thread_Control *executing,
82  struct _Thread_Control *restarted
83 );
84 
85 void _Record_Thread_delete(
86  struct _Thread_Control *executing,
87  struct _Thread_Control *deleted
88 );
89 
90 void _Record_Thread_switch(
91  struct _Thread_Control *executing,
92  struct _Thread_Control *heir
93 );
94 
95 void _Record_Thread_begin( struct _Thread_Control *executing );
96 
97 void _Record_Thread_exitted( struct _Thread_Control *executing );
98 
99 void _Record_Fatal_dump_base64(
100  Internal_errors_Source source,
101  bool always_set_to_false,
102  Internal_errors_t code
103 );
104 
105 void _Record_Fatal_dump_base64_zlib(
106  Internal_errors_Source source,
107  bool always_set_to_false,
108  Internal_errors_t code
109 );
110 
111 void _Record_Thread_terminate(
112  struct _Thread_Control *executing
113 );
114 
115 RTEMS_INLINE_ROUTINE unsigned int _Record_Index(
116  const Record_Control *control,
117  unsigned int index
118 )
119 {
120  return index & control->mask;
121 }
122 
123 RTEMS_INLINE_ROUTINE unsigned int _Record_Head( const Record_Control *control )
124 {
125  return _Atomic_Load_uint( &control->head, ATOMIC_ORDER_RELAXED );
126 }
127 
128 RTEMS_INLINE_ROUTINE unsigned int _Record_Tail( const Record_Control *control )
129 {
130  return control->tail;
131 }
132 
133 RTEMS_INLINE_ROUTINE bool _Record_Is_overflow(
134  const Record_Control *control,
135  unsigned int tail,
136  unsigned int head
137 )
138 {
139  return head - tail >= control->mask + 1U;
140 }
141 
142 RTEMS_INLINE_ROUTINE unsigned int _Record_Capacity(
143  const Record_Control *control,
144  unsigned int tail,
145  unsigned int head
146 )
147 {
148  return ( tail - head - 1U ) & control->mask;
149 }
150 
151 RTEMS_INLINE_ROUTINE rtems_counter_ticks _Record_Now( void )
152 {
153  return rtems_counter_read();
154 }
155 
156 typedef struct RTEMS_PACKED {
157  uint32_t format;
158  uint32_t magic;
159  rtems_record_item Version;
160  rtems_record_item Processor_maximum;
161  rtems_record_item Count;
162  rtems_record_item Frequency;
163  rtems_record_item Info[64];
165 
166 size_t _Record_Stream_header_initialize( Record_Stream_header *header );
167 
168 size_t _Record_String_to_items(
169  rtems_record_event event,
170  const char *str,
171  size_t len,
172  rtems_record_item *items,
173  size_t item_count
174 );
175 
176 void _Record_Caller( void *return_address );
177 
178 void _Record_Caller_3(
179  void *return_address,
180  rtems_record_event event,
181  rtems_record_data data
182 );
183 
184 void _Record_Caller_4(
185  void *return_address,
186  rtems_record_event event_0,
187  rtems_record_data data_0,
188  rtems_record_event event_1,
189  rtems_record_data data_1
190 );
191 
192 void _Record_Caller_arg( void *return_address, rtems_record_data data );
193 
194 void _Record_Caller_arg_2(
195  void *return_address,
196  rtems_record_data data_0,
197  rtems_record_data data_1
198 );
199 
200 void _Record_Caller_arg_3(
201  void *return_address,
202  rtems_record_data data_0,
203  rtems_record_data data_1,
204  rtems_record_data data_2
205 );
206 
207 void _Record_Caller_arg_4(
208  void *return_address,
209  rtems_record_data data_0,
210  rtems_record_data data_1,
211  rtems_record_data data_2,
212  rtems_record_data data_3
213 );
214 
215 void _Record_Caller_arg_5(
216  void *return_address,
217  rtems_record_data data_0,
218  rtems_record_data data_1,
219  rtems_record_data data_2,
220  rtems_record_data data_3,
221  rtems_record_data data_4
222 );
223 
224 void _Record_Caller_arg_6(
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  rtems_record_data data_5
232 );
233 
234 void _Record_Caller_arg_7(
235  void *return_address,
236  rtems_record_data data_0,
237  rtems_record_data data_1,
238  rtems_record_data data_2,
239  rtems_record_data data_3,
240  rtems_record_data data_4,
241  rtems_record_data data_5,
242  rtems_record_data data_6
243 );
244 
245 void _Record_Caller_arg_8(
246  void *return_address,
247  rtems_record_data data_0,
248  rtems_record_data data_1,
249  rtems_record_data data_2,
250  rtems_record_data data_3,
251  rtems_record_data data_4,
252  rtems_record_data data_5,
253  rtems_record_data data_6,
254  rtems_record_data data_7
255 );
256 
257 void _Record_Caller_arg_9(
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  rtems_record_data data_8
268 );
269 
270 void _Record_Caller_arg_10(
271  void *return_address,
272  rtems_record_data data_0,
273  rtems_record_data data_1,
274  rtems_record_data data_2,
275  rtems_record_data data_3,
276  rtems_record_data data_4,
277  rtems_record_data data_5,
278  rtems_record_data data_6,
279  rtems_record_data data_7,
280  rtems_record_data data_8,
281  rtems_record_data data_9
282 );
283 
284 void _Record_Entry_2(
285  void *return_address,
286  rtems_record_event event,
287  rtems_record_data data_0,
288  rtems_record_data data_1
289 );
290 
291 void _Record_Entry_3(
292  void *return_address,
293  rtems_record_event event,
294  rtems_record_data data_0,
295  rtems_record_data data_1,
296  rtems_record_data data_2
297 );
298 
299 void _Record_Entry_4(
300  void *return_address,
301  rtems_record_event event,
302  rtems_record_data data_0,
303  rtems_record_data data_1,
304  rtems_record_data data_2,
305  rtems_record_data data_3
306 );
307 
308 void _Record_Entry_5(
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  rtems_record_data data_4
316 );
317 
318 void _Record_Entry_6(
319  void *return_address,
320  rtems_record_event event,
321  rtems_record_data data_0,
322  rtems_record_data data_1,
323  rtems_record_data data_2,
324  rtems_record_data data_3,
325  rtems_record_data data_4,
326  rtems_record_data data_5
327 );
328 
329 void _Record_Entry_7(
330  void *return_address,
331  rtems_record_event event,
332  rtems_record_data data_0,
333  rtems_record_data data_1,
334  rtems_record_data data_2,
335  rtems_record_data data_3,
336  rtems_record_data data_4,
337  rtems_record_data data_5,
338  rtems_record_data data_6
339 );
340 
341 void _Record_Entry_8(
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  rtems_record_data data_7
352 );
353 
354 void _Record_Entry_9(
355  void *return_address,
356  rtems_record_event event,
357  rtems_record_data data_0,
358  rtems_record_data data_1,
359  rtems_record_data data_2,
360  rtems_record_data data_3,
361  rtems_record_data data_4,
362  rtems_record_data data_5,
363  rtems_record_data data_6,
364  rtems_record_data data_7,
365  rtems_record_data data_8
366 );
367 
368 void _Record_Entry_10(
369  void *return_address,
370  rtems_record_event event,
371  rtems_record_data data_0,
372  rtems_record_data data_1,
373  rtems_record_data data_2,
374  rtems_record_data data_3,
375  rtems_record_data data_4,
376  rtems_record_data data_5,
377  rtems_record_data data_6,
378  rtems_record_data data_7,
379  rtems_record_data data_8,
380  rtems_record_data data_9
381 );
382 
383 void _Record_Exit_2(
384  void *return_address,
385  rtems_record_event event,
386  rtems_record_data data_0,
387  rtems_record_data data_1
388 );
389 
390 void _Record_Exit_3(
391  void *return_address,
392  rtems_record_event event,
393  rtems_record_data data_0,
394  rtems_record_data data_1,
395  rtems_record_data data_2
396 );
397 
398 void _Record_Exit_4(
399  void *return_address,
400  rtems_record_event event,
401  rtems_record_data data_0,
402  rtems_record_data data_1,
403  rtems_record_data data_2,
404  rtems_record_data data_3
405 );
406 
407 void _Record_Exit_5(
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  rtems_record_data data_4
415 );
416 
417 void _Record_Exit_6(
418  void *return_address,
419  rtems_record_event event,
420  rtems_record_data data_0,
421  rtems_record_data data_1,
422  rtems_record_data data_2,
423  rtems_record_data data_3,
424  rtems_record_data data_4,
425  rtems_record_data data_5
426 );
427 
428 void _Record_Exit_7(
429  void *return_address,
430  rtems_record_event event,
431  rtems_record_data data_0,
432  rtems_record_data data_1,
433  rtems_record_data data_2,
434  rtems_record_data data_3,
435  rtems_record_data data_4,
436  rtems_record_data data_5,
437  rtems_record_data data_6
438 );
439 
440 void _Record_Exit_8(
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  rtems_record_data data_7
451 );
452 
453 void _Record_Exit_9(
454  void *return_address,
455  rtems_record_event event,
456  rtems_record_data data_0,
457  rtems_record_data data_1,
458  rtems_record_data data_2,
459  rtems_record_data data_3,
460  rtems_record_data data_4,
461  rtems_record_data data_5,
462  rtems_record_data data_6,
463  rtems_record_data data_7,
464  rtems_record_data data_8
465 );
466 
467 void _Record_Exit_10(
468  void *return_address,
469  rtems_record_event event,
470  rtems_record_data data_0,
471  rtems_record_data data_1,
472  rtems_record_data data_2,
473  rtems_record_data data_3,
474  rtems_record_data data_4,
475  rtems_record_data data_5,
476  rtems_record_data data_6,
477  rtems_record_data data_7,
478  rtems_record_data data_8,
479  rtems_record_data data_9
480 );
481 
503  const Per_CPU_Control *cpu_self
504 )
505 {
507  unsigned int head;
508 
509  context->now = RTEMS_RECORD_TIME_EVENT( _Record_Now(), 0 );
510  control = cpu_self->record;
511  context->control = control;
512  head = _Record_Head( control );
513  context->head = head;
514 }
515 
528 {
529  uint32_t level;
530  const Per_CPU_Control *cpu_self;
532  unsigned int head;
533 
534  _CPU_ISR_Disable( level );
536  context->now = RTEMS_RECORD_TIME_EVENT( _Record_Now(), 0 );
537  context->level = level;
538  cpu_self = _Per_CPU_Get();
539  control = cpu_self->record;
540  context->control = control;
541  head = _Record_Head( control );
542  context->head = head;
543 }
544 
554  rtems_record_event event,
555  rtems_record_data data
556 )
557 {
559  rtems_record_item *item;
560  unsigned int head;
561 
562  control = context->control;
563  head = context->head;
564  item = &control->Items[ _Record_Index( control, head ) ];
565  context->head = head + 1;
566 
567  item->event = context->now | event;
568  item->data = data;
569 }
570 
579 {
580  _Atomic_Store_uint(
581  &context->control->head,
582  context->head,
583  ATOMIC_ORDER_RELEASE
584  );
585 }
586 
593 {
596  _CPU_ISR_Enable( context->level );
597 }
598 
606 
616  rtems_record_event event_0,
617  rtems_record_data data_0,
618  rtems_record_event event_1,
619  rtems_record_data data_1
620 );
621 
629  const rtems_record_item *items,
630  size_t n
631 );
632 
638 void rtems_record_line( void );
639 
649  rtems_record_event event,
650  rtems_record_data data
651 );
652 
664  rtems_record_event event_0,
665  rtems_record_data data_0,
666  rtems_record_event event_1,
667  rtems_record_data data_1
668 );
669 
679 
690  rtems_record_data data_0,
691  rtems_record_data data_1
692 );
693 
705  rtems_record_data data_0,
706  rtems_record_data data_1,
707  rtems_record_data data_2
708 );
709 
722  rtems_record_data data_0,
723  rtems_record_data data_1,
724  rtems_record_data data_2,
725  rtems_record_data data_3
726 );
727 
741  rtems_record_data data_0,
742  rtems_record_data data_1,
743  rtems_record_data data_2,
744  rtems_record_data data_3,
745  rtems_record_data data_4
746 );
747 
762  rtems_record_data data_0,
763  rtems_record_data data_1,
764  rtems_record_data data_2,
765  rtems_record_data data_3,
766  rtems_record_data data_4,
767  rtems_record_data data_5
768 );
769 
785  rtems_record_data data_0,
786  rtems_record_data data_1,
787  rtems_record_data data_2,
788  rtems_record_data data_3,
789  rtems_record_data data_4,
790  rtems_record_data data_5,
791  rtems_record_data data_6
792 );
793 
810  rtems_record_data data_0,
811  rtems_record_data data_1,
812  rtems_record_data data_2,
813  rtems_record_data data_3,
814  rtems_record_data data_4,
815  rtems_record_data data_5,
816  rtems_record_data data_6,
817  rtems_record_data data_7
818 );
819 
837  rtems_record_data data_0,
838  rtems_record_data data_1,
839  rtems_record_data data_2,
840  rtems_record_data data_3,
841  rtems_record_data data_4,
842  rtems_record_data data_5,
843  rtems_record_data data_6,
844  rtems_record_data data_7,
845  rtems_record_data data_8
846 );
847 
866  rtems_record_data data_0,
867  rtems_record_data data_1,
868  rtems_record_data data_2,
869  rtems_record_data data_3,
870  rtems_record_data data_4,
871  rtems_record_data data_5,
872  rtems_record_data data_6,
873  rtems_record_data data_7,
874  rtems_record_data data_8,
875  rtems_record_data data_9
876 );
877 
887 #define rtems_record_caller() _Record_Caller( RTEMS_RETURN_ADDRESS() )
888 
902 #define rtems_record_caller_3( event, data ) \
903  _Record_Caller_3( RTEMS_RETURN_ADDRESS(), event, data )
904 
920 #define rtems_record_caller_4( event_0, data_0, event_1, data_1 ) \
921  _Record_Caller_4( \
922  RTEMS_RETURN_ADDRESS(), \
923  event_0, \
924  data_0, \
925  event_1, \
926  data_1 \
927  )
928 
941 #define rtems_record_caller_arg( data ) \
942  _Record_Caller_arg( RTEMS_RETURN_ADDRESS(), data )
943 
957 #define rtems_record_caller_arg_2( data_0, data_1 ) \
958  _Record_Caller_arg_2( \
959  RTEMS_RETURN_ADDRESS(), \
960  data_0, \
961  data_1 \
962  )
963 
978 #define rtems_record_caller_arg_3( data_0, data_1, data_2 ) \
979  _Record_Caller_arg_3( \
980  RTEMS_RETURN_ADDRESS(), \
981  data_0, \
982  data_1, \
983  data_2 \
984  )
985 
1001 #define rtems_record_caller_arg_4( data_0, data_1, data_2, data_3 ) \
1002  _Record_Caller_arg_4( \
1003  RTEMS_RETURN_ADDRESS(), \
1004  data_0, \
1005  data_1, \
1006  data_2, \
1007  data_3 \
1008  )
1009 
1026 #define rtems_record_caller_arg_5( data_0, data_1, data_2, data_3, data_4 ) \
1027  _Record_Caller_arg_5( \
1028  RTEMS_RETURN_ADDRESS(), \
1029  data_0, \
1030  data_1, \
1031  data_2, \
1032  data_3, \
1033  data_4 \
1034  )
1035 
1053 #define rtems_record_caller_arg_6( \
1054  data_0, \
1055  data_1, \
1056  data_2, \
1057  data_3, \
1058  data_4, \
1059  data_5 \
1060 ) \
1061  _Record_Caller_arg_6( \
1062  RTEMS_RETURN_ADDRESS(), \
1063  data_0, \
1064  data_1, \
1065  data_2, \
1066  data_3, \
1067  data_4, \
1068  data_5 \
1069  )
1070 
1089 #define rtems_record_caller_arg_7( \
1090  data_0, \
1091  data_1, \
1092  data_2, \
1093  data_3, \
1094  data_4, \
1095  data_5, \
1096  data_6 \
1097 ) \
1098  _Record_Caller_arg_7( \
1099  RTEMS_RETURN_ADDRESS(), \
1100  data_0, \
1101  data_1, \
1102  data_2, \
1103  data_3, \
1104  data_4, \
1105  data_5, \
1106  data_6 \
1107  )
1108 
1128 #define rtems_record_caller_arg_8( \
1129  data_0, \
1130  data_1, \
1131  data_2, \
1132  data_3, \
1133  data_4, \
1134  data_5, \
1135  data_6, \
1136  data_7 \
1137 ) \
1138  _Record_Caller_arg_8( \
1139  RTEMS_RETURN_ADDRESS(), \
1140  data_0, \
1141  data_1, \
1142  data_2, \
1143  data_3, \
1144  data_4, \
1145  data_5, \
1146  data_6, \
1147  data_7 \
1148  )
1149 
1170 #define rtems_record_caller_arg_9( \
1171  data_0, \
1172  data_1, \
1173  data_2, \
1174  data_3, \
1175  data_4, \
1176  data_5, \
1177  data_6, \
1178  data_7, \
1179  data_8 \
1180 ) \
1181  _Record_Caller_arg_9( \
1182  RTEMS_RETURN_ADDRESS(), \
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 
1215 #define rtems_record_caller_arg_10( \
1216  data_0, \
1217  data_1, \
1218  data_2, \
1219  data_3, \
1220  data_4, \
1221  data_5, \
1222  data_6, \
1223  data_7, \
1224  data_8, \
1225  data_9 \
1226 ) \
1227  _Record_Caller_arg_10( \
1228  RTEMS_RETURN_ADDRESS(), \
1229  data_0, \
1230  data_1, \
1231  data_2, \
1232  data_3, \
1233  data_4, \
1234  data_5, \
1235  data_6, \
1236  data_7, \
1237  data_8, \
1238  data_9 \
1239  )
1240 
1249 #define rtems_record_entry( event ) \
1250  rtems_record_produce( event, (rtems_record_data) RTEMS_RETURN_ADDRESS() )
1251 
1261 #define rtems_record_entry_1( event, data ) \
1262  rtems_record_produce_2( \
1263  event, \
1264  (rtems_record_data) RTEMS_RETURN_ADDRESS(), \
1265  RTEMS_RECORD_ARG_0, \
1266  data \
1267  )
1268 
1279 #define rtems_record_entry_2( event, data_0, data_1 ) \
1280  _Record_Entry_2( RTEMS_RETURN_ADDRESS(), event, data_0, data_1 )
1281 
1293 #define rtems_record_entry_3( event, data_0, data_1, data_2 ) \
1294  _Record_Entry_3( \
1295  RTEMS_RETURN_ADDRESS(), \
1296  event, \
1297  data_0, \
1298  data_1, \
1299  data_2 \
1300  )
1301 
1314 #define rtems_record_entry_4( event, data_0, data_1, data_2, data_3 ) \
1315  _Record_Entry_4( \
1316  RTEMS_RETURN_ADDRESS(), \
1317  event, \
1318  data_0, \
1319  data_1, \
1320  data_2, \
1321  data_3 \
1322  )
1323 
1337 #define rtems_record_entry_5( \
1338  event, \
1339  data_0, \
1340  data_1, \
1341  data_2, \
1342  data_3, \
1343  data_4 \
1344 ) \
1345  _Record_Entry_5( \
1346  RTEMS_RETURN_ADDRESS(), \
1347  event, \
1348  data_0, \
1349  data_1, \
1350  data_2, \
1351  data_3, \
1352  data_4 \
1353  )
1354 
1369 #define rtems_record_entry_6( \
1370  event, \
1371  data_0, \
1372  data_1, \
1373  data_2, \
1374  data_3, \
1375  data_4, \
1376  data_5 \
1377 ) \
1378  _Record_Entry_6( \
1379  RTEMS_RETURN_ADDRESS(), \
1380  event, \
1381  data_0, \
1382  data_1, \
1383  data_2, \
1384  data_3, \
1385  data_4, \
1386  data_5 \
1387  )
1388 
1404 #define rtems_record_entry_7( \
1405  event, \
1406  data_0, \
1407  data_1, \
1408  data_2, \
1409  data_3, \
1410  data_4, \
1411  data_5, \
1412  data_6 \
1413 ) \
1414  _Record_Entry_7( \
1415  RTEMS_RETURN_ADDRESS(), \
1416  event, \
1417  data_0, \
1418  data_1, \
1419  data_2, \
1420  data_3, \
1421  data_4, \
1422  data_5, \
1423  data_6 \
1424  )
1425 
1442 #define rtems_record_entry_8( \
1443  event, \
1444  data_0, \
1445  data_1, \
1446  data_2, \
1447  data_3, \
1448  data_4, \
1449  data_5, \
1450  data_6, \
1451  data_7 \
1452 ) \
1453  _Record_Entry_8( \
1454  RTEMS_RETURN_ADDRESS(), \
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 
1483 #define rtems_record_entry_9( \
1484  event, \
1485  data_0, \
1486  data_1, \
1487  data_2, \
1488  data_3, \
1489  data_4, \
1490  data_5, \
1491  data_6, \
1492  data_7, \
1493  data_8 \
1494 ) \
1495  _Record_Entry_9( \
1496  RTEMS_RETURN_ADDRESS(), \
1497  event, \
1498  data_0, \
1499  data_1, \
1500  data_2, \
1501  data_3, \
1502  data_4, \
1503  data_5, \
1504  data_6, \
1505  data_7, \
1506  data_8 \
1507  )
1508 
1527 #define rtems_record_entry_10( \
1528  event, \
1529  data_0, \
1530  data_1, \
1531  data_2, \
1532  data_3, \
1533  data_4, \
1534  data_5, \
1535  data_6, \
1536  data_7, \
1537  data_8, \
1538  data_9 \
1539 ) \
1540  _Record_Entry_10( \
1541  RTEMS_RETURN_ADDRESS(), \
1542  event, \
1543  data_0, \
1544  data_1, \
1545  data_2, \
1546  data_3, \
1547  data_4, \
1548  data_5, \
1549  data_6, \
1550  data_7, \
1551  data_8, \
1552  data_9 \
1553  )
1554 
1563 #define rtems_record_exit( event ) \
1564  rtems_record_produce( event, (rtems_record_data) RTEMS_RETURN_ADDRESS() )
1565 
1575 #define rtems_record_exit_1( event, data ) \
1576  rtems_record_produce_2( \
1577  event, \
1578  (rtems_record_data) RTEMS_RETURN_ADDRESS(), \
1579  RTEMS_RECORD_RETURN_0, \
1580  data \
1581  )
1582 
1593 #define rtems_record_exit_2( event, data_0, data_1 ) \
1594  _Record_Entry_2( RTEMS_RETURN_ADDRESS(), event, data_0, data_1 )
1595 
1607 #define rtems_record_exit_3( event, data_0, data_1, data_2 ) \
1608  _Record_Exit_3( \
1609  RTEMS_RETURN_ADDRESS(), \
1610  event, \
1611  data_0, \
1612  data_1, \
1613  data_2 \
1614  )
1615 
1628 #define rtems_record_exit_4( event, data_0, data_1, data_2, data_3 ) \
1629  _Record_Exit_4( \
1630  RTEMS_RETURN_ADDRESS(), \
1631  event, \
1632  data_0, \
1633  data_1, \
1634  data_2, \
1635  data_3 \
1636  )
1637 
1651 #define rtems_record_exit_5( \
1652  event, \
1653  data_0, \
1654  data_1, \
1655  data_2, \
1656  data_3, \
1657  data_4 \
1658 ) \
1659  _Record_Exit_5( \
1660  RTEMS_RETURN_ADDRESS(), \
1661  event, \
1662  data_0, \
1663  data_1, \
1664  data_2, \
1665  data_3, \
1666  data_4 \
1667  )
1668 
1683 #define rtems_record_exit_6( \
1684  event, \
1685  data_0, \
1686  data_1, \
1687  data_2, \
1688  data_3, \
1689  data_4, \
1690  data_5 \
1691 ) \
1692  _Record_Exit_6( \
1693  RTEMS_RETURN_ADDRESS(), \
1694  event, \
1695  data_0, \
1696  data_1, \
1697  data_2, \
1698  data_3, \
1699  data_4, \
1700  data_5 \
1701  )
1702 
1718 #define rtems_record_exit_7( \
1719  event, \
1720  data_0, \
1721  data_1, \
1722  data_2, \
1723  data_3, \
1724  data_4, \
1725  data_5, \
1726  data_6 \
1727 ) \
1728  _Record_Exit_7( \
1729  RTEMS_RETURN_ADDRESS(), \
1730  event, \
1731  data_0, \
1732  data_1, \
1733  data_2, \
1734  data_3, \
1735  data_4, \
1736  data_5, \
1737  data_6 \
1738  )
1739 
1756 #define rtems_record_exit_8( \
1757  event, \
1758  data_0, \
1759  data_1, \
1760  data_2, \
1761  data_3, \
1762  data_4, \
1763  data_5, \
1764  data_6, \
1765  data_7 \
1766 ) \
1767  _Record_Exit_8( \
1768  RTEMS_RETURN_ADDRESS(), \
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 
1797 #define rtems_record_exit_9( \
1798  event, \
1799  data_0, \
1800  data_1, \
1801  data_2, \
1802  data_3, \
1803  data_4, \
1804  data_5, \
1805  data_6, \
1806  data_7, \
1807  data_8 \
1808 ) \
1809  _Record_Exit_9( \
1810  RTEMS_RETURN_ADDRESS(), \
1811  event, \
1812  data_0, \
1813  data_1, \
1814  data_2, \
1815  data_3, \
1816  data_4, \
1817  data_5, \
1818  data_6, \
1819  data_7, \
1820  data_8 \
1821  )
1822 
1841 #define rtems_record_exit_10( \
1842  event, \
1843  data_0, \
1844  data_1, \
1845  data_2, \
1846  data_3, \
1847  data_4, \
1848  data_5, \
1849  data_6, \
1850  data_7, \
1851  data_8, \
1852  data_9 \
1853 ) \
1854  _Record_Exit_10( \
1855  RTEMS_RETURN_ADDRESS(), \
1856  event, \
1857  data_0, \
1858  data_1, \
1859  data_2, \
1860  data_3, \
1861  data_4, \
1862  data_5, \
1863  data_6, \
1864  data_7, \
1865  data_8, \
1866  data_9 \
1867  )
1868 
1874 uint32_t rtems_record_interrupt_disable( void );
1875 
1883 void rtems_record_interrupt_enable( uint32_t level );
1884 
1885 typedef void ( *rtems_record_drain_visitor )(
1886  const rtems_record_item *items,
1887  size_t count,
1888  void *arg
1889 );
1890 
1891 void _Record_Drain(
1893  uint32_t cpu_index,
1894  rtems_record_drain_visitor visitor,
1895  void *arg
1896 );
1897 
1906 void rtems_record_drain( rtems_record_drain_visitor visitor, void *arg );
1907 
1910 #ifdef __cplusplus
1911 }
1912 #endif /* __cplusplus */
1913 
1914 #endif /* _RTEMS_RECORD_H */
Constants and Prototypes Related to the Internal Error Handler.
#define CPU_CACHE_LINE_BYTES
Definition: cpu.h:218
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_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
Definition: record.h:44
Definition: record.h:54
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
Definition: mknod-pack_dev.c:254
rtems_record_event
The record events.
Definition: recorddata.h:90
RTEMS_INLINE_ROUTINE void rtems_record_prepare_critical(rtems_record_context *context, const Per_CPU_Control *cpu_self)
Prepares to add and commit record items in a critical section with interrupts disabled.
Definition: record.h:501
The control block used to manage each watchdog timer.
Definition: watchdog.h:90
RTEMS_INLINE_ROUTINE void rtems_record_commit_critical(rtems_record_context *context)
Commits a set of record items in a critical section with interrupts disabled.
Definition: record.h:578
#define RTEMS_ALIGNED(_alignment)
Instructs the compiler to enforce the specified alignment.
Definition: basedefs.h:216
void rtems_record_produce_n(const rtems_record_item *items, size_t n)
Produces n record items.
Definition: record.c:71
Atomic Operations API.
void rtems_record_produce(rtems_record_event event, rtems_record_data data)
Produces a record item.
Definition: record.c:47
RTEMS_INLINE_ROUTINE void rtems_record_commit(rtems_record_context *context)
Commits a set of record items.
Definition: record.h:592
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
Internal_errors_Source
This type lists the possible sources from which an error can be reported.
Definition: interr.h:47
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_line_arg(rtems_record_data data)
Generates an RTEMS_RECORD_LINE event and one argument event.
Definition: record-util.c:73
#define RTEMS_COMPILER_MEMORY_BARRIER()
Definition: basedefs.h:77
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_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
Definition: thread.h:732
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
RTEMS_INLINE_ROUTINE void rtems_record_add(rtems_record_context *context, rtems_record_event event, rtems_record_data data)
Adds a record item.
Definition: record.h:552
Per CPU Core Structure.
Definition: percpu.h:347
#define RTEMS_RECORD_TIME_EVENT(time, event)
Builds a time event for the specified time stamp and event.
Definition: recorddata.h:1150
Free-Running Counter and Busy Wait Delay API.
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_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
Constants and Structures Associated with Watchdog Timers.
Used for passing and retrieving registers content to/from real mode interrupt call.
Definition: realmode_int.h:43
Definition: intercom.c:74
Definition: record.h:59
Definition: inftrees.h:24
RTEMS_INLINE_ROUTINE void rtems_record_prepare(rtems_record_context *context)
Prepares to add and commit record items.
Definition: record.h:527
void rtems_record_line(void)
Generates an RTEMS_RECORD_LINE event.
Definition: record-util.c:34
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_drain(rtems_record_drain_visitor visitor, void *arg)
Drains the record items on all processors.
Definition: record.c:172
unsigned long rtems_record_data
The record data integer type.
Definition: recorddata.h:1170
unsigned context
Definition: tlb.h:108
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
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
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66
CPU_Counter_ticks rtems_counter_ticks
Unsigned integer type for counter values.
Definition: counter.h:62
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