Add WiVRn-native Perfetto via Perfetto SDK

Optional server profiling built on the Perfetto SDK. Adds CPU spans
(compositor, encoder, network), GPU encode/copy slices from Vulkan timestamp
queries (Vulkan/NVENC/VAAPI), and headset feedback markers from dump_time.

WIVRN_TRACING enables tracing and selects the backend (system, inprocess, or
both); WIVRN_USE_PERFETTO gates it at build time and compiles it out otherwise.
WIVRN_TRACE_MONADO additionally drives Monado's percetto tracing from the same
switch so WiVRn and Monado land on one timeline.

Tooling: server-tracing[-monado] presets and a CI build, two Perfetto configs
(WiVRn-only and full-system), a wivrn_capture.py capture wrapper, a pftrace
summary script, and docs/profiling.md.
This commit is contained in:
Jonathan Steffan
2026-07-01 21:04:08 +02:00
committed by xytovl
parent b11655fdee
commit b9c8a54d92
34 changed files with 1968 additions and 58 deletions
+3 -3
View File
@@ -19,12 +19,12 @@
#include "target_instance_wivrn.h"
#include "utils/method.h"
#include "utils/wivrn_trace.h"
#include "xrt/xrt_instance.h"
#include "xrt/xrt_system.h"
#include "b_system.h"
#include "util/u_trace_marker.h"
#include <assert.h>
@@ -82,7 +82,7 @@ instance::instance() :
.is_system_available = method_pointer<&instance::is_system_available>,
.create_system = method_pointer<&instance::create_system>,
.get_prober = method_pointer<&instance::get_prober>,
.destroy = [](xrt_instance * ptr) { delete (instance *)ptr; },
.destroy = [](xrt_instance * ptr) { wivrn::trace::shutdown(); delete (instance *)ptr; },
.startup_timestamp = os_monotonic_get_ns(),
}
{
@@ -99,7 +99,7 @@ void instance::set_ipc_server(ipc_server * server)
xrt_result_t
xrt_instance_create(struct xrt_instance_info * ii, struct xrt_instance ** out_xinst)
{
u_trace_marker_init();
wivrn::trace::init();
*out_xinst = new wivrn::instance();