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
+6
View File
@@ -22,6 +22,7 @@
#include <vulkan/vulkan_raii.hpp>
#include <vulkan/vulkan_structs.hpp>
#include "utils/gpu_timestamp_pool.h"
#include "utils/wivrn_vk_bundle.h"
#include "video_encoder.h"
#include "vk/allocation.h"
@@ -44,6 +45,11 @@ class video_encoder_vulkan : public video_encoder
uint64_t sem_value = 0;
vk::raii::QueryPool query_pool = nullptr;
gpu_timestamp_pool ts_pool;
// Optional per-op GPU timestamp pools; created only when their path runs.
gpu_timestamp_pool ts_pool_image_copy;
gpu_timestamp_pool ts_pool_host_copy;
gpu_timestamp_pool ts_pool_host_copy_overflow;
vk::raii::CommandPool transfer_command_pool = nullptr;
vk::raii::CommandPool video_command_pool = nullptr;