28#ifndef _RTEMS_RECORD_H
29#define _RTEMS_RECORD_H
31#include "recorddata.h"
35#include <rtems/score/cpu.h>
55 unsigned int item_count;
68void _Record_Initialize(
void );
70void _Record_Interrupt_initialize(
void );
74bool _Record_Thread_create(
79void _Record_Thread_start(
84void _Record_Thread_restart(
89void _Record_Thread_delete(
94void _Record_Thread_switch(
103void _Record_Fatal_dump_base64(
105 bool always_set_to_false,
106 Internal_errors_t code
109void _Record_Fatal_dump_base64_zlib(
111 bool always_set_to_false,
112 Internal_errors_t code
115void _Record_Thread_terminate(
119static inline unsigned int _Record_Index(
134 return _Atomic_Fetch_add_uint( &
control->head, 0, ATOMIC_ORDER_ACQUIRE );
136 return _Atomic_Load_uint( &
control->head, ATOMIC_ORDER_ACQUIRE );
145static inline bool _Record_Is_overflow(
151 return head - tail >=
control->mask + 1U;
154static inline unsigned int _Record_Capacity(
160 return ( tail - head - 1U ) &
control->mask;
165 return rtems_counter_read();
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];
180size_t _Record_String_to_items(
184 rtems_record_item *items,
188void _Record_Caller(
void *return_address );
190void _Record_Caller_3(
191 void *return_address,
196void _Record_Caller_4(
197 void *return_address,
206void _Record_Caller_arg_2(
207 void *return_address,
212void _Record_Caller_arg_3(
213 void *return_address,
219void _Record_Caller_arg_4(
220 void *return_address,
227void _Record_Caller_arg_5(
228 void *return_address,
236void _Record_Caller_arg_6(
237 void *return_address,
246void _Record_Caller_arg_7(
247 void *return_address,
257void _Record_Caller_arg_8(
258 void *return_address,
269void _Record_Caller_arg_9(
270 void *return_address,
282void _Record_Caller_arg_10(
283 void *return_address,
297 void *return_address,
304 void *return_address,
312 void *return_address,
321 void *return_address,
331 void *return_address,
342 void *return_address,
354 void *return_address,
367 void *return_address,
380void _Record_Entry_10(
381 void *return_address,
396 void *return_address,
403 void *return_address,
411 void *return_address,
420 void *return_address,
430 void *return_address,
441 void *return_address,
453 void *return_address,
466 void *return_address,
480 void *return_address,
513static inline void rtems_record_prepare_critical(
524 head = _Record_Head(
control );
525 context->head = head;
546 _CPU_ISR_Disable( level );
549 context->level = level;
550 cpu_self = _Per_CPU_Get();
553 head = _Record_Head(
control );
554 context->head = head;
564static inline void rtems_record_add(
571 rtems_record_item *item;
575 head = context->head;
577 context->head = head + 1;
579 item->event = context->now | event;
593 &context->control->head,
606 rtems_record_commit_critical( context );
608 _CPU_ISR_Enable( context->level );
641 const rtems_record_item *items,
899#define rtems_record_caller() _Record_Caller( RTEMS_RETURN_ADDRESS() )
914#define rtems_record_caller_3( event, data ) \
915 _Record_Caller_3( RTEMS_RETURN_ADDRESS(), event, data )
932#define rtems_record_caller_4( event_0, data_0, event_1, data_1 ) \
934 RTEMS_RETURN_ADDRESS(), \
953#define rtems_record_caller_arg( data ) \
954 _Record_Caller_arg( RTEMS_RETURN_ADDRESS(), data )
969#define rtems_record_caller_arg_2( data_0, data_1 ) \
970 _Record_Caller_arg_2( \
971 RTEMS_RETURN_ADDRESS(), \
990#define rtems_record_caller_arg_3( data_0, data_1, data_2 ) \
991 _Record_Caller_arg_3( \
992 RTEMS_RETURN_ADDRESS(), \
1013#define rtems_record_caller_arg_4( data_0, data_1, data_2, data_3 ) \
1014 _Record_Caller_arg_4( \
1015 RTEMS_RETURN_ADDRESS(), \
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(), \
1065#define rtems_record_caller_arg_6( \
1073 _Record_Caller_arg_6( \
1074 RTEMS_RETURN_ADDRESS(), \
1101#define rtems_record_caller_arg_7( \
1110 _Record_Caller_arg_7( \
1111 RTEMS_RETURN_ADDRESS(), \
1140#define rtems_record_caller_arg_8( \
1150 _Record_Caller_arg_8( \
1151 RTEMS_RETURN_ADDRESS(), \
1182#define rtems_record_caller_arg_9( \
1193 _Record_Caller_arg_9( \
1194 RTEMS_RETURN_ADDRESS(), \
1227#define rtems_record_caller_arg_10( \
1239 _Record_Caller_arg_10( \
1240 RTEMS_RETURN_ADDRESS(), \
1261#define rtems_record_entry( event ) \
1262 rtems_record_produce( event, (rtems_record_data) RTEMS_RETURN_ADDRESS() )
1273#define rtems_record_entry_1( event, data ) \
1274 rtems_record_produce_2( \
1276 (rtems_record_data) RTEMS_RETURN_ADDRESS(), \
1277 RTEMS_RECORD_ARG_0, \
1291#define rtems_record_entry_2( event, data_0, data_1 ) \
1292 _Record_Entry_2( RTEMS_RETURN_ADDRESS(), event, data_0, data_1 )
1305#define rtems_record_entry_3( event, data_0, data_1, data_2 ) \
1307 RTEMS_RETURN_ADDRESS(), \
1326#define rtems_record_entry_4( event, data_0, data_1, data_2, data_3 ) \
1328 RTEMS_RETURN_ADDRESS(), \
1349#define rtems_record_entry_5( \
1358 RTEMS_RETURN_ADDRESS(), \
1381#define rtems_record_entry_6( \
1391 RTEMS_RETURN_ADDRESS(), \
1416#define rtems_record_entry_7( \
1427 RTEMS_RETURN_ADDRESS(), \
1454#define rtems_record_entry_8( \
1466 RTEMS_RETURN_ADDRESS(), \
1495#define rtems_record_entry_9( \
1508 RTEMS_RETURN_ADDRESS(), \
1539#define rtems_record_entry_10( \
1553 RTEMS_RETURN_ADDRESS(), \
1575#define rtems_record_exit( event ) \
1576 rtems_record_produce( event, (rtems_record_data) RTEMS_RETURN_ADDRESS() )
1587#define rtems_record_exit_1( event, data ) \
1588 rtems_record_produce_2( \
1590 (rtems_record_data) RTEMS_RETURN_ADDRESS(), \
1591 RTEMS_RECORD_RETURN_0, \
1605#define rtems_record_exit_2( event, data_0, data_1 ) \
1606 _Record_Entry_2( RTEMS_RETURN_ADDRESS(), event, data_0, data_1 )
1619#define rtems_record_exit_3( event, data_0, data_1, data_2 ) \
1621 RTEMS_RETURN_ADDRESS(), \
1640#define rtems_record_exit_4( event, data_0, data_1, data_2, data_3 ) \
1642 RTEMS_RETURN_ADDRESS(), \
1663#define rtems_record_exit_5( \
1672 RTEMS_RETURN_ADDRESS(), \
1695#define rtems_record_exit_6( \
1705 RTEMS_RETURN_ADDRESS(), \
1730#define rtems_record_exit_7( \
1741 RTEMS_RETURN_ADDRESS(), \
1768#define rtems_record_exit_8( \
1780 RTEMS_RETURN_ADDRESS(), \
1809#define rtems_record_exit_9( \
1822 RTEMS_RETURN_ADDRESS(), \
1853#define rtems_record_exit_10( \
1867 RTEMS_RETURN_ADDRESS(), \
1996 rtems_record_item *items,
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
The control block used to manage each watchdog timer.
Definition: watchdog.h:109
Definition: intercom.c:87
This structure represents an interrupt entry.
Definition: intr.h:1070
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