perf-logs: bound roomsetup/passthrough/event diagnostic logging

- roomsetup guard: monado-coordinates dump (and its public queries)
  behind MONADO_ROOMSETUP_COORDS_DEBUG; state changes/errors unchanged
- rift_s passthrough: 5s stereo INFO demoted to RIFT_S_LOG-gated debug,
  skipping the pixel scan when disabled; rejection warnings untouched
- steamvr_drv: repeated Unhandled Event log behind MONADO_STEAMVR_EVENT_DEBUG
This commit is contained in:
lbgos committed 2026-10-13 01:25:17 +03:00
1 parent 7371dd5300
commit cabb5eb4c4
3 files changed
+34 -9

No files matched your search

+14 -8
View File
@@ -12,6 +12,9 @@
#define VIEW_SIZE 320
#define MAX_AGE_NS (250 * U_TIME_1MS_IN_NS)
// Owned by target_builder_rift_s.c via RIFT_S_LOG; declared here to avoid a heavy header.
extern enum u_logging_level rift_s_log_level;
struct rift_s_passthrough
{
struct xrt_camera base;
@@ -141,14 +144,17 @@ rift_s_passthrough_push(struct xrt_camera *camera, struct xrt_frame *left, struc
uint64_t now = os_monotonic_get_ns();
if (now - p->last_diag_ns >= 5ULL * U_TIME_1S_IN_NS) {
p->last_diag_ns = now;
struct sensor_pixels pixels[2] = {measure_pixels(left), measure_pixels(right)};
double count = (double)left->width * left->height;
u_log(__FILE__, __LINE__, __func__, U_LOGGING_INFO,
"Passthrough stereo sequence=%" PRIu64 " timestamp=%" PRIu64
" left=%u,%u,%.3f right=%u,%u,%.3f rejected=%" PRIu64,
left->source_sequence, left->timestamp, pixels[0].min, pixels[0].max,
pixels[0].sum / count, pixels[1].min, pixels[1].max, pixels[1].sum / count,
p->rejected_pairs);
// Periodic stereo health is debug-only; rejection warnings below still emit.
if (rift_s_log_level <= U_LOGGING_DEBUG) {
struct sensor_pixels pixels[2] = {measure_pixels(left), measure_pixels(right)};
double count = (double)left->width * left->height;
U_LOG_IFL_D(rift_s_log_level,
"Passthrough stereo sequence=%" PRIu64 " timestamp=%" PRIu64
" left=%u,%u,%.3f right=%u,%u,%.3f rejected=%" PRIu64,
left->source_sequence, left->timestamp, pixels[0].min, pixels[0].max,
pixels[0].sum / count, pixels[1].min, pixels[1].max,
pixels[1].sum / count, p->rejected_pairs);
}
}
xrt_frame_reference(&p->raw[0], left);
xrt_frame_reference(&p->raw[1], right);
@@ -68,6 +68,9 @@ DEBUG_GET_ONCE_BOOL_OPTION(emulate_index_controller, "STEAMVR_EMULATE_INDEX_CONT
DEBUG_GET_ONCE_BOOL_OPTION(steamvr_bench, "MONADO_STEAMVR_BENCH", false)
// Repeated unhandled SteamVR events are diagnostics only; keep them behind explicit opt-in.
DEBUG_GET_ONCE_BOOL_OPTION(steamvr_event_debug, "MONADO_STEAMVR_EVENT_DEBUG", false)
DEBUG_GET_ONCE_BOOL_OPTION(native_room_setup, "STEAMVR_NATIVE_ROOM_SETUP", true)
DEBUG_GET_ONCE_BOOL_OPTION(native_room_setup_vrlink, "STEAMVR_NATIVE_ROOM_SETUP_VRLINK", false)
@@ -2103,7 +2106,10 @@ CServerDriver_Monado::RunFrame()
case vr::VREvent_Compositor_ChaperoneBoundsShown:
case vr::VREvent_Compositor_ChaperoneBoundsHidden: break;
default: ovrd_log("Unhandled Event: %d\n", event.eventType);
default:
if (debug_get_bool_option_steamvr_event_debug())
ovrd_log("Unhandled Event: %d\n", event.eventType);
break;
}
}
}
@@ -211,9 +211,22 @@ static bool restore(vr::IVRChaperoneSetup &setup, const fs::path &path, const Sn
return read_file(path) == saved.file;
}
// Coordinate dump issues several public queries per call. Keep it behind an
// explicit opt-in so default runs only pay for meaningful state changes/errors.
static bool
coords_debug_enabled()
{
static const bool enabled = [] {
const char *value = getenv("MONADO_ROOMSETUP_COORDS_DEBUG");
return value && value[0] != '\0' && !(value[0] == '0' && value[1] == '\0');
}();
return enabled;
}
// Capture public coordinate state on transitions without changing calibration.
static void log_coordinates(vr::IVRSystem &system, vr::IVRChaperoneSetup &setup, uint32_t event, uint32_t step)
{
if (!coords_debug_enabled()) return;
auto raw_to_standing = system.GetRawZeroPoseToStandingAbsoluteTrackingPose();
auto seated_to_standing = system.GetSeatedZeroPoseToStandingAbsoluteTrackingPose();
vr::HmdMatrix34_t standing_to_raw{};