Skip to content

Commit

Permalink
Remove redundant trace events (flutter#32812)
Browse files Browse the repository at this point in the history
dnfield authored Apr 21, 2022
1 parent 62054c5 commit 238eb9d
Showing 9 changed files with 6 additions and 50 deletions.
5 changes: 1 addition & 4 deletions flow/raster_cache.cc
Original file line number Diff line number Diff line change
@@ -511,10 +511,7 @@ void RasterCache::SweepOneCacheAfterFrame(RasterCacheKey::Map<Entry>& cache,
void RasterCache::CleanupAfterFrame() {
picture_metrics_ = {};
layer_metrics_ = {};
{
TRACE_EVENT0("flutter", "RasterCache::SweepCaches");
SweepOneCacheAfterFrame(cache_, picture_metrics_, layer_metrics_);
}
SweepOneCacheAfterFrame(cache_, picture_metrics_, layer_metrics_);
TraceStatsToTimeline();
}

3 changes: 0 additions & 3 deletions fml/message_loop_impl.cc
Original file line number Diff line number Diff line change
@@ -11,7 +11,6 @@

#include "flutter/fml/build_config.h"
#include "flutter/fml/logging.h"
#include "flutter/fml/trace_event.h"

#if FML_OS_MACOSX
#include "flutter/fml/platform/darwin/message_loop_darwin.h"
@@ -118,8 +117,6 @@ void MessageLoopImpl::DoTerminate() {
}

void MessageLoopImpl::FlushTasks(FlushType type) {
TRACE_EVENT0("fml", "MessageLoop::FlushTasks");

const auto now = fml::TimePoint::Now();
fml::closure invocation;
do {
13 changes: 0 additions & 13 deletions lib/ui/volatile_path_tracker.cc
Original file line number Diff line number Diff line change
@@ -27,13 +27,6 @@ void VolatilePathTracker::OnFrame() {
if (!enabled_) {
return;
}
#if !FLUTTER_RELEASE
std::string total_count = std::to_string(paths_.size());
TRACE_EVENT1("flutter", "VolatilePathTracker::OnFrame", "total_count",
total_count.c_str());
#else
TRACE_EVENT0("flutter", "VolatilePathTracker::OnFrame");
#endif

paths_.erase(std::remove_if(paths_.begin(), paths_.end(),
[](std::weak_ptr<TrackedPath> weak_path) {
@@ -50,12 +43,6 @@ void VolatilePathTracker::OnFrame() {
return false;
}),
paths_.end());

#if !FLUTTER_RELEASE
std::string post_removal_count = std::to_string(paths_.size());
TRACE_EVENT_INSTANT1("flutter", "VolatilePathTracker::OnFrame",
"remaining_count", post_removal_count.c_str());
#endif
}

} // namespace flutter
6 changes: 2 additions & 4 deletions runtime/runtime_controller.cc
Original file line number Diff line number Diff line change
@@ -227,8 +227,7 @@ bool RuntimeController::NotifyIdle(fml::TimePoint deadline) {
bool RuntimeController::DispatchPlatformMessage(
std::unique_ptr<PlatformMessage> message) {
if (auto* platform_configuration = GetPlatformConfigurationIfAvailable()) {
TRACE_EVENT1("flutter", "RuntimeController::DispatchPlatformMessage",
"mode", "basic");
TRACE_EVENT0("flutter", "RuntimeController::DispatchPlatformMessage");
platform_configuration->DispatchPlatformMessage(std::move(message));
return true;
}
@@ -239,8 +238,7 @@ bool RuntimeController::DispatchPlatformMessage(
bool RuntimeController::DispatchPointerDataPacket(
const PointerDataPacket& packet) {
if (auto* platform_configuration = GetPlatformConfigurationIfAvailable()) {
TRACE_EVENT1("flutter", "RuntimeController::DispatchPointerDataPacket",
"mode", "basic");
TRACE_EVENT0("flutter", "RuntimeController::DispatchPointerDataPacket");
platform_configuration->get_window(0)->DispatchPointerDataPacket(packet);
return true;
}
18 changes: 2 additions & 16 deletions shell/common/animator.cc
Original file line number Diff line number Diff line change
@@ -57,16 +57,6 @@ void Animator::EnqueueTraceFlowId(uint64_t trace_flow_id) {
});
}

// This Parity is used by the timeline component to correctly align
// GPU Workloads events with their respective Framework Workload.
const char* Animator::FrameParity() {
if (!frame_timings_recorder_) {
return "even";
}
uint64_t frame_number = frame_timings_recorder_->GetFrameNumber();
return (frame_number % 2) ? "even" : "odd";
}

static fml::TimePoint FxlToDartOrEarlier(fml::TimePoint time) {
auto dart_now = fml::TimeDelta::FromMicroseconds(Dart_TimelineGetMicros());
fml::TimePoint fxl_now = fml::TimePoint::Now();
@@ -121,12 +111,8 @@ void Animator::BeginFrame(
const fml::TimePoint frame_target_time =
frame_timings_recorder_->GetVsyncTargetTime();
dart_frame_deadline_ = FxlToDartOrEarlier(frame_target_time);
{
TRACE_EVENT2("flutter", "Framework Workload", "mode", "basic", "frame",
FrameParity());
uint64_t frame_number = frame_timings_recorder_->GetFrameNumber();
delegate_.OnAnimatorBeginFrame(frame_target_time, frame_number);
}
uint64_t frame_number = frame_timings_recorder_->GetFrameNumber();
delegate_.OnAnimatorBeginFrame(frame_target_time, frame_number);

if (!frame_scheduled_ && has_rendered_) {
// Under certain workloads (such as our parent view resizing us, which is
2 changes: 0 additions & 2 deletions shell/common/animator.h
Original file line number Diff line number Diff line change
@@ -94,8 +94,6 @@ class Animator final {

void AwaitVSync();

const char* FrameParity();

// Clear |trace_flow_ids_| if |frame_scheduled_| is false.
void ScheduleMaybeClearTraceFlowIds();

1 change: 0 additions & 1 deletion shell/common/engine.cc
Original file line number Diff line number Diff line change
@@ -244,7 +244,6 @@ Engine::RunStatus Engine::Run(RunConfiguration configuration) {
}

void Engine::BeginFrame(fml::TimePoint frame_time, uint64_t frame_number) {
TRACE_EVENT0("flutter", "Engine::BeginFrame");
runtime_controller_->BeginFrame(frame_time, frame_number);
}

5 changes: 1 addition & 4 deletions shell/common/pipeline.h
Original file line number Diff line number Diff line change
@@ -165,10 +165,7 @@ class Pipeline {
items_count = queue_.size();
}

{
TRACE_EVENT0("flutter", "PipelineConsume");
consumer(std::move(resource));
}
consumer(std::move(resource));

empty_.Signal();
--inflight_;
3 changes: 0 additions & 3 deletions shell/common/rasterizer.cc
Original file line number Diff line number Diff line change
@@ -492,7 +492,6 @@ RasterStatus Rasterizer::DoDraw(
RasterStatus Rasterizer::DrawToSurface(
FrameTimingsRecorder& frame_timings_recorder,
flutter::LayerTree& layer_tree) {
TRACE_EVENT0("flutter", "Rasterizer::DrawToSurface");
FML_DCHECK(surface_);

RasterStatus raster_status;
@@ -517,7 +516,6 @@ RasterStatus Rasterizer::DrawToSurface(
RasterStatus Rasterizer::DrawToSurfaceUnsafe(
FrameTimingsRecorder& frame_timings_recorder,
flutter::LayerTree& layer_tree) {
TRACE_EVENT0("flutter", "Rasterizer::DrawToSurfaceUnsafe");
FML_DCHECK(surface_);

compositor_context_->ui_time().SetLapTime(
@@ -629,7 +627,6 @@ RasterStatus Rasterizer::DrawToSurfaceUnsafe(
FireNextFrameCallbackIfPresent();

if (surface_->GetContext()) {
TRACE_EVENT0("flutter", "PerformDeferredSkiaCleanup");
surface_->GetContext()->performDeferredCleanup(kSkiaCleanupExpiration);
}

0 comments on commit 238eb9d

Please sign in to comment.