Monado OpenXR Runtime
u_metrics.c File Reference

Metrics saving functions. More...

#include "os/os_threading.h"
#include "util/u_metrics.h"
#include "util/u_debug.h"
#include "monado_metrics.pb.h"
#include "pb_encode.h"
#include <stdio.h>
Include dependency graph for u_metrics.c:

Macros

#define VERSION_MAJOR   1
 
#define VERSION_MINOR   1
 
#define COPY(_0, _1, _2, _3, FIELD, _4)   (record.record.session_frame.FIELD = umsf->FIELD);
 
#define COPY(_0, _1, _2, _3, FIELD, _4)   (record.record.used.FIELD = umu->FIELD);
 
#define COPY(_0, _1, _2, _3, FIELD, _4)   (record.record.system_frame.FIELD = umsf->FIELD);
 
#define COPY(_0, _1, _2, _3, FIELD, _4)   (record.record.system_gpu_info.FIELD = umgi->FIELD);
 
#define COPY(_0, _1, _2, _3, FIELD, _4)   (record.record.system_present_info.FIELD = umpi->FIELD);
 

Functions

static void write_record (monado_metrics_Record *r)
 
static void write_version (uint32_t major, uint32_t minor)
 
void u_metrics_init (void)
 
void u_metrics_close (void)
 
bool u_metrics_is_active (void)
 
void u_metrics_write_session_frame (struct u_metrics_session_frame *umsf)
 
void u_metrics_write_used (struct u_metrics_used *umu)
 
void u_metrics_write_system_frame (struct u_metrics_system_frame *umsf)
 
void u_metrics_write_system_gpu_info (struct u_metrics_system_gpu_info *umgi)
 
void u_metrics_write_system_present_info (struct u_metrics_system_present_info *umpi)
 

Variables

static FILE * g_file = NULL
 
static struct os_mutex g_file_mutex
 
static bool g_metrics_initialized = false
 
static bool g_metrics_early_flush = false
 

Detailed Description

Metrics saving functions.

Author
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m