The frame window, the table of lows and the line schedule behind the panel's console lines (perf_watch.h).
More...
#include "perf_watch.h"
#include <string.h>
|
| void | perf_window_start (perf_window_t *w, int screen) |
| | Start an empty window on screen.
|
| static void | span_add (perf_span_t *s, uint32_t n, uint32_t us) |
| | Add us to s, the window's frame number n (0 first).
|
| 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.
|
| 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.
|
| void | perf_lows_init (perf_lows_t *t) |
| | Empty the table.
|
| void | perf_name_copy (char dst[PERF_LOWS_NAME], const char *name) |
| | Copy a task's name into a row-sized buffer.
|
| bool | perf_lows_note (perf_lows_t *t, const char *name, uint32_t least) |
| | Note least free bytes for name.
|
| int | perf_lows_take (perf_lows_t *t) |
| | Take the first row due for a line.
|
| perf_line_t | perf_line_due (uint32_t frames) |
| | The line due after frame frames.
|
The frame window, the table of lows and the line schedule behind the panel's console lines (perf_watch.h).
SPDX-License-Identifier: MIT
◆ perf_line_due()
The line due after frame frames.
The rate line closes a window of PERF_WINDOW_FRAMES frames; the window line follows on the next frame; every other frame may carry one row of the lows.
- Parameters
-
| frames | Frames drawn since the loop started, this one included. 2^32 is not a multiple of 300: the window across the wrap is 196 frames long, 3.2s at 60.4fps after 2.25 years. |
- Returns
- The line.
◆ perf_lows_init()
Empty the table.
- Parameters
-
◆ perf_lows_note()
| bool perf_lows_note |
( |
perf_lows_t * | t, |
|
|
const char * | name, |
|
|
uint32_t | least ) |
Note least free bytes for name.
- Parameters
-
| t | The table. |
| name | The task's name, or another the caller chooses; cut to PERF_LOWS_NAME - 1 bytes, of which no more are read (perf_name_copy()). NULL is noted as "". |
| least | The least free bytes now. |
- Returns
- true when the name is new or
least is below its last figure, which it then becomes, and the row is due for a line; false when it held or rose, and for a new name when every row is in use, which counts in dropped.
◆ perf_lows_take()
Take the first row due for a line.
- Parameters
-
- Returns
- The row's index, no longer due; -1 when none is due.
◆ perf_name_copy()
| void perf_name_copy |
( |
char | dst[PERF_LOWS_NAME], |
|
|
const char * | name ) |
Copy a task's name into a row-sized buffer.
Reads at most PERF_LOWS_NAME - 1 bytes of name and none past its terminator, so a name without one is cut, not run past.
- Parameters
-
| dst | The buffer, PERF_LOWS_NAME bytes; always terminated. |
| name | The name; NULL is copied as "". |
◆ perf_span_mean_us()
| 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.
- Parameters
-
| s | The figure's span. |
| frames | The frames it was added over. |
- Returns
- The mean, us; 0 with no frame.
◆ perf_window_add()
| 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.
- Parameters
-
| w | The window. |
| screen | The screen the frame was drawn on; another than the window's starts the window again on it, with this frame. |
| draw_us | The frame's paint time, us. |
| wait_us | How long the flip after it blocked, us. |
| turn_us | The part of wait_us Screen rotation 180° spent copying the frame turned, us; 0 in NORMAL. |
◆ perf_window_start()
Start an empty window on screen.
- Parameters
-
| w | The window. |
| screen | The screen its frames are drawn on. |
◆ span_add()
| void span_add |
( |
perf_span_t * | s, |
|
|
uint32_t | n, |
|
|
uint32_t | us ) |
|
static |
Add us to s, the window's frame number n (0 first).
- Parameters
-
| s | The span. |
| n | Frames added to the window before this one. |
| us | The figure, us. |