Skip to content

Commit

Permalink
rm debug log flutter#6136
Browse files Browse the repository at this point in the history
  • Loading branch information
fzyzcjy committed Oct 11, 2022
1 parent e583b92 commit c3ece1b
Showing 1 changed file with 19 additions and 23 deletions.
42 changes: 19 additions & 23 deletions shell/common/rasterizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -504,13 +504,6 @@ RasterStatus Rasterizer::DrawToSurface(
return raster_status;
}

template <typename T>
std::string to_string(const T& value) {
std::ostringstream ss;
ss << value;
return ss.str();
}

void Rasterizer::MaybeSleepBeforeSubmit(
FrameTimingsRecorder& frame_timings_recorder) {
static const int MAX_HISTORY = 5;
Expand Down Expand Up @@ -547,22 +540,23 @@ void Rasterizer::MaybeSleepBeforeSubmit(

fml::TimeDelta sleep_duration = wakeup_time - now;

std::ostringstream info;
info << "should_sleep=" << should_sleep //
<< ", curr_latency=" << curr_latency //
<< ", vsync_target_time"
<< vsync_target_time.ToEpochDelta().ToMicroseconds() //
<< ", now" << now.ToEpochDelta().ToMicroseconds() //
<< ", wakeup_time" << wakeup_time.ToEpochDelta().ToMicroseconds() //
<< ", sleep_duration" << sleep_duration.ToMicroseconds() //
<< ", history_larger_latency_count=" << history_larger_latency_count //
<< ", history_latencies=";
for (int history_latency : history_latencies_) {
info << history_latency << ",";
}
info << ", ";
TRACE_EVENT1("flutter", "Rasterizer::MaybeSleepBeforeSubmit", "info",
info.str().c_str());
// std::ostringstream info;
// info << "should_sleep=" << should_sleep //
// << ", curr_latency=" << curr_latency //
// << ", vsync_target_time"
// << vsync_target_time.ToEpochDelta().ToMicroseconds() //
// << ", now" << now.ToEpochDelta().ToMicroseconds() //
// << ", wakeup_time" << wakeup_time.ToEpochDelta().ToMicroseconds() //
// << ", sleep_duration" << sleep_duration.ToMicroseconds() //
// << ", history_larger_latency_count=" << history_larger_latency_count
// //
// << ", history_latencies=";
// for (int history_latency : history_latencies_) {
// info << history_latency << ",";
// }
// info << ", ";
// TRACE_EVENT1("flutter", "Rasterizer::MaybeSleepBeforeSubmit", "info",
// info.str().c_str());

{
history_latencies_.push_back(curr_latency);
Expand All @@ -572,6 +566,8 @@ void Rasterizer::MaybeSleepBeforeSubmit(
}

if (should_sleep) {
TRACE_EVENT0("flutter", "SleepBeforeSubmit");

// TODO may use signals etc, instead of sleeping
std::this_thread::sleep_for(
std::chrono::microseconds(sleep_duration.ToMicroseconds()));
Expand Down

0 comments on commit c3ece1b

Please sign in to comment.