Remove WIVRN_DUMP_TIMINGS
This commit is contained in:
@@ -265,7 +265,7 @@ xrt_result_t compositor::mark_frame(int64_t frame_id,
|
||||
switch (point)
|
||||
{
|
||||
case XRT_COMPOSITOR_FRAME_POINT_WOKE:
|
||||
session.dump_time("wake_up", frame_id, when_ns);
|
||||
trace::instant_feedback("wake_up", when_ns, frame_id);
|
||||
return XRT_SUCCESS;
|
||||
default:
|
||||
assert(false);
|
||||
@@ -308,7 +308,7 @@ xrt_result_t compositor::layer_commit(xrt_graphics_sync_handle_t sync_handle)
|
||||
.alpha = layer_accum.data.env_blend_mode == XRT_BLEND_MODE_ALPHA_BLEND,
|
||||
};
|
||||
|
||||
session.dump_time("begin", frame.rendering.id, os_monotonic_get_ns());
|
||||
trace::instant_feedback("begin", frame.rendering.id, os_monotonic_get_ns());
|
||||
|
||||
cmd_pool.reset();
|
||||
cmd.begin({.flags = vk::CommandBufferUsageFlagBits::eOneTimeSubmit});
|
||||
|
||||
@@ -355,12 +355,6 @@ xrt_result_t wivrn::wivrn_session::create_session(std::unique_ptr<wivrn_connecti
|
||||
}
|
||||
}
|
||||
|
||||
auto dump_file = std::getenv("WIVRN_DUMP_TIMINGS");
|
||||
if (dump_file)
|
||||
{
|
||||
self->feedback_csv.open(dump_file);
|
||||
}
|
||||
|
||||
*out_xsysd = self.release();
|
||||
return XRT_SUCCESS;
|
||||
}
|
||||
@@ -788,17 +782,17 @@ void wivrn_session::operator()(from_headset::feedback && feedback)
|
||||
compositor.on_feedback(feedback, o);
|
||||
|
||||
if (feedback.received_first_packet)
|
||||
dump_time("receive_begin", feedback.frame_index, o.from_headset(feedback.received_first_packet), feedback.stream_index);
|
||||
trace::instant_feedback("receive_begin", o.from_headset(feedback.received_first_packet), feedback.frame_index, feedback.stream_index);
|
||||
if (feedback.received_last_packet)
|
||||
dump_time("receive_end", feedback.frame_index, o.from_headset(feedback.received_last_packet), feedback.stream_index);
|
||||
trace::instant_feedback("receive_end", o.from_headset(feedback.received_last_packet), feedback.frame_index, feedback.stream_index);
|
||||
if (feedback.sent_to_decoder)
|
||||
dump_time("decode_begin", feedback.frame_index, o.from_headset(feedback.sent_to_decoder), feedback.stream_index);
|
||||
trace::instant_feedback("decode_begin", o.from_headset(feedback.sent_to_decoder), feedback.frame_index, feedback.stream_index);
|
||||
if (feedback.received_from_decoder)
|
||||
dump_time("decode_end", feedback.frame_index, o.from_headset(feedback.received_from_decoder), feedback.stream_index);
|
||||
trace::instant_feedback("decode_end", o.from_headset(feedback.received_from_decoder), feedback.frame_index, feedback.stream_index);
|
||||
if (feedback.blitted)
|
||||
dump_time("blit", feedback.frame_index, o.from_headset(feedback.blitted), feedback.stream_index);
|
||||
trace::instant_feedback("blit", o.from_headset(feedback.blitted), feedback.frame_index, feedback.stream_index);
|
||||
if (feedback.displayed)
|
||||
dump_time("display", feedback.frame_index, o.from_headset(feedback.displayed), feedback.stream_index);
|
||||
trace::instant_feedback("display", o.from_headset(feedback.displayed), feedback.frame_index, feedback.stream_index);
|
||||
}
|
||||
|
||||
void wivrn_session::operator()(from_headset::battery && battery)
|
||||
@@ -1151,16 +1145,6 @@ void wivrn_session::set_foveated_size(uint32_t width, uint32_t height)
|
||||
hmd.set_foveated_size(width, height);
|
||||
}
|
||||
|
||||
void wivrn_session::dump_time(const std::string & event, uint64_t frame, int64_t time, uint8_t stream, const char * extra)
|
||||
{
|
||||
trace::instant_feedback(event.c_str(), time, frame, stream);
|
||||
if (feedback_csv)
|
||||
{
|
||||
std::lock_guard lock(csv_mutex);
|
||||
feedback_csv << std::quoted(event) << "," << frame << "," << time << "," << (int)stream << extra << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void wivrn_session::quit_if_no_client()
|
||||
{
|
||||
scoped_lock lock(xrt_system.sessions.mutex);
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
#include "wivrn_uinput.h"
|
||||
#include "xrt/xrt_results.h"
|
||||
#include "xrt/xrt_system.h"
|
||||
#include <fstream>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
@@ -110,9 +109,6 @@ class wivrn_session : public xrt_system_devices
|
||||
clock_offset_estimator offset_est;
|
||||
std::atomic<XrDuration> tracking_latency; // production to reception time
|
||||
|
||||
std::mutex csv_mutex;
|
||||
std::ofstream feedback_csv;
|
||||
|
||||
std::unique_ptr<audio_device> audio_handle;
|
||||
|
||||
// when sessions shall be destroyed, key is client id, value is timestamp
|
||||
@@ -217,8 +213,6 @@ public:
|
||||
|
||||
void set_foveated_size(uint32_t width, uint32_t height);
|
||||
|
||||
void dump_time(const std::string & event, uint64_t frame, int64_t time, uint8_t stream = -1, const char * extra = "");
|
||||
|
||||
private:
|
||||
void run_net(std::stop_token stop);
|
||||
void run_worker(std::stop_token stop);
|
||||
|
||||
@@ -287,8 +287,6 @@ void video_encoder::encode(wivrn_session & cnx,
|
||||
shard.timing_info.reset();
|
||||
|
||||
auto data = encode(encode_slot, frame_index);
|
||||
cnx.dump_time("encode_begin", frame_index, encode_begin, stream_idx);
|
||||
cnx.dump_time("encode_end", frame_index, os_monotonic_get_ns(), stream_idx);
|
||||
if (data)
|
||||
{
|
||||
timing_info.encode_end = clock.to_headset(os_monotonic_get_ns());
|
||||
@@ -304,7 +302,6 @@ void video_encoder::SendData(std::span<uint8_t> data, bool end_of_frame, bool co
|
||||
{
|
||||
// One SendData call per NAL; span the whole frame, not each call.
|
||||
wivrn::trace::cpu_begin(wivrn::trace::cpu_track::network, stream_idx, shard.frame_idx, "SendData");
|
||||
cnx->dump_time("send_begin", shard.frame_idx, os_monotonic_get_ns(), stream_idx);
|
||||
timing_info.send_begin = clock.to_headset(os_monotonic_get_ns());
|
||||
}
|
||||
if (end_of_frame)
|
||||
@@ -346,10 +343,7 @@ void video_encoder::SendData(std::span<uint8_t> data, bool end_of_frame, bool co
|
||||
begin = next;
|
||||
}
|
||||
if (end_of_frame)
|
||||
{
|
||||
cnx->dump_time("send_end", shard.frame_idx, os_monotonic_get_ns(), stream_idx);
|
||||
wivrn::trace::cpu_end(wivrn::trace::cpu_track::network, stream_idx, shard.frame_idx, "SendData");
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace wivrn
|
||||
|
||||
@@ -57,7 +57,7 @@ void set_calibration_source(::vk_bundle * monado_vk);
|
||||
|
||||
// Instant on the feedback track at an explicit monotonic timestamp.
|
||||
// name is copied at emit time (perfetto::DynamicString), so it need not outlive the call.
|
||||
void instant_feedback(const char * name, int64_t time_ns, uint64_t frame, uint8_t stream);
|
||||
void instant_feedback(const char * name, int64_t time_ns, uint64_t frame, uint8_t stream = -1);
|
||||
|
||||
// GPU-hardware-timestamped slice on the WiVRn encoder track.
|
||||
// begin_ns/end_ns must come from GPU query pools (gpu_timestamp_pool::collect),
|
||||
|
||||
Reference in New Issue
Block a user