RTEMS CPU Kit with SuperCore  4.11.3
captureimpl.h File Reference

Capture Implementation file. More...

#include "capture.h"
Include dependency graph for captureimpl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

#define RTEMS_CAPTURE_INIT   (1u << 0)
 
#define RTEMS_CAPTURE_ON   (1U << 1)
 
#define RTEMS_CAPTURE_NO_MEMORY   (1U << 2)
 
#define RTEMS_CAPTURE_TRIGGERED   (1U << 3)
 
#define RTEMS_CAPTURE_GLOBAL_WATCH   (1U << 4)
 
#define RTEMS_CAPTURE_ONLY_MONITOR   (1U << 5)
 
#define RTEMS_CAPTURE_OVERFLOW   (1U << 0)
 
#define RTEMS_CAPTURE_READER_ACTIVE   (1U << 1)
 
#define RTEMS_CAPTURE_READER_WAITING   (1U << 2)
 
#define rtems_capture_begin_add_record(_task, _events, _size, _rec)
 Capture begin add record. More...
 
#define rtems_capture_end_add_record(_rec)
 Capture end add record. More...
 
void rtems_capture_set_extension_index (int index)
 Capture set extension index. More...
 
int rtems_capture_get_extension_index (void)
 Capture get extension index. More...
 
uint32_t rtems_capture_get_flags (void)
 Capture get flags. More...
 
void rtems_capture_set_flags (uint32_t mask)
 Capture set flags. More...
 
rtems_status_code rtems_capture_user_extension_open (void)
 Capture user extension open. More...
 
rtems_status_code rtems_capture_user_extension_close (void)
 Capture user extension close. More...
 
bool rtems_capture_trigger (rtems_tcb *ft, rtems_tcb *tt, uint32_t events)
 Capture trigger. More...
 
bool rtems_capture_filter (rtems_tcb *task, uint32_t events)
 Capture filter. More...
 
void rtems_capture_get_time (rtems_capture_time_t *time)
 Capture returns the current time. More...
 
void * rtems_capture_record_open (rtems_tcb *task, uint32_t events, size_t size, rtems_interrupt_lock_context *lock_context)
 Capture record open. More...
 
void rtems_capture_record_close (void *rec, rtems_interrupt_lock_context *lock_context)
 Capture record close. More...
 
void rtems_capture_print_trace_records (int total, bool csv)
 Capture print trace records. More...
 
void rtems_capture_print_timestamp (uint64_t uptime)
 Capture print timestamp. More...
 
void rtems_capture_print_record_task (uint32_t cpu, rtems_capture_record_t *rec)
 Capture print record task. More...
 
void rtems_capture_print_record_capture (uint32_t cpu, rtems_capture_record_t *rec, uint64_t diff)
 Capture print capture record. More...
 
void rtems_capture_print_watch_list (void)
 Capture print watch list. More...
 

Detailed Description

Capture Implementation file.

This file contains an interface between the capture engine and capture user extension methods.

Macro Definition Documentation

◆ rtems_capture_begin_add_record

#define rtems_capture_begin_add_record (   _task,
  _events,
  _size,
  _rec 
)
Value:
do { \
rtems_interrupt_lock_context _lock_context; \
*_rec = rtems_capture_record_open( _task, _events, _size, &_lock_context );
void * rtems_capture_record_open(rtems_tcb *task, uint32_t events, size_t size, rtems_interrupt_lock_context *lock_context)
Capture record open.
Definition: capture.c:454

Capture begin add record.

This function opens a record for writing and inserts the header information

Parameters
[in]_taskspecifies the capture task block
[in]_eventsspecifies the events
[in]_sizespecifies the expected size of the capture record
[out]_recspecifies the next write point in the capture record

◆ rtems_capture_end_add_record

#define rtems_capture_end_add_record (   _rec)
Value:
rtems_capture_record_close( _rec, &_lock_context ); \
} while (0)
void rtems_capture_record_close(void *rec, rtems_interrupt_lock_context *lock_context)
Capture record close.
Definition: capture.c:488

Capture end add record.

This function completes the add capture record process

Parameters
[in]_recspecifies the end of the capture record

Function Documentation

◆ rtems_capture_filter()

bool rtems_capture_filter ( rtems_tcb task,
uint32_t  events 
)

Capture filter.

This function this function specifies if the given task and events should be logged.

Parameters
[in]taskspecifies the capture task control block
[in]eventsspecifies the events
Return values
Thismethod returns true if this data should be filtered from the log. It returns false if this data should be logged.

◆ rtems_capture_get_extension_index()

int rtems_capture_get_extension_index ( void  )

Capture get extension index.

This function rturns the extension index for the capture engine.

Return values
Thismethod returns the extension index.

◆ rtems_capture_get_flags()

uint32_t rtems_capture_get_flags ( void  )

Capture get flags.

