Monado OpenXR Runtime
u_metrics.h
Go to the documentation of this file.
1// Copyright 2022, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Metrics saving functions.
6 * @author Jakob Bornecrantz <jakob@collabora.com>
7 * @ingroup aux_util
8 */
9
10#pragma once
11
12#include "xrt/xrt_compiler.h"
13
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
20{
21 int64_t session_id;
22 int64_t frame_id;
23 uint64_t predicted_frame_time_ns;
24 uint64_t predicted_wake_up_time_ns;
25 uint64_t predicted_gpu_done_time_ns;
26 uint64_t predicted_display_time_ns;
27 uint64_t predicted_display_period_ns;
28 uint64_t display_time_ns;
29 uint64_t when_predicted_ns;
30 uint64_t when_wait_woke_ns;
31 uint64_t when_begin_ns;
32 uint64_t when_delivered_ns;
33 uint64_t when_gpu_done_ns;
34 bool discarded;
35};
36
38{
39 int64_t session_id;
40 int64_t session_frame_id;
41 int64_t system_frame_id;
42 uint64_t when_ns;
43};
44
46{
47 int64_t frame_id;
48 uint64_t predicted_display_time_ns;
49 uint64_t predicted_display_period_ns;
50 uint64_t desired_present_time_ns;
51 uint64_t wake_up_time_ns;
52 uint64_t present_slop_ns;
53};
54
56{
57 int64_t frame_id;
58 uint64_t gpu_start_ns;
59 uint64_t gpu_end_ns;
60 uint64_t when_ns;
61};
62
64{
65 int64_t frame_id;
66 uint64_t expected_comp_time_ns;
67 uint64_t predicted_wake_up_time_ns;
68 uint64_t predicted_done_time_ns;
69 uint64_t predicted_display_time_ns;
70 uint64_t when_predict_ns;
71 uint64_t when_woke_ns;
72 uint64_t when_began_ns;
73 uint64_t when_submitted_ns;
74 uint64_t when_infoed_ns;
75 uint64_t desired_present_time_ns;
76 uint64_t present_slop_ns;
77 uint64_t present_margin_ns;
78 uint64_t actual_present_time_ns;
79 uint64_t earliest_present_time_ns;
80};
81
82
83void
84u_metrics_init(void);
85
86void
87u_metrics_close(void);
88
89bool
90u_metrics_is_active(void);
91
92void
93u_metrics_write_session_frame(struct u_metrics_session_frame *umsf);
94
95void
96u_metrics_write_used(struct u_metrics_used *umu);
97
98void
99u_metrics_write_system_frame(struct u_metrics_system_frame *umsf);
100
101void
102u_metrics_write_system_gpu_info(struct u_metrics_system_gpu_info *umgi);
103
104void
105u_metrics_write_system_present_info(struct u_metrics_system_present_info *umpi);
106
107
108#ifdef __cplusplus
109}
110#endif
Definition: u_metrics.h:20
Definition: u_metrics.h:46
Definition: u_metrics.h:56
Definition: u_metrics.h:64
Definition: u_metrics.h:38
Header holding common defines.