RTEMS 6.1-rc5
Loading...
Searching...
No Matches
profiling.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
11/*
12 * Copyright (c) 2014 embedded brains GmbH & Co. KG
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 */
35
36#ifndef _RTEMS_PROFILING_H
37#define _RTEMS_PROFILING_H
38
39#include <stdint.h>
40
41#include <rtems/print.h>
42
43#ifdef __cplusplus
44extern "C" {
45#endif /* __cplusplus */
46
80typedef enum {
87
95
99typedef struct {
105
116typedef struct {
121
126
131
139
150
164
176
184
195
199#define RTEMS_PROFILING_SMP_LOCK_CONTENTION_COUNTS 4
200
219typedef struct {
224
228 const char *name;
229
234
239
245 uint64_t usage_count;
246
257
267
280
284typedef union {
289
294
300
310 void *arg,
311 const rtems_profiling_data *data
312);
313
322 void *visitor_arg
323);
324
336 const char *name,
337 const rtems_printer *printer,
338 uint32_t indentation_level,
339 const char *indentation
340);
341
344#ifdef __cplusplus
345}
346#endif /* __cplusplus */
347
348#endif /* _RTEMS_PROFILING_H */
void rtems_profiling_iterate(rtems_profiling_visitor visitor, void *visitor_arg)
Iterates through all profiling data of the system.
Definition: profilingiterate.c:163
rtems_profiling_type
Type of profiling data.
Definition: profiling.h:80
#define RTEMS_PROFILING_SMP_LOCK_CONTENTION_COUNTS
Count of lock contention counters for SMP lock profiling.
Definition: profiling.h:199
void(* rtems_profiling_visitor)(void *arg, const rtems_profiling_data *data)
Visitor function for the profiling iteration.
Definition: profiling.h:309
int rtems_profiling_report_xml(const char *name, const rtems_printer *printer, uint32_t indentation_level, const char *indentation)
Reports profiling data as XML.
Definition: profilingreportxml.c:294
@ RTEMS_PROFILING_PER_CPU
Type of per-CPU profiling data.
Definition: profiling.h:86
@ RTEMS_PROFILING_SMP_LOCK
Type of SMP lock profiling data.
Definition: profiling.h:93
User print interface to the bspIO print plug in.
Definition: printer.h:76
The profiling data header.
Definition: profiling.h:99
rtems_profiling_type type
The profiling data type.
Definition: profiling.h:103
Per-CPU profiling data.
Definition: profiling.h:116
uint32_t max_interrupt_time
The maximum time spent to process a single sequence of nested interrupts in nanoseconds.
Definition: profiling.h:175
uint64_t total_thread_dispatch_disabled_time
Total time of disabled thread dispatching in nanoseconds.
Definition: profiling.h:149
uint32_t max_thread_dispatch_disabled_time
The maximum time of disabled thread dispatching in nanoseconds.
Definition: profiling.h:130
rtems_profiling_header header
The profiling data header.
Definition: profiling.h:120
uint32_t max_interrupt_delay
The maximum interrupt delay in nanoseconds if supported by the hardware.
Definition: profiling.h:163
uint64_t total_interrupt_time
Total time of interrupt processing in nanoseconds.
Definition: profiling.h:193
uint32_t processor_index
The processor index of this profiling data.
Definition: profiling.h:125
uint64_t thread_dispatch_disabled_count
Count of times when the thread dispatch disable level changes from zero to one in thread context.
Definition: profiling.h:138
uint64_t interrupt_count
Count of times when the interrupt nest level changes from zero to one.
Definition: profiling.h:183
SMP lock profiling data.
Definition: profiling.h:219
uint64_t usage_count
The count of lock uses.
Definition: profiling.h:245
uint32_t max_acquire_time
The maximum lock acquire time in nanoseconds.
Definition: profiling.h:233
const char * name
The lock name.
Definition: profiling.h:228
rtems_profiling_header header
The profiling data header.
Definition: profiling.h:223
uint64_t total_section_time
Total lock section time in nanoseconds.
Definition: profiling.h:266
uint64_t total_acquire_time
Total lock acquire time in nanoseconds.
Definition: profiling.h:256
uint32_t max_section_time
The maximum lock section time in nanoseconds.
Definition: profiling.h:238
Collection of profiling data.
Definition: profiling.h:284
rtems_profiling_per_cpu per_cpu
Per-CPU profiling data if indicated by the header.
Definition: profiling.h:293
rtems_profiling_smp_lock smp_lock
SMP lock profiling data if indicated by the header.
Definition: profiling.h:298
rtems_profiling_header header
Header to specify the actual profiling data.
Definition: profiling.h:288