This function gets the current flag settings for the capture engine.

Return values
Thismethod returns the global capture flags.

◆ rtems_capture_get_time()

void rtems_capture_get_time ( rtems_capture_time_t time)

Capture returns the current time.

This function returns the current time. If a handler is provided by the user the time is gotten from that.

Parameters
[in]timespecifies the capture time
Return values
Thismethod returns a nano-second time if no user handler is provided. Otherwise, it returns a resolution defined by the handler.

◆ rtems_capture_print_record_capture()

void rtems_capture_print_record_capture ( uint32_t  cpu,
rtems_capture_record_t rec,
uint64_t  diff 
)

Capture print capture record.

This function prints a user extension capture record.

Parameters
[in]cpuspecifies the cpu the cpu the record was logged on.
[in]recspecifies the record.
[in]diffspecifies the time between this and the last capture record.

◆ rtems_capture_print_record_task()

void rtems_capture_print_record_task ( uint32_t  cpu,
rtems_capture_record_t rec 
)

Capture print record task.

This function prints a capture record task. This record contains information to identify a task. It is refrenced in other records by the task id.

Parameters
[in]cpuspecifies the cpu the cpu the record was logged on.
[in]recspecifies the task record.

References rtems_capture_print_timestamp().

Referenced by rtems_capture_print_timestamp().

◆ rtems_capture_print_timestamp()

void rtems_capture_print_timestamp ( uint64_t  uptime)

Capture print timestamp.

This function prints uptime in a timestamp format.

Parameters
[in]uptimespecifies the timestamp to print

References rtems_capture_print_record_task().

Referenced by rtems_capture_print_record_task().

◆ rtems_capture_print_trace_records()

void rtems_capture_print_trace_records ( int  total,
bool  csv 
)

Capture print trace records.

This function reads, prints and releases up to total trace records in either a csv format or an ascii table format.

Parameters
[in]totalspecifies the number of records to print
[in]csvspecifies a comma seperated value format

References read(), rtems_capture_read(), rtems_get_processor_count(), rtems_status_text(), and RTEMS_SUCCESSFUL.

◆ rtems_capture_print_watch_list()

void rtems_capture_print_watch_list ( void  )

Capture print watch list.

This function prints a capture watch list

References rtems_capture_get_control_list(), rtems_capture_watch_get_ceiling(), rtems_capture_watch_get_floor(), and rtems_capture_watch_global_on().

◆ rtems_capture_record_close()

void rtems_capture_record_close ( void *  rec,
rtems_interrupt_lock_context lock_context 
)

Capture record close.

This function closes writing to capure record and releases the lock that was held on the record. This method should only be used by rtems_capture_end_add_record.

Parameters
[in]recspecifies the record
[out]lock_contextspecifies the lock context

References rtems_interrupt_lock_release.

◆ rtems_capture_record_open()

void* rtems_capture_record_open ( rtems_tcb task,
uint32_t  events,
size_t  size,
rtems_interrupt_lock_context lock_context 
)

Capture record open.

This function allocates a record and fills in the header information. It does a lock acquire which will remain in effect until rtems_capture_record_close is called. This method should only be used by rtems_capture_begin_add_record.

Parameters
[in]taskspecifies the caputre task block
[in]eventsspecifies the events
[in]sizespecifies capture record size
[out]lock_contextspecifies the lock context
Return values
Thismethod returns a pointer to the next location in the capture record to store data.

◆ rtems_capture_set_extension_index()

void rtems_capture_set_extension_index ( int  index)

Capture set extension index.

This function is used to set the extension index for the capture engine.

Parameters
[in]indexspecifies the extension index to be used for capture engine data.

◆ rtems_capture_set_flags()

void rtems_capture_set_flags ( uint32_t  mask)

Capture set flags.

This function sets a flag in the capture engine

Parameters
[in]maskspecifies the flag to set

◆ rtems_capture_trigger()

bool rtems_capture_trigger ( rtems_tcb ft,
rtems_tcb tt,
uint32_t  events 
)

Capture trigger.

This function checks if we have triggered or if this event is a cause of a trigger.

Parameters
[in]ftspecifies specifices the capture from task
[in]ttspecifies specifices the capture to task
[in]eventsspecifies the events
Return values
Thismethod returns true if we have triggered or if the event is a cause of a trigger.

◆ rtems_capture_user_extension_close()

rtems_status_code rtems_capture_user_extension_close ( void  )

Capture user extension close.

This function closes the capture user extensions.

Return values
Thismethod returns RTEMS_SUCCESSFUL upon a successful delete of the user extensions.

References rtems_extension_delete().

◆ rtems_capture_user_extension_open()

rtems_status_code rtems_capture_user_extension_open ( void  )

Capture user extension open.

This function creates the capture user extensions.

Return values
Thismethod returns RTEMS_SUCCESSFUL upon successful creation of the user extensions.