OXYGENHUB
◆ main enhanced-x16-emulator / src / perf_json.h
1.4 KiB · Objective-C · last changed feat: the RRDC control port (-controlport), contract 0.6: GET/POST /perf from the Performance panel's measurements, built by perf_json.c with DAP's x16/perfStats; a guest marker region named in advance; a framed guest's regions carried across the frame boundary and an interrupt after $F1 counted as work (#1) 25 days ago source blame history raw
1
// perf_json.h -- the performance measurements as JSON, shared by the two
2
// remote surfaces that report them: the DAP server's x16/perfStats and
3
// x16/perfConfig (debug_server.c) and the RRDC control port's GET and POST
4
// /perf (control_backend_perf.c). One builder each, so a field means the same
5
// thing whichever way a client asked. Needs cJSON: built with HAS_DAP.
6
#ifndef PERF_JSON_H
7
#define PERF_JSON_H
8
9
#include <stdbool.h>
10
#include <stddef.h>
11
#include <cjson/cJSON.h>
12
13
#include "perf_budget.h"
14
15
#ifdef __cplusplus
16
extern "C" {
17
#endif
18
19
cJSON *perf_json_stat(const perf_stat_t *s);
20
// "30s", "session" (seconds <= 0).
21
void   perf_json_window_name(float seconds, char *out, size_t outsz);
22
// A number of seconds, or a name as perf_json_window_name gives it.
23
float  perf_json_window_seconds(const cJSON *item);
24
// One statistics window, as perfStats' windows[] entry; NULL if the window
25
// could not be computed (profiling off).
26
cJSON *perf_json_window(float seconds);
27
cJSON *perf_json_budget(void);
28
cJSON *perf_json_frame(const perf_frame_t *f);
29
// VERA's bus for the last completed frame; `lines` adds each active line's
30
// clocks (480 numbers).
31
cJSON *perf_json_bandwidth(void);
32
cJSON *perf_json_bandwidth_lines(void);
33
// The sprite renderer's time for the last completed frame (sprite_trace);
34
// {"enabled":false} while tracing is off. `lines` adds each line's budget used.
35
cJSON *perf_json_sprites(bool lines);
36
37
#ifdef __cplusplus
38
}
39
#endif
40
41
#endif