From 55d3ac957a69d3c68f574b725ab427510f7ac660 Mon Sep 17 00:00:00 2001 From: Zach Anderson Date: Wed, 12 Jun 2019 09:04:27 -0700 Subject: [PATCH 1/2] Revert "[fuchsia] Fix alignment of Fuchsia/non-Fuchsia tracing (#9289)" This reverts commit f80ac5f571479053b134e60bca77603269b2ce2a. --- fml/trace_event.h | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/fml/trace_event.h b/fml/trace_event.h index e3d5f6f6dae07..0f365bfb41add 100644 --- a/fml/trace_event.h +++ b/fml/trace_event.h @@ -15,16 +15,6 @@ #endif // !defined(FUCHSIA_SDK) #endif // defined(OS_FUCHSIA) -#if !defined(OS_FUCHSIA) || defined(FUCHSIA_SDK) - -#define TRACE_DURATION(args, ...) -#define TRACE_ASYNC_BEGIN(args, ...) -#define TRACE_ASYNC_END(args, ...) -#define TRACE_INSTANT(a, b, c) -#define TRACE_SCOPE_THREAD 0 - -#endif // !defined(OS_FUCHSIA) ||defined(FUCHSIA_SDK) - #include #include #include @@ -43,57 +33,45 @@ // This macro has the FML_ prefix so that it does not collide with the macros // from trace/event.h on Fuchsia. -// TODO(DNO-448): This is disabled because Fuchsia counter id json parsing -// only handles ints whereas this can produce ints or strings. #define FML_TRACE_COUNTER(category_group, name, counter_id, arg1, ...) \ ::fml::tracing::TraceCounter((category_group), (name), (counter_id), (arg1), \ __VA_ARGS__); #define FML_TRACE_EVENT(category_group, name, ...) \ - TRACE_DURATION(category_group, name); \ ::fml::tracing::TraceEvent((category_group), (name), __VA_ARGS__); \ __FML__AUTO_TRACE_END(name) #define FML_TRACE_EVENT0(category_group, name) \ - TRACE_DURATION(category_group, name); \ ::fml::tracing::TraceEvent0(category_group, name); \ __FML__AUTO_TRACE_END(name) #define FML_TRACE_EVENT1(category_group, name, arg1_name, arg1_val) \ - TRACE_DURATION(category_group, name, arg1_name, arg1_val); \ ::fml::tracing::TraceEvent1(category_group, name, arg1_name, arg1_val); \ __FML__AUTO_TRACE_END(name) #define FML_TRACE_EVENT2(category_group, name, arg1_name, arg1_val, arg2_name, \ arg2_val) \ - TRACE_DURATION(category_group, name, arg1_name, arg1_val, arg2_name, \ - arg2_val); \ ::fml::tracing::TraceEvent2(category_group, name, arg1_name, arg1_val, \ arg2_name, arg2_val); \ __FML__AUTO_TRACE_END(name) #define FML_TRACE_EVENT_ASYNC_BEGIN0(category_group, name, id) \ - TRACE_ASYNC_BEGIN(category_group, name, id); \ ::fml::tracing::TraceEventAsyncBegin0(category_group, name, id); #define FML_TRACE_EVENT_ASYNC_END0(category_group, name, id) \ - TRACE_ASYNC_END(category_group, name, id); \ ::fml::tracing::TraceEventAsyncEnd0(category_group, name, id); #define FML_TRACE_EVENT_ASYNC_BEGIN1(category_group, name, id, arg1_name, \ arg1_val) \ - TRACE_ASYNC_BEGIN(category_group, name, id, arg1_name, arg1_val); \ ::fml::tracing::TraceEventAsyncBegin1(category_group, name, id, arg1_name, \ arg1_val); #define FML_TRACE_EVENT_ASYNC_END1(category_group, name, id, arg1_name, \ arg1_val) \ - TRACE_ASYNC_END(category_group, name, id, arg1_name, arg1_val); \ ::fml::tracing::TraceEventAsyncEnd1(category_group, name, id, arg1_name, \ arg1_val); -#define FML_TRACE_EVENT_INSTANT0(category_group, name) \ - TRACE_INSTANT(category_group, name, TRACE_SCOPE_THREAD); \ +#define FML_TRACE_EVENT_INSTANT0(category_group, name) \ ::fml::tracing::TraceEventInstant0(category_group, name); #define FML_TRACE_FLOW_BEGIN(category, name, id) \ From 453234901c6a0b9ffdf7a51974207a8086fdedc0 Mon Sep 17 00:00:00 2001 From: Zach Anderson Date: Wed, 12 Jun 2019 09:04:46 -0700 Subject: [PATCH 2/2] Revert "Align fuchsia and non-fuchsia tracing (#9199)" This reverts commit 78265484623037c6544dfd5380367bca29fa27b0. --- assets/asset_manager.cc | 4 +- assets/zip_asset_store.cc | 6 +- flow/layers/backdrop_filter_layer.cc | 2 +- flow/layers/clip_path_layer.cc | 2 +- flow/layers/clip_rect_layer.cc | 2 +- flow/layers/clip_rrect_layer.cc | 2 +- flow/layers/color_filter_layer.cc | 2 +- flow/layers/container_layer.cc | 2 +- flow/layers/layer_tree.cc | 8 +-- flow/layers/opacity_layer.cc | 2 +- flow/layers/performance_overlay_layer.cc | 2 +- flow/layers/physical_shape_layer.cc | 2 +- flow/layers/picture_layer.cc | 2 +- flow/layers/shader_mask_layer.cc | 2 +- flow/layers/transform_layer.cc | 2 +- flow/raster_cache.cc | 2 +- flow/scene_update_context.cc | 2 +- fml/concurrent_message_loop.cc | 2 +- fml/message_loop_impl.cc | 2 +- fml/trace_event.h | 57 +++++++++++++------ lib/ui/compositing/scene.cc | 2 +- lib/ui/painting/codec.cc | 40 ++++++------- lib/ui/painting/image_encoding.cc | 4 +- runtime/dart_isolate.cc | 21 ++++--- runtime/dart_snapshot.cc | 4 +- runtime/dart_vm.cc | 14 +++-- runtime/runtime_controller.cc | 14 ++--- shell/common/animator.cc | 30 +++++----- shell/common/engine.cc | 16 +++--- shell/common/persistent_cache.cc | 6 +- shell/common/pipeline.h | 22 +++---- shell/common/rasterizer.cc | 8 +-- shell/common/shell.cc | 20 +++---- shell/common/skia_event_tracer_impl.cc | 2 +- shell/common/vsync_waiter.cc | 13 ++--- shell/gpu/gpu_surface_gl.cc | 6 +- shell/platform/android/android_context_gl.cc | 2 +- .../platform/android/android_shell_holder.cc | 4 +- .../android/android_surface_software.cc | 4 +- .../ios/framework/Source/FlutterEngine.mm | 4 +- .../ios/framework/Source/FlutterView.mm | 2 +- .../framework/Source/FlutterViewController.mm | 16 +++--- .../darwin/ios/ios_gl_render_target.mm | 2 +- shell/platform/darwin/ios/ios_surface_gl.mm | 2 +- .../darwin/ios/ios_surface_software.mm | 4 +- shell/platform/embedder/embedder.cc | 2 +- shell/platform/embedder/embedder_engine.cc | 4 +- .../embedder/embedder_surface_software.cc | 2 +- shell/platform/fuchsia/dart/dart_runner.cc | 3 +- shell/platform/fuchsia/dart/main.cc | 2 +- .../fuchsia/flutter/compositor_context.cc | 6 +- shell/platform/fuchsia/flutter/engine.cc | 4 +- .../fuchsia/flutter/fuchsia_font_manager.cc | 2 +- .../platform/fuchsia/flutter/platform_view.cc | 6 +- shell/platform/fuchsia/flutter/runner.cc | 2 +- .../fuchsia/flutter/session_connection.cc | 4 +- .../platform/fuchsia/flutter/vsync_waiter.cc | 2 +- .../fuchsia/flutter/vulkan_surface.cc | 4 +- .../fuchsia/flutter/vulkan_surface_pool.cc | 6 +- .../flutter/vulkan_surface_producer.cc | 4 +- third_party/txt/src/txt/font_collection.cc | 14 ++--- 61 files changed, 228 insertions(+), 208 deletions(-) diff --git a/assets/asset_manager.cc b/assets/asset_manager.cc index febff69a94216..60d169a31ebb2 100644 --- a/assets/asset_manager.cc +++ b/assets/asset_manager.cc @@ -35,8 +35,8 @@ std::unique_ptr AssetManager::GetAsMapping( if (asset_name.size() == 0) { return nullptr; } - FML_TRACE_EVENT1("flutter", "AssetManager::GetAsMapping", "name", - asset_name.c_str()); + TRACE_EVENT1("flutter", "AssetManager::GetAsMapping", "name", + asset_name.c_str()); for (const auto& resolver : resolvers_) { auto mapping = resolver->GetAsMapping(asset_name); if (mapping != nullptr) { diff --git a/assets/zip_asset_store.cc b/assets/zip_asset_store.cc index 864d8a69f36c6..44815a96b5c17 100644 --- a/assets/zip_asset_store.cc +++ b/assets/zip_asset_store.cc @@ -41,8 +41,8 @@ bool ZipAssetStore::IsValid() const { // |AssetResolver| std::unique_ptr ZipAssetStore::GetAsMapping( const std::string& asset_name) const { - FML_TRACE_EVENT1("flutter", "ZipAssetStore::GetAsMapping", "name", - asset_name.c_str()); + TRACE_EVENT1("flutter", "ZipAssetStore::GetAsMapping", "name", + asset_name.c_str()); auto found = stat_cache_.find(directory_ + "/" + asset_name); if (found == stat_cache_.end()) { @@ -84,7 +84,7 @@ std::unique_ptr ZipAssetStore::GetAsMapping( } void ZipAssetStore::BuildStatCache() { - FML_TRACE_EVENT0("flutter", "ZipAssetStore::BuildStatCache"); + TRACE_EVENT0("flutter", "ZipAssetStore::BuildStatCache"); auto unzipper = CreateUnzipper(); diff --git a/flow/layers/backdrop_filter_layer.cc b/flow/layers/backdrop_filter_layer.cc index 869370acf1646..573db97f191a2 100644 --- a/flow/layers/backdrop_filter_layer.cc +++ b/flow/layers/backdrop_filter_layer.cc @@ -12,7 +12,7 @@ BackdropFilterLayer::BackdropFilterLayer(sk_sp filter) BackdropFilterLayer::~BackdropFilterLayer() = default; void BackdropFilterLayer::Paint(PaintContext& context) const { - FML_TRACE_EVENT0("flutter", "BackdropFilterLayer::Paint"); + TRACE_EVENT0("flutter", "BackdropFilterLayer::Paint"); FML_DCHECK(needs_painting()); Layer::AutoSaveLayer save = Layer::AutoSaveLayer::Create( diff --git a/flow/layers/clip_path_layer.cc b/flow/layers/clip_path_layer.cc index 767c577510259..1d042b14b4ad9 100644 --- a/flow/layers/clip_path_layer.cc +++ b/flow/layers/clip_path_layer.cc @@ -54,7 +54,7 @@ void ClipPathLayer::UpdateScene(SceneUpdateContext& context) { #endif // defined(OS_FUCHSIA) void ClipPathLayer::Paint(PaintContext& context) const { - FML_TRACE_EVENT0("flutter", "ClipPathLayer::Paint"); + TRACE_EVENT0("flutter", "ClipPathLayer::Paint"); FML_DCHECK(needs_painting()); SkAutoCanvasRestore save(context.internal_nodes_canvas, true); diff --git a/flow/layers/clip_rect_layer.cc b/flow/layers/clip_rect_layer.cc index f04f15e492d15..103e2e021a92e 100644 --- a/flow/layers/clip_rect_layer.cc +++ b/flow/layers/clip_rect_layer.cc @@ -44,7 +44,7 @@ void ClipRectLayer::UpdateScene(SceneUpdateContext& context) { #endif // defined(OS_FUCHSIA) void ClipRectLayer::Paint(PaintContext& context) const { - FML_TRACE_EVENT0("flutter", "ClipRectLayer::Paint"); + TRACE_EVENT0("flutter", "ClipRectLayer::Paint"); FML_DCHECK(needs_painting()); SkAutoCanvasRestore save(context.internal_nodes_canvas, true); diff --git a/flow/layers/clip_rrect_layer.cc b/flow/layers/clip_rrect_layer.cc index f32cdaf2690df..cf866089b84b0 100644 --- a/flow/layers/clip_rrect_layer.cc +++ b/flow/layers/clip_rrect_layer.cc @@ -52,7 +52,7 @@ void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) { #endif // defined(OS_FUCHSIA) void ClipRRectLayer::Paint(PaintContext& context) const { - FML_TRACE_EVENT0("flutter", "ClipRRectLayer::Paint"); + TRACE_EVENT0("flutter", "ClipRRectLayer::Paint"); FML_DCHECK(needs_painting()); SkAutoCanvasRestore save(context.internal_nodes_canvas, true); diff --git a/flow/layers/color_filter_layer.cc b/flow/layers/color_filter_layer.cc index d6653d6985852..81579991916da 100644 --- a/flow/layers/color_filter_layer.cc +++ b/flow/layers/color_filter_layer.cc @@ -12,7 +12,7 @@ ColorFilterLayer::ColorFilterLayer(SkColor color, SkBlendMode blend_mode) ColorFilterLayer::~ColorFilterLayer() = default; void ColorFilterLayer::Paint(PaintContext& context) const { - FML_TRACE_EVENT0("flutter", "ColorFilterLayer::Paint"); + TRACE_EVENT0("flutter", "ColorFilterLayer::Paint"); FML_DCHECK(needs_painting()); SkPaint paint; diff --git a/flow/layers/container_layer.cc b/flow/layers/container_layer.cc index ff804c8e134a6..31a5a255afca9 100644 --- a/flow/layers/container_layer.cc +++ b/flow/layers/container_layer.cc @@ -16,7 +16,7 @@ void ContainerLayer::Add(std::shared_ptr layer) { } void ContainerLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { - FML_TRACE_EVENT0("flutter", "ContainerLayer::Preroll"); + TRACE_EVENT0("flutter", "ContainerLayer::Preroll"); SkRect child_paint_bounds = SkRect::MakeEmpty(); PrerollChildren(context, matrix, &child_paint_bounds); diff --git a/flow/layers/layer_tree.cc b/flow/layers/layer_tree.cc index 632c628a932c7..5de5f9a48fba9 100644 --- a/flow/layers/layer_tree.cc +++ b/flow/layers/layer_tree.cc @@ -26,7 +26,7 @@ void LayerTree::RecordBuildTime(fml::TimePoint start) { void LayerTree::Preroll(CompositorContext::ScopedFrame& frame, bool ignore_raster_cache) { - FML_TRACE_EVENT0("flutter", "LayerTree::Preroll"); + TRACE_EVENT0("flutter", "LayerTree::Preroll"); SkColorSpace* color_space = frame.canvas() ? frame.canvas()->imageInfo().colorSpace() : nullptr; frame.context().raster_cache().SetCheckboardCacheImages( @@ -48,7 +48,7 @@ void LayerTree::Preroll(CompositorContext::ScopedFrame& frame, #if defined(OS_FUCHSIA) void LayerTree::UpdateScene(SceneUpdateContext& context, scenic::ContainerNode& container) { - FML_TRACE_EVENT0("flutter", "LayerTree::UpdateScene"); + TRACE_EVENT0("flutter", "LayerTree::UpdateScene"); const auto& metrics = context.metrics(); SceneUpdateContext::Transform transform(context, // context 1.0f / metrics->scale_x, // X @@ -72,7 +72,7 @@ void LayerTree::UpdateScene(SceneUpdateContext& context, void LayerTree::Paint(CompositorContext::ScopedFrame& frame, bool ignore_raster_cache) const { - FML_TRACE_EVENT0("flutter", "LayerTree::Paint"); + TRACE_EVENT0("flutter", "LayerTree::Paint"); SkISize canvas_size = frame.canvas()->getBaseLayerSize(); SkNWayCanvas internal_nodes_canvas(canvas_size.width(), canvas_size.height()); internal_nodes_canvas.addCanvas(frame.canvas()); @@ -99,7 +99,7 @@ void LayerTree::Paint(CompositorContext::ScopedFrame& frame, } sk_sp LayerTree::Flatten(const SkRect& bounds) { - FML_TRACE_EVENT0("flutter", "LayerTree::Flatten"); + TRACE_EVENT0("flutter", "LayerTree::Flatten"); SkPictureRecorder recorder; auto* canvas = recorder.beginRecording(bounds); diff --git a/flow/layers/opacity_layer.cc b/flow/layers/opacity_layer.cc index afb31d6ece640..ba104dbc9e11b 100644 --- a/flow/layers/opacity_layer.cc +++ b/flow/layers/opacity_layer.cc @@ -53,7 +53,7 @@ void OpacityLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { } void OpacityLayer::Paint(PaintContext& context) const { - FML_TRACE_EVENT0("flutter", "OpacityLayer::Paint"); + TRACE_EVENT0("flutter", "OpacityLayer::Paint"); FML_DCHECK(needs_painting()); SkPaint paint; diff --git a/flow/layers/performance_overlay_layer.cc b/flow/layers/performance_overlay_layer.cc index aa31581563d2e..ebb279c966866 100644 --- a/flow/layers/performance_overlay_layer.cc +++ b/flow/layers/performance_overlay_layer.cc @@ -76,7 +76,7 @@ void PerformanceOverlayLayer::Paint(PaintContext& context) const { if (!options_) return; - FML_TRACE_EVENT0("flutter", "PerformanceOverlayLayer::Paint"); + TRACE_EVENT0("flutter", "PerformanceOverlayLayer::Paint"); SkScalar x = paint_bounds().x() + padding; SkScalar y = paint_bounds().y() + padding; SkScalar width = paint_bounds().width() - (padding * 2); diff --git a/flow/layers/physical_shape_layer.cc b/flow/layers/physical_shape_layer.cc index 3874e7cf60eb0..21c9265ce00dd 100644 --- a/flow/layers/physical_shape_layer.cc +++ b/flow/layers/physical_shape_layer.cc @@ -143,7 +143,7 @@ void PhysicalShapeLayer::UpdateScene(SceneUpdateContext& context) { #endif // defined(OS_FUCHSIA) void PhysicalShapeLayer::Paint(PaintContext& context) const { - FML_TRACE_EVENT0("flutter", "PhysicalShapeLayer::Paint"); + TRACE_EVENT0("flutter", "PhysicalShapeLayer::Paint"); FML_DCHECK(needs_painting()); if (elevation_ != 0) { diff --git a/flow/layers/picture_layer.cc b/flow/layers/picture_layer.cc index 438267e9a64e7..c4275e76c13cf 100644 --- a/flow/layers/picture_layer.cc +++ b/flow/layers/picture_layer.cc @@ -37,7 +37,7 @@ void PictureLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { } void PictureLayer::Paint(PaintContext& context) const { - FML_TRACE_EVENT0("flutter", "PictureLayer::Paint"); + TRACE_EVENT0("flutter", "PictureLayer::Paint"); FML_DCHECK(picture_.get()); FML_DCHECK(needs_painting()); diff --git a/flow/layers/shader_mask_layer.cc b/flow/layers/shader_mask_layer.cc index 3e91563ac6375..36e7b7332aeae 100644 --- a/flow/layers/shader_mask_layer.cc +++ b/flow/layers/shader_mask_layer.cc @@ -14,7 +14,7 @@ ShaderMaskLayer::ShaderMaskLayer(sk_sp shader, ShaderMaskLayer::~ShaderMaskLayer() = default; void ShaderMaskLayer::Paint(PaintContext& context) const { - FML_TRACE_EVENT0("flutter", "ShaderMaskLayer::Paint"); + TRACE_EVENT0("flutter", "ShaderMaskLayer::Paint"); FML_DCHECK(needs_painting()); Layer::AutoSaveLayer save = diff --git a/flow/layers/transform_layer.cc b/flow/layers/transform_layer.cc index fc1be8448216d..c56e5f81bdd49 100644 --- a/flow/layers/transform_layer.cc +++ b/flow/layers/transform_layer.cc @@ -57,7 +57,7 @@ void TransformLayer::UpdateScene(SceneUpdateContext& context) { #endif // defined(OS_FUCHSIA) void TransformLayer::Paint(PaintContext& context) const { - FML_TRACE_EVENT0("flutter", "TransformLayer::Paint"); + TRACE_EVENT0("flutter", "TransformLayer::Paint"); FML_DCHECK(needs_painting()); SkAutoCanvasRestore save(context.internal_nodes_canvas, true); diff --git a/flow/raster_cache.cc b/flow/raster_cache.cc index 6324d093563e8..4ad18adf172e4 100644 --- a/flow/raster_cache.cc +++ b/flow/raster_cache.cc @@ -98,7 +98,7 @@ static RasterCacheResult Rasterize( bool checkerboard, const SkRect& logical_rect, std::function draw_function) { - FML_TRACE_EVENT0("flutter", "RasterCachePopulate"); + TRACE_EVENT0("flutter", "RasterCachePopulate"); SkIRect cache_rect = RasterCache::GetDeviceBounds(logical_rect, ctm); const SkImageInfo image_info = SkImageInfo::MakeN32Premul( diff --git a/flow/scene_update_context.cc b/flow/scene_update_context.cc index bdc3a8200f6d0..4f07edd43dd3c 100644 --- a/flow/scene_update_context.cc +++ b/flow/scene_update_context.cc @@ -193,7 +193,7 @@ scenic::Image* SceneUpdateContext::GenerateImageIfNeeded( std::vector< std::unique_ptr> SceneUpdateContext::ExecutePaintTasks(CompositorContext::ScopedFrame& frame) { - FML_TRACE_EVENT0("flutter", "SceneUpdateContext::ExecutePaintTasks"); + TRACE_EVENT0("flutter", "SceneUpdateContext::ExecutePaintTasks"); std::vector> surfaces_to_submit; for (auto& task : paint_tasks_) { FML_DCHECK(task.surface); diff --git a/fml/concurrent_message_loop.cc b/fml/concurrent_message_loop.cc index a036b4f1c29c4..23c820787faf9 100644 --- a/fml/concurrent_message_loop.cc +++ b/fml/concurrent_message_loop.cc @@ -59,7 +59,7 @@ void ConcurrentMessageLoop::WorkerMain() { if (!shutdown_) { wait_condition_.wait(lock); } - FML_TRACE_EVENT0("fml", "ConcurrentWorkerWake"); + TRACE_EVENT0("fml", "ConcurrentWorkerWake"); RunSingleExpiredTaskNow(); } diff --git a/fml/message_loop_impl.cc b/fml/message_loop_impl.cc index 390e1051a6542..f1efe0a36e8d4 100644 --- a/fml/message_loop_impl.cc +++ b/fml/message_loop_impl.cc @@ -137,7 +137,7 @@ void MessageLoopImpl::RegisterTask(fml::closure task, } void MessageLoopImpl::FlushTasks(FlushType type) { - FML_TRACE_EVENT0("fml", "MessageLoop::FlushTasks"); + TRACE_EVENT0("fml", "MessageLoop::FlushTasks"); std::vector invocations; // We are grabbing this lock here as a proxy to indicate diff --git a/fml/trace_event.h b/fml/trace_event.h index 0f365bfb41add..9f86bcfa04b0c 100644 --- a/fml/trace_event.h +++ b/fml/trace_event.h @@ -10,8 +10,24 @@ #if defined(OS_FUCHSIA) #if !defined(FUCHSIA_SDK) +// Forward to the system tracing mechanism on Fuchsia. + #include +// TODO(DNO-448): This is disabled because the Fuchsia counter id json parsing +// only handles ints whereas this can produce ints or strings. +#define FML_TRACE_COUNTER(a, b, c, args...) +#define FML_TRACE_EVENT(a, b, args...) TRACE_DURATION(a, b) + +#define TRACE_EVENT0(a, b) TRACE_DURATION(a, b) +#define TRACE_EVENT1(a, b, c, d) TRACE_DURATION(a, b, c, d) +#define TRACE_EVENT2(a, b, c, d, e, f) TRACE_DURATION(a, b, c, d, e, f) +#define TRACE_EVENT_ASYNC_BEGIN0(a, b, c) TRACE_ASYNC_BEGIN(a, b, c) +#define TRACE_EVENT_ASYNC_END0(a, b, c) TRACE_ASYNC_END(a, b, c) +#define TRACE_EVENT_ASYNC_BEGIN1(a, b, c, d, e) TRACE_ASYNC_BEGIN(a, b, c, d, e) +#define TRACE_EVENT_ASYNC_END1(a, b, c, d, e) TRACE_ASYNC_END(a, b, c, d, e) +#define TRACE_EVENT_INSTANT0(a, b) TRACE_INSTANT(a, b, TRACE_SCOPE_THREAD) + #endif // !defined(FUCHSIA_SDK) #endif // defined(OS_FUCHSIA) @@ -25,6 +41,9 @@ #include "flutter/fml/time/time_point.h" #include "third_party/dart/runtime/include/dart_tools_api.h" +#if !defined(OS_FUCHSIA) || defined(FUCHSIA_SDK) +#ifndef TRACE_EVENT_HIDE_MACROS + #define __FML__TOKEN_CAT__(x, y) x##y #define __FML__TOKEN_CAT__2(x, y) __FML__TOKEN_CAT__(x, y) #define __FML__AUTO_TRACE_END(name) \ @@ -33,6 +52,8 @@ // This macro has the FML_ prefix so that it does not collide with the macros // from trace/event.h on Fuchsia. +// +// TODO(chinmaygarde): All macros here should have the FML prefix. #define FML_TRACE_COUNTER(category_group, name, counter_id, arg1, ...) \ ::fml::tracing::TraceCounter((category_group), (name), (counter_id), (arg1), \ __VA_ARGS__); @@ -41,48 +62,50 @@ ::fml::tracing::TraceEvent((category_group), (name), __VA_ARGS__); \ __FML__AUTO_TRACE_END(name) -#define FML_TRACE_EVENT0(category_group, name) \ +#define TRACE_EVENT0(category_group, name) \ ::fml::tracing::TraceEvent0(category_group, name); \ __FML__AUTO_TRACE_END(name) -#define FML_TRACE_EVENT1(category_group, name, arg1_name, arg1_val) \ +#define TRACE_EVENT1(category_group, name, arg1_name, arg1_val) \ ::fml::tracing::TraceEvent1(category_group, name, arg1_name, arg1_val); \ __FML__AUTO_TRACE_END(name) -#define FML_TRACE_EVENT2(category_group, name, arg1_name, arg1_val, arg2_name, \ - arg2_val) \ - ::fml::tracing::TraceEvent2(category_group, name, arg1_name, arg1_val, \ - arg2_name, arg2_val); \ +#define TRACE_EVENT2(category_group, name, arg1_name, arg1_val, arg2_name, \ + arg2_val) \ + ::fml::tracing::TraceEvent2(category_group, name, arg1_name, arg1_val, \ + arg2_name, arg2_val); \ __FML__AUTO_TRACE_END(name) -#define FML_TRACE_EVENT_ASYNC_BEGIN0(category_group, name, id) \ +#define TRACE_EVENT_ASYNC_BEGIN0(category_group, name, id) \ ::fml::tracing::TraceEventAsyncBegin0(category_group, name, id); -#define FML_TRACE_EVENT_ASYNC_END0(category_group, name, id) \ +#define TRACE_EVENT_ASYNC_END0(category_group, name, id) \ ::fml::tracing::TraceEventAsyncEnd0(category_group, name, id); -#define FML_TRACE_EVENT_ASYNC_BEGIN1(category_group, name, id, arg1_name, \ - arg1_val) \ +#define TRACE_EVENT_ASYNC_BEGIN1(category_group, name, id, arg1_name, \ + arg1_val) \ ::fml::tracing::TraceEventAsyncBegin1(category_group, name, id, arg1_name, \ arg1_val); -#define FML_TRACE_EVENT_ASYNC_END1(category_group, name, id, arg1_name, \ - arg1_val) \ - ::fml::tracing::TraceEventAsyncEnd1(category_group, name, id, arg1_name, \ +#define TRACE_EVENT_ASYNC_END1(category_group, name, id, arg1_name, arg1_val) \ + ::fml::tracing::TraceEventAsyncEnd1(category_group, name, id, arg1_name, \ arg1_val); -#define FML_TRACE_EVENT_INSTANT0(category_group, name) \ +#define TRACE_EVENT_INSTANT0(category_group, name) \ ::fml::tracing::TraceEventInstant0(category_group, name); -#define FML_TRACE_FLOW_BEGIN(category, name, id) \ +#define TRACE_FLOW_BEGIN(category, name, id) \ ::fml::tracing::TraceEventFlowBegin0(category, name, id); -#define FML_TRACE_FLOW_STEP(category, name, id) \ +#define TRACE_FLOW_STEP(category, name, id) \ ::fml::tracing::TraceEventFlowStep0(category, name, id); -#define FML_TRACE_FLOW_END(category, name, id) \ +#define TRACE_FLOW_END(category, name, id) \ ::fml::tracing::TraceEventFlowEnd0(category, name, id); +#endif // TRACE_EVENT_HIDE_MACROS +#endif // !defined(OS_FUCHSIA) || defined(FUCHSIA_SDK) + namespace fml { namespace tracing { diff --git a/lib/ui/compositing/scene.cc b/lib/ui/compositing/scene.cc index 907f644f3392f..fd3e86c7e5176 100644 --- a/lib/ui/compositing/scene.cc +++ b/lib/ui/compositing/scene.cc @@ -54,7 +54,7 @@ void Scene::dispose() { Dart_Handle Scene::toImage(uint32_t width, uint32_t height, Dart_Handle raw_image_callback) { - FML_TRACE_EVENT0("flutter", "Scene::toImage"); + TRACE_EVENT0("flutter", "Scene::toImage"); if (!m_layerTree) { return tonic::ToDart("Scene did not contain a layer tree."); diff --git a/lib/ui/painting/codec.cc b/lib/ui/painting/codec.cc index b756d9d498e39..d8418bd7455ca 100644 --- a/lib/ui/painting/codec.cc +++ b/lib/ui/painting/codec.cc @@ -47,7 +47,7 @@ static void InvokeCodecCallback(fml::RefPtr codec, size_t trace_id) { std::shared_ptr dart_state = callback->dart_state().lock(); if (!dart_state) { - FML_TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); + TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); return; } tonic::DartState::Scope scope(dart_state); @@ -56,14 +56,14 @@ static void InvokeCodecCallback(fml::RefPtr codec, } else { DartInvoke(callback->value(), {ToDart(codec)}); } - FML_TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); + TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); } static sk_sp DecodeImage(fml::WeakPtr context, sk_sp buffer, size_t trace_id) { - FML_TRACE_FLOW_STEP("flutter", kInitCodecTraceTag, trace_id); - FML_TRACE_EVENT0("flutter", "DecodeImage"); + TRACE_FLOW_STEP("flutter", kInitCodecTraceTag, trace_id); + TRACE_EVENT0("flutter", "DecodeImage"); if (buffer == nullptr || buffer->isEmpty()) { return nullptr; @@ -159,8 +159,8 @@ static sk_sp DecodeAndResizeImageToExactSize( SkImageInfo scaledImageInfo, sk_sp buffer, size_t trace_id) { - FML_TRACE_FLOW_STEP("flutter", kInitCodecTraceTag, trace_id); - FML_TRACE_EVENT0("flutter", "DecodeAndResizeImageToExactSize"); + TRACE_FLOW_STEP("flutter", kInitCodecTraceTag, trace_id); + TRACE_EVENT0("flutter", "DecodeAndResizeImageToExactSize"); // Do not create a cross context image here, since it can not be resized. sk_sp image = SkImage::MakeFromEncoded(std::move(buffer)); @@ -194,8 +194,8 @@ fml::RefPtr InitCodec(fml::WeakPtr context, const int targetWidth, const int targetHeight, size_t trace_id) { - FML_TRACE_FLOW_STEP("flutter", kInitCodecTraceTag, trace_id); - FML_TRACE_EVENT0("blink", "InitCodec"); + TRACE_FLOW_STEP("flutter", kInitCodecTraceTag, trace_id); + TRACE_EVENT0("blink", "InitCodec"); if (buffer == nullptr || buffer->isEmpty()) { FML_LOG(ERROR) << "InitCodec failed - buffer was empty "; @@ -233,8 +233,8 @@ fml::RefPtr InitCodecUncompressed( int targetWidth, int targetHeight, size_t trace_id) { - FML_TRACE_FLOW_STEP("flutter", kInitCodecTraceTag, trace_id); - FML_TRACE_EVENT0("blink", "InitCodecUncompressed"); + TRACE_FLOW_STEP("flutter", kInitCodecTraceTag, trace_id); + TRACE_EVENT0("blink", "InitCodecUncompressed"); if (buffer == nullptr || buffer->isEmpty()) { FML_LOG(ERROR) << "InitCodecUncompressed failed - buffer was empty"; @@ -360,11 +360,11 @@ bool ConvertImageInfo(Dart_Handle image_info_handle, void InstantiateImageCodec(Dart_NativeArguments args) { static size_t trace_counter = 1; const size_t trace_id = trace_counter++; - FML_TRACE_FLOW_BEGIN("flutter", kInitCodecTraceTag, trace_id); + TRACE_FLOW_BEGIN("flutter", kInitCodecTraceTag, trace_id); Dart_Handle callback_handle = Dart_GetNativeArgument(args, 1); if (!Dart_IsClosure(callback_handle)) { - FML_TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); + TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); Dart_SetReturnValue(args, ToDart("Callback must be a function")); return; } @@ -374,7 +374,7 @@ void InstantiateImageCodec(Dart_NativeArguments args) { if (!Dart_IsNull(image_info_handle)) { image_info = std::make_unique(); if (!ConvertImageInfo(image_info_handle, args, image_info.get())) { - FML_TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); + TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); return; } } @@ -383,7 +383,7 @@ void InstantiateImageCodec(Dart_NativeArguments args) { tonic::Uint8List list = tonic::DartConverter::FromArguments(args, 0, exception); if (exception) { - FML_TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); + TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); Dart_SetReturnValue(args, exception); return; } @@ -391,7 +391,7 @@ void InstantiateImageCodec(Dart_NativeArguments args) { if (image_info) { int expected_size = image_info->row_bytes * image_info->sk_info.height(); if (list.num_elements() < expected_size) { - FML_TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); + TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); list.Release(); Dart_SetReturnValue( args, ToDart("Pixel buffer size does not match image size")); @@ -458,7 +458,7 @@ void InvokeNextFrameCallback(fml::RefPtr frameInfo, size_t trace_id) { std::shared_ptr dart_state = callback->dart_state().lock(); if (!dart_state) { - FML_TRACE_FLOW_END("flutter", kCodecNextFrameTraceTag, trace_id); + TRACE_FLOW_END("flutter", kCodecNextFrameTraceTag, trace_id); return; } tonic::DartState::Scope scope(dart_state); @@ -467,7 +467,7 @@ void InvokeNextFrameCallback(fml::RefPtr frameInfo, } else { DartInvoke(callback->value(), {ToDart(frameInfo)}); } - FML_TRACE_FLOW_END("flutter", kCodecNextFrameTraceTag, trace_id); + TRACE_FLOW_END("flutter", kCodecNextFrameTraceTag, trace_id); } } // namespace @@ -585,16 +585,16 @@ void MultiFrameCodec::GetNextFrameAndInvokeCallback( InvokeNextFrameCallback(frameInfo, std::move(callback), trace_id); })); - FML_TRACE_FLOW_END("flutter", kCodecNextFrameTraceTag, trace_id); + TRACE_FLOW_END("flutter", kCodecNextFrameTraceTag, trace_id); } Dart_Handle MultiFrameCodec::getNextFrame(Dart_Handle callback_handle) { static size_t trace_counter = 1; const size_t trace_id = trace_counter++; - FML_TRACE_FLOW_BEGIN("flutter", kCodecNextFrameTraceTag, trace_id); + TRACE_FLOW_BEGIN("flutter", kCodecNextFrameTraceTag, trace_id); if (!Dart_IsClosure(callback_handle)) { - FML_TRACE_FLOW_END("flutter", kCodecNextFrameTraceTag, trace_id); + TRACE_FLOW_END("flutter", kCodecNextFrameTraceTag, trace_id); return ToDart("Callback must be a function"); } diff --git a/lib/ui/painting/image_encoding.cc b/lib/ui/painting/image_encoding.cc index 3c0acaef93ce8..a554264761727 100644 --- a/lib/ui/painting/image_encoding.cc +++ b/lib/ui/painting/image_encoding.cc @@ -70,7 +70,7 @@ sk_sp ConvertToRasterImageIfNecessary(sk_sp image, return nullptr; } - FML_TRACE_EVENT0("flutter", __FUNCTION__); + TRACE_EVENT0("flutter", __FUNCTION__); // Create a GPU surface with the context and then do a device to host copy of // image contents. @@ -135,7 +135,7 @@ sk_sp CopyImageByteData(sk_sp raster_image, sk_sp EncodeImage(sk_sp p_image, GrContext* context, ImageByteFormat format) { - FML_TRACE_EVENT0("flutter", __FUNCTION__); + TRACE_EVENT0("flutter", __FUNCTION__); // Check validity of the image. if (p_image == nullptr) { diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index fb9aa7b5f4597..345792cadfc97 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -42,7 +42,7 @@ std::weak_ptr DartIsolate::CreateRootIsolate( Dart_IsolateFlags* flags, fml::closure isolate_create_callback, fml::closure isolate_shutdown_callback) { - FML_TRACE_EVENT0("flutter", "DartIsolate::CreateRootIsolate"); + TRACE_EVENT0("flutter", "DartIsolate::CreateRootIsolate"); Dart_Isolate vm_isolate = nullptr; std::weak_ptr embedder_isolate; @@ -142,7 +142,7 @@ DartIsolate::Phase DartIsolate::GetPhase() const { } bool DartIsolate::Initialize(Dart_Isolate dart_isolate, bool is_root_isolate) { - FML_TRACE_EVENT0("flutter", "DartIsolate::Initialize"); + TRACE_EVENT0("flutter", "DartIsolate::Initialize"); if (phase_ != Phase::Uninitialized) { return false; } @@ -245,7 +245,7 @@ bool DartIsolate::UpdateThreadPoolNames() const { } bool DartIsolate::LoadLibraries(bool is_root_isolate) { - FML_TRACE_EVENT0("flutter", "DartIsolate::LoadLibraries"); + TRACE_EVENT0("flutter", "DartIsolate::LoadLibraries"); if (phase_ != Phase::Initialized) { return false; } @@ -271,8 +271,7 @@ bool DartIsolate::LoadLibraries(bool is_root_isolate) { } bool DartIsolate::PrepareForRunningFromPrecompiledCode() { - FML_TRACE_EVENT0("flutter", - "DartIsolate::PrepareForRunningFromPrecompiledCode"); + TRACE_EVENT0("flutter", "DartIsolate::PrepareForRunningFromPrecompiledCode"); if (phase_ != Phase::LibrariesSetup) { return false; } @@ -330,7 +329,7 @@ FML_WARN_UNUSED_RESULT bool DartIsolate::PrepareForRunningFromKernel( std::shared_ptr mapping, bool last_piece) { - FML_TRACE_EVENT0("flutter", "DartIsolate::PrepareForRunningFromKernel"); + TRACE_EVENT0("flutter", "DartIsolate::PrepareForRunningFromKernel"); if (phase_ != Phase::LibrariesSetup) { return false; } @@ -420,7 +419,7 @@ bool DartIsolate::PrepareForRunningFromKernels( } bool DartIsolate::MarkIsolateRunnable() { - FML_TRACE_EVENT0("flutter", "DartIsolate::MarkIsolateRunnable"); + TRACE_EVENT0("flutter", "DartIsolate::MarkIsolateRunnable"); if (phase_ != Phase::LibrariesSetup) { return false; } @@ -477,7 +476,7 @@ FML_WARN_UNUSED_RESULT bool DartIsolate::Run(const std::string& entrypoint_name, const std::vector& args, fml::closure on_run) { - FML_TRACE_EVENT0("flutter", "DartIsolate::Run"); + TRACE_EVENT0("flutter", "DartIsolate::Run"); if (phase_ != Phase::Ready) { return false; } @@ -507,7 +506,7 @@ bool DartIsolate::RunFromLibrary(const std::string& library_name, const std::string& entrypoint_name, const std::vector& args, fml::closure on_run) { - FML_TRACE_EVENT0("flutter", "DartIsolate::RunFromLibrary"); + TRACE_EVENT0("flutter", "DartIsolate::RunFromLibrary"); if (phase_ != Phase::Ready) { return false; } @@ -534,7 +533,7 @@ bool DartIsolate::RunFromLibrary(const std::string& library_name, } bool DartIsolate::Shutdown() { - FML_TRACE_EVENT0("flutter", "DartIsolate::Shutdown"); + TRACE_EVENT0("flutter", "DartIsolate::Shutdown"); // This call may be re-entrant since Dart_ShutdownIsolate can invoke the // cleanup callback which deletes the embedder side object of the dart isolate // (a.k.a. this). @@ -676,7 +675,7 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair( std::shared_ptr* p_parent_embedder_isolate, bool is_root_isolate, char** error) { - FML_TRACE_EVENT0("flutter", "DartIsolate::CreateDartVMAndEmbedderObjectPair"); + TRACE_EVENT0("flutter", "DartIsolate::CreateDartVMAndEmbedderObjectPair"); std::unique_ptr> embedder_isolate( p_parent_embedder_isolate); diff --git a/runtime/dart_snapshot.cc b/runtime/dart_snapshot.cc index 23e5cc1cde060..c666d1c236e62 100644 --- a/runtime/dart_snapshot.cc +++ b/runtime/dart_snapshot.cc @@ -147,7 +147,7 @@ static std::shared_ptr ResolveIsolateInstructions( fml::RefPtr DartSnapshot::VMSnapshotFromSettings( const Settings& settings) { - FML_TRACE_EVENT0("flutter", "DartSnapshot::VMSnapshotFromSettings"); + TRACE_EVENT0("flutter", "DartSnapshot::VMSnapshotFromSettings"); auto snapshot = fml::MakeRefCounted(ResolveVMData(settings), // ResolveVMInstructions(settings) // @@ -160,7 +160,7 @@ fml::RefPtr DartSnapshot::VMSnapshotFromSettings( fml::RefPtr DartSnapshot::IsolateSnapshotFromSettings( const Settings& settings) { - FML_TRACE_EVENT0("flutter", "DartSnapshot::IsolateSnapshotFromSettings"); + TRACE_EVENT0("flutter", "DartSnapshot::IsolateSnapshotFromSettings"); auto snapshot = fml::MakeRefCounted(ResolveIsolateData(settings), // ResolveIsolateInstructions(settings) // diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index 81542a3249b62..a09a87d106012 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -259,7 +259,7 @@ DartVM::DartVM(std::shared_ptr vm_data, vm_data_(vm_data), isolate_name_server_(std::move(isolate_name_server)), service_protocol_(std::make_shared()) { - FML_TRACE_EVENT0("flutter", "DartVMInitializer"); + TRACE_EVENT0("flutter", "DartVMInitializer"); gVMLaunchCount++; @@ -271,7 +271,7 @@ DartVM::DartVM(std::shared_ptr vm_data, << (IsRunningPrecompiledCode() ? "AOT" : "Interpreter"); { - FML_TRACE_EVENT0("flutter", "dart::bin::BootstrapDartIo"); + TRACE_EVENT0("flutter", "dart::bin::BootstrapDartIo"); dart::bin::BootstrapDartIo(); if (!settings_.temp_directory_path.empty()) { @@ -342,9 +342,6 @@ DartVM::DartVM(std::shared_ptr vm_data, } if (settings_.trace_systrace) { -#if defined(OS_FUCHSIA) - PushBackAll(&args, kDartFuchsiaTraceArgs, fml::size(kDartFuchsiaTraceArgs)); -#endif // OS_FUCHSIA PushBackAll(&args, kDartSystraceTraceBufferArgs, fml::size(kDartSystraceTraceBufferArgs)); PushBackAll(&args, kDartTraceStreamsArgs, fml::size(kDartTraceStreamsArgs)); @@ -354,6 +351,11 @@ DartVM::DartVM(std::shared_ptr vm_data, PushBackAll(&args, kDartTraceStartupArgs, fml::size(kDartTraceStartupArgs)); } +#if defined(OS_FUCHSIA) + PushBackAll(&args, kDartFuchsiaTraceArgs, fml::size(kDartFuchsiaTraceArgs)); + PushBackAll(&args, kDartTraceStreamsArgs, fml::size(kDartTraceStreamsArgs)); +#endif + for (size_t i = 0; i < settings_.dart_flags.size(); i++) args.push_back(settings_.dart_flags[i].c_str()); @@ -366,7 +368,7 @@ DartVM::DartVM(std::shared_ptr vm_data, DartUI::InitForGlobal(); { - FML_TRACE_EVENT0("flutter", "Dart_Initialize"); + TRACE_EVENT0("flutter", "Dart_Initialize"); Dart_InitializeParams params = {}; params.version = DART_INITIALIZE_PARAMS_CURRENT_VERSION; params.vm_snapshot_data = vm_data_->GetVMSnapshot().GetDataMapping(); diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index 851a1c6618e03..c0d9c3efda892 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -251,7 +251,7 @@ bool RuntimeController::NotifyIdle(int64_t deadline) { // Idle notifications being in isolate scope are part of the contract. if (idle_notification_callback_) { - FML_TRACE_EVENT0("flutter", "EmbedderIdleNotification"); + TRACE_EVENT0("flutter", "EmbedderIdleNotification"); idle_notification_callback_(deadline); } return true; @@ -260,8 +260,8 @@ bool RuntimeController::NotifyIdle(int64_t deadline) { bool RuntimeController::DispatchPlatformMessage( fml::RefPtr message) { if (auto* window = GetWindowIfAvailable()) { - FML_TRACE_EVENT1("flutter", "RuntimeController::DispatchPlatformMessage", - "mode", "basic"); + TRACE_EVENT1("flutter", "RuntimeController::DispatchPlatformMessage", + "mode", "basic"); window->DispatchPlatformMessage(std::move(message)); return true; } @@ -271,8 +271,8 @@ bool RuntimeController::DispatchPlatformMessage( bool RuntimeController::DispatchPointerDataPacket( const PointerDataPacket& packet) { if (auto* window = GetWindowIfAvailable()) { - FML_TRACE_EVENT1("flutter", "RuntimeController::DispatchPointerDataPacket", - "mode", "basic"); + TRACE_EVENT1("flutter", "RuntimeController::DispatchPointerDataPacket", + "mode", "basic"); window->DispatchPointerDataPacket(packet); return true; } @@ -282,8 +282,8 @@ bool RuntimeController::DispatchPointerDataPacket( bool RuntimeController::DispatchSemanticsAction(int32_t id, SemanticsAction action, std::vector args) { - FML_TRACE_EVENT1("flutter", "RuntimeController::DispatchSemanticsAction", - "mode", "basic"); + TRACE_EVENT1("flutter", "RuntimeController::DispatchSemanticsAction", "mode", + "basic"); if (auto* window = GetWindowIfAvailable()) { window->DispatchSemanticsAction(id, action, std::move(args)); return true; diff --git a/shell/common/animator.cc b/shell/common/animator.cc index 579a0857799de..3632476ff6a1b 100644 --- a/shell/common/animator.cc +++ b/shell/common/animator.cc @@ -94,13 +94,12 @@ static int64_t FxlToDartOrEarlier(fml::TimePoint time) { void Animator::BeginFrame(fml::TimePoint frame_start_time, fml::TimePoint frame_target_time) { - FML_TRACE_EVENT_ASYNC_END0("flutter", "Frame Request Pending", - frame_number_++); + TRACE_EVENT_ASYNC_END0("flutter", "Frame Request Pending", frame_number_++); - FML_TRACE_EVENT0("flutter", "Animator::BeginFrame"); + TRACE_EVENT0("flutter", "Animator::BeginFrame"); while (!trace_flow_ids_.empty()) { uint64_t trace_flow_id = trace_flow_ids_.front(); - FML_TRACE_FLOW_END("flutter", "PointerEvent", trace_flow_id); + TRACE_FLOW_END("flutter", "PointerEvent", trace_flow_id); trace_flow_ids_.pop_front(); } @@ -131,8 +130,8 @@ void Animator::BeginFrame(fml::TimePoint frame_start_time, last_begin_frame_time_ = frame_start_time; dart_frame_deadline_ = FxlToDartOrEarlier(frame_target_time); { - FML_TRACE_EVENT2("flutter", "Framework Workload", "mode", "basic", "frame", - FrameParity()); + TRACE_EVENT2("flutter", "Framework Workload", "mode", "basic", "frame", + FrameParity()); delegate_.OnAnimatorBeginFrame(last_begin_frame_time_); } @@ -156,7 +155,7 @@ void Animator::BeginFrame(fml::TimePoint frame_start_time, // assume that we are idle, and notify the engine of this. if (notify_idle_task_id == self->notify_idle_task_id_ && !self->frame_scheduled_) { - FML_TRACE_EVENT0("flutter", "BeginFrame idle callback"); + TRACE_EVENT0("flutter", "BeginFrame idle callback"); self->delegate_.OnAnimatorNotifyIdle(Dart_TimelineGetMicros() + 100000); } @@ -213,15 +212,14 @@ void Animator::RequestFrame(bool regenerate_layer_tree) { // started an expensive operation right after posting this message however. // To support that, we need edge triggered wakes on VSync. - task_runners_.GetUITaskRunner()->PostTask( - [self = weak_factory_.GetWeakPtr(), frame_number = frame_number_]() { - if (!self.get()) { - return; - } - FML_TRACE_EVENT_ASYNC_BEGIN0("flutter", "Frame Request Pending", - frame_number); - self->AwaitVSync(); - }); + task_runners_.GetUITaskRunner()->PostTask([self = weak_factory_.GetWeakPtr(), + frame_number = frame_number_]() { + if (!self.get()) { + return; + } + TRACE_EVENT_ASYNC_BEGIN0("flutter", "Frame Request Pending", frame_number); + self->AwaitVSync(); + }); frame_scheduled_ = true; } diff --git a/shell/common/engine.cc b/shell/common/engine.cc index bcb6e72c7a95c..3b38e577ab2c8 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -101,7 +101,7 @@ bool Engine::UpdateAssetManager( } bool Engine::Restart(RunConfiguration configuration) { - FML_TRACE_EVENT0("flutter", "Engine::Restart"); + TRACE_EVENT0("flutter", "Engine::Restart"); if (!configuration.IsValid()) { FML_LOG(ERROR) << "Engine run configuration was invalid."; return false; @@ -153,7 +153,7 @@ Engine::RunStatus Engine::Run(RunConfiguration configuration) { Engine::RunStatus Engine::PrepareAndLaunchIsolate( RunConfiguration configuration) { - FML_TRACE_EVENT0("flutter", "Engine::PrepareAndLaunchIsolate"); + TRACE_EVENT0("flutter", "Engine::PrepareAndLaunchIsolate"); UpdateAssetManager(configuration.GetAssetManager()); @@ -197,18 +197,18 @@ Engine::RunStatus Engine::PrepareAndLaunchIsolate( } void Engine::BeginFrame(fml::TimePoint frame_time) { - FML_TRACE_EVENT0("flutter", "Engine::BeginFrame"); + TRACE_EVENT0("flutter", "Engine::BeginFrame"); runtime_controller_->BeginFrame(frame_time); } void Engine::ReportTimings(std::vector timings) { - FML_TRACE_EVENT0("flutter", "Engine::ReportTimings"); + TRACE_EVENT0("flutter", "Engine::ReportTimings"); runtime_controller_->ReportTimings(std::move(timings)); } void Engine::NotifyIdle(int64_t deadline) { - FML_TRACE_EVENT1("flutter", "Engine::NotifyIdle", "deadline_now_delta", - std::to_string(deadline - Dart_TimelineGetMicros()).c_str()); + TRACE_EVENT1("flutter", "Engine::NotifyIdle", "deadline_now_delta", + std::to_string(deadline - Dart_TimelineGetMicros()).c_str()); runtime_controller_->NotifyIdle(deadline); } @@ -366,8 +366,8 @@ void Engine::HandleSettingsPlatformMessage(PlatformMessage* message) { void Engine::DispatchPointerDataPacket(const PointerDataPacket& packet, uint64_t trace_flow_id) { - FML_TRACE_EVENT0("flutter", "Engine::DispatchPointerDataPacket"); - FML_TRACE_FLOW_STEP("flutter", "PointerEvent", trace_flow_id); + TRACE_EVENT0("flutter", "Engine::DispatchPointerDataPacket"); + TRACE_FLOW_STEP("flutter", "PointerEvent", trace_flow_id); animator_->EnqueueTraceFlowId(trace_flow_id); runtime_controller_->DispatchPointerDataPacket(packet); } diff --git a/shell/common/persistent_cache.cc b/shell/common/persistent_cache.cc index 21f9c291886a6..ce2b380cd1adc 100644 --- a/shell/common/persistent_cache.cc +++ b/shell/common/persistent_cache.cc @@ -79,7 +79,7 @@ bool PersistentCache::IsValid() const { // |GrContextOptions::PersistentCache| sk_sp PersistentCache::load(const SkData& key) { - FML_TRACE_EVENT0("flutter", "PersistentCacheLoad"); + TRACE_EVENT0("flutter", "PersistentCacheLoad"); if (!IsValid()) { return nullptr; } @@ -97,7 +97,7 @@ sk_sp PersistentCache::load(const SkData& key) { return nullptr; } - FML_TRACE_EVENT0("flutter", "PersistentCacheLoadHit"); + TRACE_EVENT0("flutter", "PersistentCacheLoadHit"); return SkData::MakeWithCopy(mapping->GetMapping(), mapping->GetSize()); } @@ -110,7 +110,7 @@ static void PersistentCacheStore(fml::RefPtr worker, file_name = std::move(key), // mapping = std::move(value) // ]() mutable { - FML_TRACE_EVENT0("flutter", "PersistentCacheStore"); + TRACE_EVENT0("flutter", "PersistentCacheStore"); if (!fml::WriteAtomically(*cache_directory, // file_name.c_str(), // *mapping) // diff --git a/shell/common/pipeline.h b/shell/common/pipeline.h index cf959eaa20012..b9aa1d89c6cb5 100644 --- a/shell/common/pipeline.h +++ b/shell/common/pipeline.h @@ -51,10 +51,10 @@ class Pipeline : public fml::RefCountedThreadSafe> { ~ProducerContinuation() { if (continuation_) { continuation_(nullptr, trace_id_); - FML_TRACE_EVENT_ASYNC_END0("flutter", "PipelineProduce", trace_id_); + TRACE_EVENT_ASYNC_END0("flutter", "PipelineProduce", trace_id_); // The continuation is being dropped on the floor. End the flow. - FML_TRACE_FLOW_END("flutter", "PipelineItem", trace_id_); - FML_TRACE_EVENT_ASYNC_END0("flutter", "PipelineItem", trace_id_); + TRACE_FLOW_END("flutter", "PipelineItem", trace_id_); + TRACE_EVENT_ASYNC_END0("flutter", "PipelineItem", trace_id_); } } @@ -62,8 +62,8 @@ class Pipeline : public fml::RefCountedThreadSafe> { if (continuation_) { continuation_(std::move(resource), trace_id_); continuation_ = nullptr; - FML_TRACE_EVENT_ASYNC_END0("flutter", "PipelineProduce", trace_id_); - FML_TRACE_FLOW_STEP("flutter", "PipelineItem", trace_id_); + TRACE_EVENT_ASYNC_END0("flutter", "PipelineProduce", trace_id_); + TRACE_FLOW_STEP("flutter", "PipelineItem", trace_id_); } } @@ -78,9 +78,9 @@ class Pipeline : public fml::RefCountedThreadSafe> { ProducerContinuation(Continuation continuation, size_t trace_id) : continuation_(continuation), trace_id_(trace_id) { - FML_TRACE_FLOW_BEGIN("flutter", "PipelineItem", trace_id_); - FML_TRACE_EVENT_ASYNC_BEGIN0("flutter", "PipelineItem", trace_id_); - FML_TRACE_EVENT_ASYNC_BEGIN0("flutter", "PipelineProduce", trace_id_); + TRACE_FLOW_BEGIN("flutter", "PipelineItem", trace_id_); + TRACE_EVENT_ASYNC_BEGIN0("flutter", "PipelineItem", trace_id_); + TRACE_EVENT_ASYNC_BEGIN0("flutter", "PipelineProduce", trace_id_); } FML_DISALLOW_COPY_AND_ASSIGN(ProducerContinuation); @@ -127,14 +127,14 @@ class Pipeline : public fml::RefCountedThreadSafe> { } { - FML_TRACE_EVENT0("flutter", "PipelineConsume"); + TRACE_EVENT0("flutter", "PipelineConsume"); consumer(std::move(resource)); } empty_.Signal(); - FML_TRACE_FLOW_END("flutter", "PipelineItem", trace_id); - FML_TRACE_EVENT_ASYNC_END0("flutter", "PipelineItem", trace_id); + TRACE_FLOW_END("flutter", "PipelineItem", trace_id); + TRACE_EVENT_ASYNC_END0("flutter", "PipelineItem", trace_id); return items_count > 0 ? PipelineConsumeResult::MoreAvailable : PipelineConsumeResult::Done; diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index 7c31e35662ecf..60005a277e40d 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -84,7 +84,7 @@ void Rasterizer::DrawLastLayerTree() { } void Rasterizer::Draw(fml::RefPtr> pipeline) { - FML_TRACE_EVENT0("flutter", "GPURasterizer::Draw"); + TRACE_EVENT0("flutter", "GPURasterizer::Draw"); Pipeline::Consumer consumer = std::bind(&Rasterizer::DoDraw, this, std::placeholders::_1); @@ -108,7 +108,7 @@ void Rasterizer::Draw(fml::RefPtr> pipeline) { sk_sp Rasterizer::MakeRasterSnapshot(sk_sp picture, SkISize picture_size) { - FML_TRACE_EVENT0("flutter", __FUNCTION__); + TRACE_EVENT0("flutter", __FUNCTION__); sk_sp surface; SkImageInfo image_info = SkImageInfo::MakeN32Premul( @@ -140,7 +140,7 @@ sk_sp Rasterizer::MakeRasterSnapshot(sk_sp picture, sk_sp device_snapshot; { - FML_TRACE_EVENT0("flutter", "MakeDeviceSnpashot"); + TRACE_EVENT0("flutter", "MakeDeviceSnpashot"); device_snapshot = surface->makeImageSnapshot(); } @@ -149,7 +149,7 @@ sk_sp Rasterizer::MakeRasterSnapshot(sk_sp picture, } { - FML_TRACE_EVENT0("flutter", "DeviceHostTransfer"); + TRACE_EVENT0("flutter", "DeviceHostTransfer"); if (auto raster_image = device_snapshot->makeRasterImage()) { return raster_image; } diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 41eae0c373276..2127e7f38bef1 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -78,7 +78,7 @@ std::unique_ptr Shell::CreateShellOnPlatformThread( &platform_view, // io_task_runner // ]() { - FML_TRACE_EVENT0("flutter", "ShellSetupIOSubsystem"); + TRACE_EVENT0("flutter", "ShellSetupIOSubsystem"); io_manager = std::make_unique( platform_view->CreateResourceContext(), io_task_runner); io_latch.Signal(); @@ -96,7 +96,7 @@ std::unique_ptr Shell::CreateShellOnPlatformThread( shell = shell.get(), // &snapshot_delegate // ]() { - FML_TRACE_EVENT0("flutter", "ShellSetupGPUSubsystem"); + TRACE_EVENT0("flutter", "ShellSetupGPUSubsystem"); if (auto new_rasterizer = on_create_rasterizer(*shell)) { rasterizer = std::move(new_rasterizer); snapshot_delegate = rasterizer->GetSnapshotDelegate(); @@ -120,7 +120,7 @@ std::unique_ptr Shell::CreateShellOnPlatformThread( snapshot_delegate = std::move(snapshot_delegate), // io_manager = io_manager->GetWeakPtr() // ]() mutable { - FML_TRACE_EVENT0("flutter", "ShellSetupUISubsystem"); + TRACE_EVENT0("flutter", "ShellSetupUISubsystem"); const auto& task_runners = shell->GetTaskRunners(); // The animator is owned by the UI thread but it gets its vsync pulses @@ -212,7 +212,7 @@ std::unique_ptr Shell::Create( Shell::CreateCallback on_create_rasterizer) { PerformInitializationTasks(settings); - FML_TRACE_EVENT0("flutter", "Shell::Create"); + TRACE_EVENT0("flutter", "Shell::Create"); auto vm = DartVMRef::Create(settings); FML_CHECK(vm) << "Must be able to initialize the VM."; @@ -239,7 +239,7 @@ std::unique_ptr Shell::Create( DartVMRef vm) { PerformInitializationTasks(settings); - FML_TRACE_EVENT0("flutter", "Shell::CreateWithSnapshots"); + TRACE_EVENT0("flutter", "Shell::CreateWithSnapshots"); if (!task_runners.IsValid() || !on_create_platform_view || !on_create_rasterizer) { @@ -439,7 +439,7 @@ DartVM* Shell::GetDartVM() { // |PlatformView::Delegate| void Shell::OnPlatformViewCreated(std::unique_ptr surface) { - FML_TRACE_EVENT0("flutter", "Shell::OnPlatformViewCreated"); + TRACE_EVENT0("flutter", "Shell::OnPlatformViewCreated"); FML_DCHECK(is_setup_); FML_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); @@ -523,7 +523,7 @@ void Shell::OnPlatformViewCreated(std::unique_ptr surface) { // |PlatformView::Delegate| void Shell::OnPlatformViewDestroyed() { - FML_TRACE_EVENT0("flutter", "Shell::OnPlatformViewDestroyed"); + TRACE_EVENT0("flutter", "Shell::OnPlatformViewDestroyed"); FML_DCHECK(is_setup_); FML_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); @@ -625,8 +625,8 @@ void Shell::OnPlatformViewDispatchPlatformMessage( // |PlatformView::Delegate| void Shell::OnPlatformViewDispatchPointerDataPacket( std::unique_ptr packet) { - FML_TRACE_EVENT0("flutter", "Shell::OnPlatformViewDispatchPointerDataPacket"); - FML_TRACE_FLOW_BEGIN("flutter", "PointerEvent", next_pointer_flow_id_); + TRACE_EVENT0("flutter", "Shell::OnPlatformViewDispatchPointerDataPacket"); + TRACE_FLOW_BEGIN("flutter", "PointerEvent", next_pointer_flow_id_); FML_DCHECK(is_setup_); FML_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); task_runners_.GetUITaskRunner()->PostTask(fml::MakeCopyable( @@ -1198,7 +1198,7 @@ bool Shell::OnServiceProtocolSetAssetBundlePath( Rasterizer::Screenshot Shell::Screenshot( Rasterizer::ScreenshotType screenshot_type, bool base64_encode) { - FML_TRACE_EVENT0("flutter", "Shell::Screenshot"); + TRACE_EVENT0("flutter", "Shell::Screenshot"); fml::AutoResetWaitableEvent latch; Rasterizer::Screenshot screenshot; fml::TaskRunner::RunNowOrPostTask( diff --git a/shell/common/skia_event_tracer_impl.cc b/shell/common/skia_event_tracer_impl.cc index c0562bee25c77..514e4e7f3d002 100644 --- a/shell/common/skia_event_tracer_impl.cc +++ b/shell/common/skia_event_tracer_impl.cc @@ -4,7 +4,7 @@ #include "flutter/shell/common/skia_event_tracer_impl.h" -#define FML_TRACE_EVENT_HIDE_MACROS +#define TRACE_EVENT_HIDE_MACROS #include #include "flutter/fml/logging.h" diff --git a/shell/common/vsync_waiter.cc b/shell/common/vsync_waiter.cc index 7fd86cfba9885..97364c581d2ee 100644 --- a/shell/common/vsync_waiter.cc +++ b/shell/common/vsync_waiter.cc @@ -34,7 +34,7 @@ void VsyncWaiter::AsyncWaitForVsync(Callback callback) { return; } - FML_TRACE_EVENT0("flutter", "AsyncWaitForVsync"); + TRACE_EVENT0("flutter", "AsyncWaitForVsync"); { std::lock_guard lock(callback_mutex_); @@ -42,8 +42,7 @@ void VsyncWaiter::AsyncWaitForVsync(Callback callback) { // The animator may request a frame more than once within a frame // interval. Multiple calls to request frame must result in a single // callback per frame interval. - FML_TRACE_EVENT_INSTANT0("flutter", - "MultipleCallsToVsyncInFrameInterval"); + TRACE_EVENT_INSTANT0("flutter", "MultipleCallsToVsyncInFrameInterval"); return; } callback_ = std::move(callback); @@ -64,7 +63,7 @@ void VsyncWaiter::FireCallback(fml::TimePoint frame_start_time, // This means that the vsync waiter implementation fired a callback for a // request we did not make. This is a paranoid check but we still want to // make sure we catch misbehaving vsync implementations. - FML_TRACE_EVENT_INSTANT0("flutter", "MismatchedFrameCallback"); + TRACE_EVENT_INSTANT0("flutter", "MismatchedFrameCallback"); return; } @@ -74,9 +73,9 @@ void VsyncWaiter::FireCallback(fml::TimePoint frame_start_time, // exist. The trace viewer will ignore traces that have no base event trace. // While all our message loops insert a base trace trace // (MessageLoop::RunExpiredTasks), embedders may not. - FML_TRACE_EVENT0("flutter", "VsyncFireCallback"); + TRACE_EVENT0("flutter", "VsyncFireCallback"); - FML_TRACE_FLOW_BEGIN("flutter", kVsyncFlowName, flow_identifier); + TRACE_FLOW_BEGIN("flutter", kVsyncFlowName, flow_identifier); task_runners_.GetUITaskRunner()->PostTaskForTime( [callback, flow_identifier, frame_start_time, frame_target_time]() { @@ -86,7 +85,7 @@ void VsyncWaiter::FireCallback(fml::TimePoint frame_start_time, "flutter", "VsyncSchedulingOverhead", fml::TimePoint::Now(), frame_start_time); callback(frame_start_time, frame_target_time); - FML_TRACE_FLOW_END("flutter", kVsyncFlowName, flow_identifier); + TRACE_FLOW_END("flutter", kVsyncFlowName, flow_identifier); }, frame_start_time); } diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index ef09ceb64e5a2..d344e7225a595 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -176,7 +176,7 @@ bool GPUSurfaceGL::CreateOrUpdateSurfaces(const SkISize& size) { } // We need to do some updates. - FML_TRACE_EVENT0("flutter", "UpdateSurfacesSize"); + TRACE_EVENT0("flutter", "UpdateSurfacesSize"); // Either way, we need to get rid of previous surface. onscreen_surface_ = nullptr; @@ -259,7 +259,7 @@ bool GPUSurfaceGL::PresentSurface(SkCanvas* canvas) { } if (offscreen_surface_ != nullptr) { - FML_TRACE_EVENT0("flutter", "CopyTextureOnscreen"); + TRACE_EVENT0("flutter", "CopyTextureOnscreen"); SkPaint paint; SkCanvas* onscreen_canvas = onscreen_surface_->getCanvas(); onscreen_canvas->clear(SK_ColorTRANSPARENT); @@ -268,7 +268,7 @@ bool GPUSurfaceGL::PresentSurface(SkCanvas* canvas) { } { - FML_TRACE_EVENT0("flutter", "SkCanvas::Flush"); + TRACE_EVENT0("flutter", "SkCanvas::Flush"); onscreen_surface_->getCanvas()->flush(); } diff --git a/shell/platform/android/android_context_gl.cc b/shell/platform/android/android_context_gl.cc index 672a956cf8f8e..d3fd715a38abc 100644 --- a/shell/platform/android/android_context_gl.cc +++ b/shell/platform/android/android_context_gl.cc @@ -235,7 +235,7 @@ bool AndroidContextGL::ClearCurrent() { } bool AndroidContextGL::SwapBuffers() { - FML_TRACE_EVENT0("flutter", "AndroidContextGL::SwapBuffers"); + TRACE_EVENT0("flutter", "AndroidContextGL::SwapBuffers"); return eglSwapBuffers(environment_->Display(), surface_); } diff --git a/shell/platform/android/android_shell_holder.cc b/shell/platform/android/android_shell_holder.cc index 9fbd2a50073dd..e9b114fc42252 100644 --- a/shell/platform/android/android_shell_holder.cc +++ b/shell/platform/android/android_shell_holder.cc @@ -192,8 +192,8 @@ void AndroidShellHolder::DispatchPointerDataPacket( return; } - FML_TRACE_EVENT0("flutter", "AndroidShellHolder::DispatchPointerDataPacket"); - FML_TRACE_FLOW_BEGIN("flutter", "PointerEvent", next_pointer_flow_id_); + TRACE_EVENT0("flutter", "AndroidShellHolder::DispatchPointerDataPacket"); + TRACE_FLOW_BEGIN("flutter", "PointerEvent", next_pointer_flow_id_); shell_->GetTaskRunners().GetUITaskRunner()->PostTask(fml::MakeCopyable( [engine = shell_->GetEngine(), packet = std::move(packet), diff --git a/shell/platform/android/android_surface_software.cc b/shell/platform/android/android_surface_software.cc index 481cc540dc10e..633b6091f0c15 100644 --- a/shell/platform/android/android_surface_software.cc +++ b/shell/platform/android/android_surface_software.cc @@ -72,7 +72,7 @@ std::unique_ptr AndroidSurfaceSoftware::CreateGPUSurface() { sk_sp AndroidSurfaceSoftware::AcquireBackingStore( const SkISize& size) { - FML_TRACE_EVENT0("flutter", "AndroidSurfaceSoftware::AcquireBackingStore"); + TRACE_EVENT0("flutter", "AndroidSurfaceSoftware::AcquireBackingStore"); if (!IsValid()) { return nullptr; } @@ -94,7 +94,7 @@ sk_sp AndroidSurfaceSoftware::AcquireBackingStore( bool AndroidSurfaceSoftware::PresentBackingStore( sk_sp backing_store) { - FML_TRACE_EVENT0("flutter", "AndroidSurfaceSoftware::PresentBackingStore"); + TRACE_EVENT0("flutter", "AndroidSurfaceSoftware::PresentBackingStore"); if (!IsValid() || backing_store == nullptr) { return false; } diff --git a/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm b/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm index 73c7b03f43521..4ba2e83daa05b 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm @@ -120,8 +120,8 @@ - (void)updateViewportMetrics:(flutter::ViewportMetrics)viewportMetrics { } - (void)dispatchPointerDataPacket:(std::unique_ptr)packet { - FML_TRACE_EVENT0("flutter", "dispatchPointerDataPacket"); - FML_TRACE_FLOW_BEGIN("flutter", "PointerEvent", _nextPointerFlowId); + TRACE_EVENT0("flutter", "dispatchPointerDataPacket"); + TRACE_FLOW_BEGIN("flutter", "PointerEvent", _nextPointerFlowId); self.shell.GetTaskRunners().GetUITaskRunner()->PostTask(fml::MakeCopyable( [engine = self.shell.GetEngine(), packet = std::move(packet), flow_id = _nextPointerFlowId] { if (engine) { diff --git a/shell/platform/darwin/ios/framework/Source/FlutterView.mm b/shell/platform/darwin/ios/framework/Source/FlutterView.mm index 9527c0e769de0..0d53b44b70d31 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterView.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterView.mm @@ -120,7 +120,7 @@ + (Class)layerClass { } - (void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context { - FML_TRACE_EVENT0("flutter", "SnapshotFlutterView"); + TRACE_EVENT0("flutter", "SnapshotFlutterView"); if (layer != self.layer || context == nullptr) { return; diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index 37086e9bbdc91..fc08125a18aee 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -394,7 +394,7 @@ - (void)surfaceUpdated:(BOOL)appeared { #pragma mark - UIViewController lifecycle notifications - (void)viewWillAppear:(BOOL)animated { - FML_TRACE_EVENT0("flutter", "viewWillAppear"); + TRACE_EVENT0("flutter", "viewWillAppear"); if (_engineNeedsLaunch) { [_engine.get() launchEngine:nil libraryURI:nil]; @@ -412,7 +412,7 @@ - (void)viewWillAppear:(BOOL)animated { } - (void)viewDidAppear:(BOOL)animated { - FML_TRACE_EVENT0("flutter", "viewDidAppear"); + TRACE_EVENT0("flutter", "viewDidAppear"); [self onLocaleUpdated:nil]; [self onUserSettingsChanged:nil]; [self onAccessibilityStatusChanged:nil]; @@ -422,14 +422,14 @@ - (void)viewDidAppear:(BOOL)animated { } - (void)viewWillDisappear:(BOOL)animated { - FML_TRACE_EVENT0("flutter", "viewWillDisappear"); + TRACE_EVENT0("flutter", "viewWillDisappear"); [[_engine.get() lifecycleChannel] sendMessage:@"AppLifecycleState.inactive"]; [super viewWillDisappear:animated]; } - (void)viewDidDisappear:(BOOL)animated { - FML_TRACE_EVENT0("flutter", "viewDidDisappear"); + TRACE_EVENT0("flutter", "viewDidDisappear"); [self surfaceUpdated:NO]; [[_engine.get() lifecycleChannel] sendMessage:@"AppLifecycleState.paused"]; [self flushOngoingTouches]; @@ -479,25 +479,25 @@ - (void)dealloc { #pragma mark - Application lifecycle notifications - (void)applicationBecameActive:(NSNotification*)notification { - FML_TRACE_EVENT0("flutter", "applicationBecameActive"); + TRACE_EVENT0("flutter", "applicationBecameActive"); if (_viewportMetrics.physical_width) [self surfaceUpdated:YES]; [[_engine.get() lifecycleChannel] sendMessage:@"AppLifecycleState.resumed"]; } - (void)applicationWillResignActive:(NSNotification*)notification { - FML_TRACE_EVENT0("flutter", "applicationWillResignActive"); + TRACE_EVENT0("flutter", "applicationWillResignActive"); [self surfaceUpdated:NO]; [[_engine.get() lifecycleChannel] sendMessage:@"AppLifecycleState.inactive"]; } - (void)applicationDidEnterBackground:(NSNotification*)notification { - FML_TRACE_EVENT0("flutter", "applicationDidEnterBackground"); + TRACE_EVENT0("flutter", "applicationDidEnterBackground"); [[_engine.get() lifecycleChannel] sendMessage:@"AppLifecycleState.paused"]; } - (void)applicationWillEnterForeground:(NSNotification*)notification { - FML_TRACE_EVENT0("flutter", "applicationWillEnterForeground"); + TRACE_EVENT0("flutter", "applicationWillEnterForeground"); [[_engine.get() lifecycleChannel] sendMessage:@"AppLifecycleState.inactive"]; } diff --git a/shell/platform/darwin/ios/ios_gl_render_target.mm b/shell/platform/darwin/ios/ios_gl_render_target.mm index a02a8e9cc36f8..1401707b28891 100644 --- a/shell/platform/darwin/ios/ios_gl_render_target.mm +++ b/shell/platform/darwin/ios/ios_gl_render_target.mm @@ -98,7 +98,7 @@ // Nothing to since the stoage size is already consistent with the layer. return true; } - FML_TRACE_EVENT_INSTANT0("flutter", "IOSGLRenderTarget::UpdateStorageSizeIfNecessary"); + TRACE_EVENT_INSTANT0("flutter", "IOSGLRenderTarget::UpdateStorageSizeIfNecessary"); FML_DLOG(INFO) << "Updating render buffer storage size."; FML_DCHECK(glGetError() == GL_NO_ERROR); diff --git a/shell/platform/darwin/ios/ios_surface_gl.mm b/shell/platform/darwin/ios/ios_surface_gl.mm index 37a1052f557f9..f9279cc5116fe 100644 --- a/shell/platform/darwin/ios/ios_surface_gl.mm +++ b/shell/platform/darwin/ios/ios_surface_gl.mm @@ -70,7 +70,7 @@ } bool IOSSurfaceGL::GLContextPresent() { - FML_TRACE_EVENT0("flutter", "IOSSurfaceGL::GLContextPresent"); + TRACE_EVENT0("flutter", "IOSSurfaceGL::GLContextPresent"); return IsValid() && render_target_->PresentRenderBuffer(); } diff --git a/shell/platform/darwin/ios/ios_surface_software.mm b/shell/platform/darwin/ios/ios_surface_software.mm index 65d462ee69359..32cb5a2bbeef1 100644 --- a/shell/platform/darwin/ios/ios_surface_software.mm +++ b/shell/platform/darwin/ios/ios_surface_software.mm @@ -53,7 +53,7 @@ } sk_sp IOSSurfaceSoftware::AcquireBackingStore(const SkISize& size) { - FML_TRACE_EVENT0("flutter", "IOSSurfaceSoftware::AcquireBackingStore"); + TRACE_EVENT0("flutter", "IOSSurfaceSoftware::AcquireBackingStore"); if (!IsValid()) { return nullptr; } @@ -71,7 +71,7 @@ } bool IOSSurfaceSoftware::PresentBackingStore(sk_sp backing_store) { - FML_TRACE_EVENT0("flutter", "IOSSurfaceSoftware::PresentBackingStore"); + TRACE_EVENT0("flutter", "IOSSurfaceSoftware::PresentBackingStore"); if (!IsValid() || backing_store == nullptr) { return false; } diff --git a/shell/platform/embedder/embedder.cc b/shell/platform/embedder/embedder.cc index 8be8334ee4143..e49c08e1972bf 100644 --- a/shell/platform/embedder/embedder.cc +++ b/shell/platform/embedder/embedder.cc @@ -951,7 +951,7 @@ FlutterEngineResult FlutterEngineOnVsync(FlutterEngine engine, return LOG_EMBEDDER_ERROR(kInvalidArguments); } - FML_TRACE_EVENT0("flutter", "FlutterEngineOnVsync"); + TRACE_EVENT0("flutter", "FlutterEngineOnVsync"); auto start_time = fml::TimePoint::FromEpochDelta( fml::TimeDelta::FromNanoseconds(frame_start_time_nanos)); diff --git a/shell/platform/embedder/embedder_engine.cc b/shell/platform/embedder/embedder_engine.cc index ee1a392ec0d20..79c8cf2f8b672 100644 --- a/shell/platform/embedder/embedder_engine.cc +++ b/shell/platform/embedder/embedder_engine.cc @@ -94,8 +94,8 @@ bool EmbedderEngine::DispatchPointerDataPacket( return false; } - FML_TRACE_EVENT0("flutter", "EmbedderEngine::DispatchPointerDataPacket"); - FML_TRACE_FLOW_BEGIN("flutter", "PointerEvent", next_pointer_flow_id_); + TRACE_EVENT0("flutter", "EmbedderEngine::DispatchPointerDataPacket"); + TRACE_FLOW_BEGIN("flutter", "PointerEvent", next_pointer_flow_id_); shell_->GetTaskRunners().GetUITaskRunner()->PostTask(fml::MakeCopyable( [engine = shell_->GetEngine(), packet = std::move(packet), diff --git a/shell/platform/embedder/embedder_surface_software.cc b/shell/platform/embedder/embedder_surface_software.cc index fec9beb34919e..0d24933cf5e3d 100644 --- a/shell/platform/embedder/embedder_surface_software.cc +++ b/shell/platform/embedder/embedder_surface_software.cc @@ -48,7 +48,7 @@ sk_sp EmbedderSurfaceSoftware::CreateResourceContext() const { // |GPUSurfaceSoftwareDelegate| sk_sp EmbedderSurfaceSoftware::AcquireBackingStore( const SkISize& size) { - FML_TRACE_EVENT0("flutter", "EmbedderSurfaceSoftware::AcquireBackingStore"); + TRACE_EVENT0("flutter", "EmbedderSurfaceSoftware::AcquireBackingStore"); if (!IsValid()) { FML_LOG(ERROR) << "Could not acquire backing store for the software surface."; diff --git a/shell/platform/fuchsia/dart/dart_runner.cc b/shell/platform/fuchsia/dart/dart_runner.cc index c572c84b67cc0..670cb909238c4 100644 --- a/shell/platform/fuchsia/dart/dart_runner.cc +++ b/shell/platform/fuchsia/dart/dart_runner.cc @@ -189,8 +189,7 @@ void DartRunner::StartComponent( fuchsia::sys::Package package, fuchsia::sys::StartupInfo startup_info, ::fidl::InterfaceRequest controller) { - FML_TRACE_EVENT1("dart", "StartComponent", "url", - package.resolved_url.c_str()); + TRACE_EVENT1("dart", "StartComponent", "url", package.resolved_url.c_str()); std::thread thread(RunApplication, this, std::move(package), std::move(startup_info), context_->svc(), std::move(controller)); diff --git a/shell/platform/fuchsia/dart/main.cc b/shell/platform/fuchsia/dart/main.cc index e5edf9a288478..9c8327488721d 100644 --- a/shell/platform/fuchsia/dart/main.cc +++ b/shell/platform/fuchsia/dart/main.cc @@ -40,7 +40,7 @@ int main(int argc, const char** argv) { fbl::unique_ptr provider; { - FML_TRACE_EVENT0("dart", "CreateTraceProvider"); + TRACE_EVENT0("dart", "CreateTraceProvider"); bool already_started; // Use CreateSynchronously to prevent loss of early events. trace::TraceProvider::CreateSynchronously(loop.dispatcher(), "dart_runner", diff --git a/shell/platform/fuchsia/flutter/compositor_context.cc b/shell/platform/fuchsia/flutter/compositor_context.cc index 888d4d21630cb..6c56d262a2577 100644 --- a/shell/platform/fuchsia/flutter/compositor_context.cc +++ b/shell/platform/fuchsia/flutter/compositor_context.cc @@ -34,21 +34,21 @@ class ScopedFrame final : public flutter::CompositorContext::ScopedFrame { { // Preroll the Flutter layer tree. This allows Flutter to perform // pre-paint optimizations. - FML_TRACE_EVENT0("flutter", "Preroll"); + TRACE_EVENT0("flutter", "Preroll"); layer_tree.Preroll(*this, true /* ignore raster cache */); } { // Traverse the Flutter layer tree so that the necessary session ops to // represent the frame are enqueued in the underlying session. - FML_TRACE_EVENT0("flutter", "UpdateScene"); + TRACE_EVENT0("flutter", "UpdateScene"); layer_tree.UpdateScene(session_connection_.scene_update_context(), session_connection_.root_node()); } { // Flush all pending session ops. - FML_TRACE_EVENT0("flutter", "SessionPresent"); + TRACE_EVENT0("flutter", "SessionPresent"); session_connection_.Present(*this); } diff --git a/shell/platform/fuchsia/flutter/engine.cc b/shell/platform/fuchsia/flutter/engine.cc index 65cb1a53a19d8..7c85458193db7 100644 --- a/shell/platform/fuchsia/flutter/engine.cc +++ b/shell/platform/fuchsia/flutter/engine.cc @@ -148,7 +148,7 @@ Engine::Engine(Delegate& delegate, // rasterizer. std::unique_ptr compositor_context; { - FML_TRACE_EVENT0("flutter", "CreateCompositorContext"); + TRACE_EVENT0("flutter", "CreateCompositorContext"); compositor_context = std::make_unique( thread_label_, // debug label std::move(view_token), // scenic view we attach our tree to @@ -210,7 +210,7 @@ Engine::Engine(Delegate& delegate, } { - FML_TRACE_EVENT0("flutter", "CreateShell"); + TRACE_EVENT0("flutter", "CreateShell"); shell_ = flutter::Shell::Create( task_runners, // host task runners settings_, // shell launch settings diff --git a/shell/platform/fuchsia/flutter/fuchsia_font_manager.cc b/shell/platform/fuchsia/flutter/fuchsia_font_manager.cc index 004810a4e6779..83264ad8a5ff3 100644 --- a/shell/platform/fuchsia/flutter/fuchsia_font_manager.cc +++ b/shell/platform/fuchsia/flutter/fuchsia_font_manager.cc @@ -419,7 +419,7 @@ sk_sp FuchsiaFontManager::FetchTypeface(const char family_name[], int bcp47_count, SkUnichar character, uint32_t flags) const { - FML_TRACE_EVENT0("flutter", "FuchsiaFontManager::FetchTypeface"); + TRACE_EVENT0("flutter", "FuchsiaFontManager::FetchTypeface"); fuchsia::fonts::Request request; request.family = family_name; request.weight = style.weight(); diff --git a/shell/platform/fuchsia/flutter/platform_view.cc b/shell/platform/fuchsia/flutter/platform_view.cc index bda9bba92aa38..1157d1c744977 100644 --- a/shell/platform/fuchsia/flutter/platform_view.cc +++ b/shell/platform/fuchsia/flutter/platform_view.cc @@ -287,7 +287,7 @@ void PlatformView::OnScenicError(std::string error) { void PlatformView::OnScenicEvent( std::vector events) { - FML_TRACE_EVENT0("flutter", "PlatformView::OnScenicEvent"); + TRACE_EVENT0("flutter", "PlatformView::OnScenicEvent"); for (const auto& event : events) { switch (event.Which()) { case fuchsia::ui::scenic::Event::Tag::kGfx: @@ -426,13 +426,13 @@ static trace_flow_id_t PointerTraceHACK(float fa, float fb) { bool PlatformView::OnHandlePointerEvent( const fuchsia::ui::input::PointerEvent& pointer) { - FML_TRACE_EVENT0("flutter", "PlatformView::OnHandlePointerEvent"); + TRACE_EVENT0("flutter", "PlatformView::OnHandlePointerEvent"); #if !defined(FUCHSIA_SDK) // TODO(SCN-1278): Use proper trace_id for tracing flow. trace_flow_id_t trace_id = PointerTraceHACK(pointer.radius_major, pointer.radius_minor); - FML_TRACE_FLOW_END("input", "dispatch_event_to_client", trace_id); + TRACE_FLOW_END("input", "dispatch_event_to_client", trace_id); #endif // !defined(FUCHSIA_SDK) flutter::PointerData pointer_data; diff --git a/shell/platform/fuchsia/flutter/runner.cc b/shell/platform/fuchsia/flutter/runner.cc index caf48338849f2..c61f59bc3d34a 100644 --- a/shell/platform/fuchsia/flutter/runner.cc +++ b/shell/platform/fuchsia/flutter/runner.cc @@ -137,7 +137,7 @@ void Runner::StartComponent( fuchsia::sys::Package package, fuchsia::sys::StartupInfo startup_info, fidl::InterfaceRequest controller) { - FML_TRACE_EVENT0("flutter", "StartComponent"); + TRACE_EVENT0("flutter", "StartComponent"); // Notes on application termination: Application typically terminate on the // thread on which they were created. This usually means the thread was // specifically created to host the application. But we want to ensure that diff --git a/shell/platform/fuchsia/flutter/session_connection.cc b/shell/platform/fuchsia/flutter/session_connection.cc index 139fdc7edc325..21e06564b1850 100644 --- a/shell/platform/fuchsia/flutter/session_connection.cc +++ b/shell/platform/fuchsia/flutter/session_connection.cc @@ -81,8 +81,8 @@ void SessionConnection::EnqueueClearOps() { } void SessionConnection::PresentSession() { - FML_TRACE_EVENT0("gfx", "SessionConnection::PresentSession"); - FML_TRACE_FLOW_BEGIN("gfx", "Session::Present", next_present_trace_id_); + TRACE_EVENT0("gfx", "SessionConnection::PresentSession"); + TRACE_FLOW_BEGIN("gfx", "Session::Present", next_present_trace_id_); next_present_trace_id_++; ToggleSignal(vsync_event_handle_, false); diff --git a/shell/platform/fuchsia/flutter/vsync_waiter.cc b/shell/platform/fuchsia/flutter/vsync_waiter.cc index b3272cf0a4891..e8b52db443465 100644 --- a/shell/platform/fuchsia/flutter/vsync_waiter.cc +++ b/shell/platform/fuchsia/flutter/vsync_waiter.cc @@ -66,7 +66,7 @@ void VsyncWaiter::AwaitVSync() { } void VsyncWaiter::FireCallbackWhenSessionAvailable() { - FML_TRACE_EVENT0("flutter", "VsyncWaiter::FireCallbackWhenSessionAvailable"); + TRACE_EVENT0("flutter", "VsyncWaiter::FireCallbackWhenSessionAvailable"); FML_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); if (session_wait_.Begin(async_get_default_dispatcher()) != ZX_OK) { FML_LOG(ERROR) << "Could not begin wait for Vsync."; diff --git a/shell/platform/fuchsia/flutter/vulkan_surface.cc b/shell/platform/fuchsia/flutter/vulkan_surface.cc index 0acfc657ab35e..eb82eb987d01f 100644 --- a/shell/platform/fuchsia/flutter/vulkan_surface.cc +++ b/shell/platform/fuchsia/flutter/vulkan_surface.cc @@ -26,7 +26,7 @@ constexpr SkColorType kSkiaColorType = kBGRA_8888_SkColorType; bool CreateVulkanImage(vulkan::VulkanProvider& vulkan_provider, const SkISize& size, VulkanImage* out_vulkan_image) { - FML_TRACE_EVENT0("flutter", "CreateVulkanImage"); + TRACE_EVENT0("flutter", "CreateVulkanImage"); FML_DCHECK(!size.isEmpty()); FML_DCHECK(out_vulkan_image != nullptr); @@ -244,7 +244,7 @@ bool VulkanSurface::AllocateDeviceMemory(sk_sp context, }; { - FML_TRACE_EVENT0("flutter", "vkAllocateMemory"); + TRACE_EVENT0("flutter", "vkAllocateMemory"); VkDeviceMemory vk_memory = VK_NULL_HANDLE; if (VK_CALL_LOG_ERROR(vulkan_provider_.vk().AllocateMemory( vulkan_provider_.vk_device(), &alloc_info, NULL, &vk_memory)) != diff --git a/shell/platform/fuchsia/flutter/vulkan_surface_pool.cc b/shell/platform/fuchsia/flutter/vulkan_surface_pool.cc index 157e6b851c3b0..c34b8fcc81ca1 100644 --- a/shell/platform/fuchsia/flutter/vulkan_surface_pool.cc +++ b/shell/platform/fuchsia/flutter/vulkan_surface_pool.cc @@ -108,7 +108,7 @@ std::unique_ptr VulkanSurfacePool::GetCachedOrCreateSurface( void VulkanSurfacePool::SubmitSurface( std::unique_ptr p_surface) { - FML_TRACE_EVENT0("flutter", "VulkanSurfacePool::SubmitSurface"); + TRACE_EVENT0("flutter", "VulkanSurfacePool::SubmitSurface"); // This cast is safe because |VulkanSurface| is the only implementation of // |SurfaceProducerSurface| for Flutter on Fuchsia. Additionally, it is @@ -157,7 +157,7 @@ void VulkanSurfacePool::SubmitSurface( std::unique_ptr VulkanSurfacePool::CreateSurface( const SkISize& size) { - FML_TRACE_EVENT0("flutter", "VulkanSurfacePool::CreateSurface"); + TRACE_EVENT0("flutter", "VulkanSurfacePool::CreateSurface"); auto surface = std::make_unique(vulkan_provider_, context_, scenic_session_, size); if (!surface->IsValid()) { @@ -217,7 +217,7 @@ void VulkanSurfacePool::SignalRetainedReady(flutter::LayerRasterCacheKey key) { } void VulkanSurfacePool::AgeAndCollectOldBuffers() { - FML_TRACE_EVENT0("flutter", "VulkanSurfacePool::AgeAndCollectOldBuffers"); + TRACE_EVENT0("flutter", "VulkanSurfacePool::AgeAndCollectOldBuffers"); // Remove all surfaces that are no longer valid or are too old. available_surfaces_.erase( diff --git a/shell/platform/fuchsia/flutter/vulkan_surface_producer.cc b/shell/platform/fuchsia/flutter/vulkan_surface_producer.cc index 11dae4f5f46a1..0b678545bb4d4 100644 --- a/shell/platform/fuchsia/flutter/vulkan_surface_producer.cc +++ b/shell/platform/fuchsia/flutter/vulkan_surface_producer.cc @@ -129,11 +129,11 @@ void VulkanSurfaceProducer::OnSurfacesPresented( std::vector< std::unique_ptr> surfaces) { - FML_TRACE_EVENT0("flutter", "VulkanSurfaceProducer::OnSurfacesPresented"); + TRACE_EVENT0("flutter", "VulkanSurfaceProducer::OnSurfacesPresented"); // Do a single flush for all canvases derived from the context. { - FML_TRACE_EVENT0("flutter", "GrContext::flushAndSignalSemaphores"); + TRACE_EVENT0("flutter", "GrContext::flushAndSignalSemaphores"); context_->flush(); } diff --git a/third_party/txt/src/txt/font_collection.cc b/third_party/txt/src/txt/font_collection.cc index 8eec9b4552b4e..99be0100957d1 100644 --- a/third_party/txt/src/txt/font_collection.cc +++ b/third_party/txt/src/txt/font_collection.cc @@ -185,7 +185,7 @@ FontCollection::GetMinikinFontCollectionForFamilies( std::shared_ptr FontCollection::FindFontFamilyInManagers( const std::string& family_name) { - FML_TRACE_EVENT0("flutter", "FontCollection::FindFontFamilyInManagers"); + TRACE_EVENT0("flutter", "FontCollection::FindFontFamilyInManagers"); // Search for the font family in each font manager. for (sk_sp& manager : GetFontManagerOrder()) { std::shared_ptr minikin_family = @@ -200,8 +200,8 @@ std::shared_ptr FontCollection::FindFontFamilyInManagers( std::shared_ptr FontCollection::CreateMinikinFontFamily( const sk_sp& manager, const std::string& family_name) { - FML_TRACE_EVENT1("flutter", "FontCollection::CreateMinikinFontFamily", - "family_name", family_name.c_str()); + TRACE_EVENT1("flutter", "FontCollection::CreateMinikinFontFamily", + "family_name", family_name.c_str()); sk_sp font_style_set( manager->matchFamily(family_name.c_str())); if (font_style_set == nullptr || font_style_set->count() == 0) { @@ -212,7 +212,7 @@ std::shared_ptr FontCollection::CreateMinikinFontFamily( // Add fonts to the Minikin font family. for (int i = 0; i < font_style_set->count(); ++i) { - FML_TRACE_EVENT0("flutter", "CreateMinikinFont"); + TRACE_EVENT0("flutter", "CreateMinikinFont"); // Create the skia typeface. sk_sp skia_typeface( sk_sp(font_style_set->createTypeface(i))); @@ -230,8 +230,8 @@ std::shared_ptr FontCollection::CreateMinikinFontFamily( minikin_fonts.emplace_back(std::move(minikin_font)); } - FML_TRACE_EVENT1("flutter", "minikin::FontFamily", "MinikinFontsCount", - std::to_string(minikin_fonts.size()).c_str()); + TRACE_EVENT1("flutter", "minikin::FontFamily", "MinikinFontsCount", + std::to_string(minikin_fonts.size()).c_str()); return std::make_shared(std::move(minikin_fonts)); } @@ -277,7 +277,7 @@ const std::shared_ptr& FontCollection::DoMatchFallbackFont( const std::shared_ptr& FontCollection::GetFallbackFontFamily(const sk_sp& manager, const std::string& family_name) { - FML_TRACE_EVENT0("flutter", "FontCollection::GetFallbackFontFamily"); + TRACE_EVENT0("flutter", "FontCollection::GetFallbackFontFamily"); auto fallback_it = fallback_fonts_.find(family_name); if (fallback_it != fallback_fonts_.end()) { return fallback_it->second;