// perf_json.h -- the performance measurements as JSON, shared by the two // remote surfaces that report them: the DAP server's x16/perfStats and // x16/perfConfig (debug_server.c) and the RRDC control port's GET and POST // /perf (control_backend_perf.c). One builder each, so a field means the same // thing whichever way a client asked. Needs cJSON: built with HAS_DAP. #ifndef PERF_JSON_H #define PERF_JSON_H #include #include #include #include "perf_budget.h" #ifdef __cplusplus extern "C" { #endif cJSON *perf_json_stat(const perf_stat_t *s); // "30s", "session" (seconds <= 0). void perf_json_window_name(float seconds, char *out, size_t outsz); // A number of seconds, or a name as perf_json_window_name gives it. float perf_json_window_seconds(const cJSON *item); // One statistics window, as perfStats' windows[] entry; NULL if the window // could not be computed (profiling off). cJSON *perf_json_window(float seconds); cJSON *perf_json_budget(void); cJSON *perf_json_frame(const perf_frame_t *f); // VERA's bus for the last completed frame; `lines` adds each active line's // clocks (480 numbers). cJSON *perf_json_bandwidth(void); cJSON *perf_json_bandwidth_lines(void); // The sprite renderer's time for the last completed frame (sprite_trace); // {"enabled":false} while tracing is off. `lines` adds each line's budget used. cJSON *perf_json_sprites(bool lines); #ifdef __cplusplus } #endif #endif