33 #ifndef _RTEMS_RECORDCLIENT_H 34 #define _RTEMS_RECORDCLIENT_H 36 #include "recorddata.h" 51 #define RTEMS_RECORD_CLIENT_MAXIMUM_CPU_COUNT 32 54 RTEMS_RECORD_CLIENT_SUCCESS,
55 RTEMS_RECORD_CLIENT_ERROR_INVALID_MAGIC,
56 RTEMS_RECORD_CLIENT_ERROR_UNKNOWN_FORMAT,
57 RTEMS_RECORD_CLIENT_ERROR_UNSUPPORTED_VERSION,
58 RTEMS_RECORD_CLIENT_ERROR_UNSUPPORTED_CPU,
59 RTEMS_RECORD_CLIENT_ERROR_UNSUPPORTED_CPU_MAX,
60 RTEMS_RECORD_CLIENT_ERROR_DOUBLE_CPU_MAX,
61 RTEMS_RECORD_CLIENT_ERROR_DOUBLE_PER_CPU_COUNT,
62 RTEMS_RECORD_CLIENT_ERROR_NO_CPU_MAX,
63 RTEMS_RECORD_CLIENT_ERROR_NO_MEMORY,
64 RTEMS_RECORD_CLIENT_ERROR_PER_CPU_ITEMS_OVERFLOW
65 } rtems_record_client_status;
67 typedef rtems_record_client_status ( *rtems_record_client_handler )(
83 uint32_t time_accumulated;
131 rtems_record_item_64 *items;
140 uint64_t to_bt_scaler;
147 rtems_record_item_64 format_64;
151 rtems_record_client_status ( *consume )(
156 rtems_record_client_handler handler;
159 uint32_t header[ 2 ];
160 rtems_record_client_status status;
175 rtems_record_client_handler handler,
204 static inline void rtems_record_client_set_handler(
206 rtems_record_client_handler handler
209 ctx->handler = handler;
212 static inline uint64_t rtems_record_client_bintime_to_nanoseconds(
217 uint64_t nanoseconds;
219 ns_per_sec = 1000000000ULL;
220 nanoseconds = ns_per_sec * ( (uint32_t) ( bt >> 32 ) );
221 nanoseconds += ( ns_per_sec * (uint32_t) bt ) >> 32;
226 static inline void rtems_record_client_bintime_to_seconds_and_nanoseconds(
229 uint32_t *nanoseconds
234 ns_per_sec = 1000000000ULL;
235 *seconds = (uint32_t) ( bt >> 32 );
236 *nanoseconds = (uint32_t) ( ( ns_per_sec * (uint32_t) bt ) >> 32 );
size_t item_index
The index for the next hold back item.
Definition: recordclient.h:136
void rtems_record_client_init(rtems_record_client_context *ctx, rtems_record_client_handler handler, void *arg)
Initializes a record client.
Definition: record-client.c:688
rtems_record_client_status rtems_record_client_run(rtems_record_client_context *ctx, const void *buf, size_t n)
Runs the record client to consume new stream data.
Definition: record-client.c:703
rtems_record_event
The record events.
Definition: recorddata.h:90
size_t tail_head_index
The index of the tail and head members.
Definition: recordclient.h:106
uint32_t overflow
Count of lost items due to ring buffer overflows.
Definition: recordclient.h:111
Definition: recordclient.h:139
Definition: recordclient.h:75
The 32-bit format record item.
Definition: recorddata.h:1183
bool hold_back
If true, then hold back items for overflow or initial ramp up processing.
Definition: recordclient.h:117
void rtems_record_client_destroy(rtems_record_client_context *ctx)
Drains all internal buffers and frees the allocated resources.
Definition: record-client.c:712