RTEMS: Profiling Support

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
Files | Data Structures | Macros | Typedefs | Enumerations | Functions
Profiling Support
API

The profiling support offers functions to report profiling information available in the system. More...

## Files
file | profiling.h
| Profiling API.

## Data Structures
struct | rtems_profiling_header
| The profiling data header. More...
struct | rtems_profiling_per_cpu
| Per-CPU profiling data. More...
struct | rtems_profiling_smp_lock
| SMP lock profiling data. More...
union | rtems_profiling_data
| Collection of profiling data. More...

## Macros
#define | RTEMS_PROFILING_SMP_LOCK_CONTENTION_COUNTS 4
| Count of lock contention counters for SMP lock profiling.

## Typedefs
typedef void(* | rtems_profiling_visitor) (void *arg, const rtems_profiling_data *data)
| Visitor function for the profiling iteration.

## Enumerations
enum | rtems_profiling_type { RTEMS_PROFILING_PER_CPU , RTEMS_PROFILING_SMP_LOCK }
| Type of profiling data. More...

## Functions
void | rtems_profiling_iterate (rtems_profiling_visitor visitor, void *visitor_arg)
| Iterates through all profiling data of the system.
int | rtems_profiling_report_xml (const char *name, const rtems_printer *printer, uint32_t indentation_level, const char *indentation)
| Reports profiling data as XML.

## Detailed Description

The profiling support offers functions to report profiling information available in the system.

Profiling support is by default disabled. It must be enabled via the configure command line with the `–enable-profiling` option. In this case the RTEMS_PROFILING pre-processor symbol is defined and profiling statistics will be gathered during system run-time. The profiling support increases the time of critical sections and has some memory overhead. The overhead should be acceptable for most applications. The aim of the profiling implementation is to be available even for production systems so that verification is simplified.

Profiling information includes critical timing values such as the maximum time of disabled thread dispatching which is a measure for the thread dispatch latency. On SMP configurations statistics of all SMP locks in the system are available.

Profiling information can be retrieved via rtems_profiling_iterate() and reported as an XML dump via rtems_profiling_report_xml(). These functions are always available, but actual profiling data is only available if enabled at build configuration time.

## Typedef Documentation

## ◆ rtems_profiling_visitor

typedef void(* rtems_profiling_visitor) (void *arg, const rtems_profiling_data *data)

Visitor function for the profiling iteration.

Parameters

  [in,out] | arg | The visitor argument.
  [in] | data | The current profiling data.

See also
  rtems_profiling_iterate().

## Enumeration Type Documentation

## ◆ rtems_profiling_type

enum rtems_profiling_type

Type of profiling data.

Enumerator
RTEMS_PROFILING_PER_CPU | Type of per-CPU profiling data. See also rtems_profiling_per_cpu.
RTEMS_PROFILING_SMP_LOCK | Type of SMP lock profiling data. See also rtems_profiling_smp_lock.

## Function Documentation

## ◆ rtems_profiling_iterate()

void rtems_profiling_iterate | ( | rtems_profiling_visitor | visitor,
|  | void * | visitor_arg
| ) |  |

Iterates through all profiling data of the system.

Parameters

  [in] | visitor | The visitor.
  [in,out] | visitor_arg | The visitor argument.

## ◆ rtems_profiling_report_xml()

int rtems_profiling_report_xml | ( | const char * | name,
|  | const rtems_printer * | printer,
|  | uint32_t | indentation_level,
|  | const char * | indentation
| ) |  |

Reports profiling data as XML.

Parameters

  [in] | name | The name of the profiling report.
  [in] | printer | The RTEMS printer to send the output too.
  [in] | indentation_level | The current indentation level.
  [in] | indentation | The string used for indentation.

Returns
  As specified by printf().