rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
perf_watch.h
Go to the documentation of this file.
1
28#pragma once
29
30#include <stdbool.h>
31#include <stdint.h>
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
39#define PERF_WINDOW_FRAMES 300u
40
43#define PERF_LOWS_MAX 48u
44
47#define PERF_LOWS_NAME 16u
48
50typedef struct {
51 uint32_t min_us;
52 uint32_t max_us;
53 uint64_t sum_us;
55
64
71void perf_window_start(perf_window_t *w, int screen);
72
84void perf_window_add(perf_window_t *w, int screen, uint32_t draw_us,
85 uint32_t wait_us, uint32_t turn_us);
86
94uint32_t perf_span_mean_us(const perf_span_t *s, uint32_t frames);
95
97typedef struct {
99 uint32_t least;
100} perf_low_t;
101
103typedef struct {
105 uint32_t count;
106 uint32_t dropped;
107 uint64_t due;
109
116
126void perf_name_copy(char dst[PERF_LOWS_NAME], const char *name);
127
141bool perf_lows_note(perf_lows_t *t, const char *name, uint32_t least);
142
150
157
170perf_line_t perf_line_due(uint32_t frames);
171
172#ifdef __cplusplus
173}
174#endif
#define s
Short name for esc_stick_s inside the five stick-class files.
Definition esc_stick_panel_int.h:295
int perf_lows_take(perf_lows_t *t)
Take the first row due for a line.
Definition perf_watch.c:101
void perf_window_start(perf_window_t *w, int screen)
Start an empty window on screen.
Definition perf_watch.c:14
uint32_t perf_span_mean_us(const perf_span_t *s, uint32_t frames)
The mean of one figure over frames, rounded to the nearest us.
Definition perf_watch.c:50
void perf_lows_init(perf_lows_t *t)
Empty the table.
Definition perf_watch.c:57
bool perf_lows_note(perf_lows_t *t, const char *name, uint32_t least)
Note least free bytes for name.
Definition perf_watch.c:74
perf_line_t perf_line_due(uint32_t frames)
The line due after frame frames.
Definition perf_watch.c:113
#define PERF_LOWS_NAME
Bytes of a name in the table, the terminator included; FreeRTOS's configMAX_TASK_NAME_LEN in ESP-IDF.
Definition perf_watch.h:47
#define PERF_LOWS_MAX
Rows in the table of lows: tasks, the internal heap, and room. At most 64, the bits of perf_lows_t::d...
Definition perf_watch.h:43
perf_line_t
The console line a frame carries.
Definition perf_watch.h:152
@ PERF_LINE_WINDOW
Definition perf_watch.h:154
@ PERF_LINE_RATE
Definition perf_watch.h:153
@ PERF_LINE_LOW
Definition perf_watch.h:155
void perf_name_copy(char dst[PERF_LOWS_NAME], const char *name)
Copy a task's name into a row-sized buffer.
Definition perf_watch.c:62
void perf_window_add(perf_window_t *w, int screen, uint32_t draw_us, uint32_t wait_us, uint32_t turn_us)
Add one frame.
Definition perf_watch.c:38
One name's least free bytes.
Definition perf_watch.h:97
uint32_t least
Definition perf_watch.h:99
char name[PERF_LOWS_NAME]
Definition perf_watch.h:98
The least free figure of every name noted.
Definition perf_watch.h:103
uint32_t count
Definition perf_watch.h:105
uint32_t dropped
Definition perf_watch.h:106
uint64_t due
Definition perf_watch.h:107
perf_low_t rows[PERF_LOWS_MAX]
Definition perf_watch.h:104
One figure's minimum, maximum and sum over a window.
Definition perf_watch.h:50
uint64_t sum_us
Definition perf_watch.h:53
uint32_t min_us
Definition perf_watch.h:51
uint32_t max_us
Definition perf_watch.h:52
The frames drawn on one screen since the window started.
Definition perf_watch.h:57
perf_span_t turn
Definition perf_watch.h:62
uint32_t frames
Definition perf_watch.h:59
perf_span_t wait
Definition perf_watch.h:61
perf_span_t draw
Definition perf_watch.h:60
int screen
Definition perf_watch.h:58