From 79390b7f46969d593b5cba1f5475bb62f2f4db6a Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 23 Apr 2021 17:48:09 -0700 Subject: [PATCH 1/2] Ensure //flutter/fml is dependency free. This patch removes tracing from FML and moves it into a separate library at //flutter/fml/trace. This is similar to the pattern followed by //flutter/fml/dart which contains Dart converter for FML utilities. The presence of tracing in FML was problematic because the tracing subsystem is provided by Dart. So, depending on FML would automatically pull in a Dart dependency. This happened for unit-test targets that did not depend on Dart and event had no mechanisms to collect traces from the Dart timeline. Now, applications that want to trace will explicitly need to depend on the trace library with a clear message indicating the GN rule to be included. This is an improvement over the current situation where including FML but not including the Dart dependency would lead to link errors with no indication of which target to include. This has tripped up the others in the past https://github.com/flutter/flutter/issues/41414. With this patch, FML has no other dependencies and users of FML that don't need Dart can be small and compile quickly. Fixes https://github.com/flutter/flutter/issues/41414. --- assets/BUILD.gn | 1 + assets/asset_manager.cc | 2 +- assets/directory_asset_bundle.cc | 2 +- benchmarking/BUILD.gn | 1 + ci/licenses_golden/licenses_flutter | 4 +- common/graphics/BUILD.gn | 1 + common/graphics/persistent_cache.cc | 2 +- flow/BUILD.gn | 3 +- flow/layers/layer.h | 2 +- flow/layers/layer_tree.cc | 2 +- flow/layers/opacity_layer.cc | 2 +- flow/raster_cache.cc | 2 +- flow/scene_update_context.cc | 2 +- flow/skia_gpu_object.cc | 2 +- fml/BUILD.gn | 12 +--- fml/concurrent_message_loop.cc | 2 - fml/message_loop_impl.cc | 3 - fml/platform/posix/file_posix.cc | 2 - fml/trace/BUILD.gn | 15 +++++ fml/{ => trace}/trace_event.cc | 2 +- fml/{ => trace}/trace_event.h | 0 lib/ui/compositing/scene.cc | 2 +- lib/ui/painting/image_decoder.h | 2 +- lib/ui/painting/image_descriptor.cc | 2 +- lib/ui/painting/image_encoding.cc | 2 +- lib/ui/volatile_path_tracker.h | 2 +- runtime/BUILD.gn | 42 ++++++++++--- runtime/dart_isolate.cc | 2 +- runtime/dart_snapshot.cc | 2 +- runtime/dart_vm.cc | 2 +- runtime/dart_vm_initializer.cc | 2 +- runtime/runtime_controller.cc | 2 +- runtime/skia_concurrent_executor.cc | 2 +- shell/common/animator.cc | 2 +- shell/common/engine.cc | 2 +- shell/common/pipeline.h | 2 +- shell/common/pointer_data_dispatcher.cc | 2 +- shell/common/shell.cc | 2 +- shell/common/skia_event_tracer_impl.cc | 2 +- shell/common/vsync_waiter.cc | 2 +- shell/common/vsync_waiter_fallback.cc | 2 +- shell/gpu/gpu_surface_gl.cc | 2 +- shell/gpu/gpu_surface_metal.mm | 2 +- shell/platform/android/android_context_gl.cc | 2 +- .../android/android_surface_software.cc | 2 +- .../android/external_view_embedder/BUILD.gn | 1 + .../external_view_embedder.cc | 2 +- .../platform/android/vsync_waiter_android.cc | 2 +- shell/platform/common/BUILD.gn | 1 - shell/platform/common/client_wrapper/BUILD.gn | 5 -- shell/platform/darwin/BUILD.gn | 1 - .../ios/framework/Source/FlutterEngine.mm | 2 +- .../framework/Source/FlutterOverlayView.mm | 2 +- .../ios/framework/Source/FlutterView.mm | 2 +- .../ios/framework/Source/vsync_waiter_ios.mm | 2 +- .../darwin/ios/ios_render_target_gl.mm | 2 +- shell/platform/darwin/ios/ios_surface_gl.mm | 2 +- .../darwin/ios/ios_surface_software.mm | 2 +- .../platform/darwin/ios/platform_view_ios.mm | 2 +- shell/platform/embedder/BUILD.gn | 1 + shell/platform/embedder/embedder.cc | 2 +- .../embedder/embedder_external_view.cc | 2 +- .../embedder/embedder_surface_software.cc | 2 +- shell/platform/fuchsia/dart_runner/BUILD.gn | 1 + .../fuchsia/dart_runner/dart_runner.cc | 2 +- shell/platform/fuchsia/dart_runner/main.cc | 2 +- shell/platform/fuchsia/flutter/BUILD.gn | 1 + .../flutter/fuchsia_external_view_embedder.cc | 2 +- .../fuchsia/flutter/session_connection.cc | 2 +- .../platform/fuchsia/flutter/vsync_waiter.cc | 2 +- .../fuchsia/flutter/vulkan_surface.cc | 2 +- .../fuchsia/flutter/vulkan_surface_pool.cc | 2 +- .../flutter/vulkan_surface_producer.cc | 2 +- shell/platform/glfw/client_wrapper/BUILD.gn | 5 -- .../platform/windows/client_wrapper/BUILD.gn | 5 -- shell/profiling/BUILD.gn | 1 + shell/profiling/sampling_profiler.h | 2 +- shell/testing/BUILD.gn | 61 ++++++++++--------- testing/BUILD.gn | 6 +- testing/run_tests.py | 6 +- third_party/txt/BUILD.gn | 3 +- third_party/txt/src/txt/font_collection.cc | 2 +- 82 files changed, 166 insertions(+), 130 deletions(-) create mode 100644 fml/trace/BUILD.gn rename fml/{ => trace}/trace_event.cc (99%) rename fml/{ => trace}/trace_event.h (100%) diff --git a/assets/BUILD.gn b/assets/BUILD.gn index eefdaf5eb02c7..ad44a39ffc3dc 100644 --- a/assets/BUILD.gn +++ b/assets/BUILD.gn @@ -14,6 +14,7 @@ source_set("assets") { deps = [ "//flutter/common", "//flutter/fml", + "//flutter/fml/trace", ] public_configs = [ "//flutter:config" ] diff --git a/assets/asset_manager.cc b/assets/asset_manager.cc index d52fc6eea7f2c..4b7a6b29c6286 100644 --- a/assets/asset_manager.cc +++ b/assets/asset_manager.cc @@ -5,7 +5,7 @@ #include "flutter/assets/asset_manager.h" #include "flutter/assets/directory_asset_bundle.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" namespace flutter { diff --git a/assets/directory_asset_bundle.cc b/assets/directory_asset_bundle.cc index 7896756614593..c17a98a8747c0 100644 --- a/assets/directory_asset_bundle.cc +++ b/assets/directory_asset_bundle.cc @@ -10,7 +10,7 @@ #include "flutter/fml/eintr_wrapper.h" #include "flutter/fml/file.h" #include "flutter/fml/mapping.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" namespace flutter { diff --git a/benchmarking/BUILD.gn b/benchmarking/BUILD.gn index 8cdaf471ec958..e357dcb590872 100644 --- a/benchmarking/BUILD.gn +++ b/benchmarking/BUILD.gn @@ -16,6 +16,7 @@ source_set("benchmarking") { public_deps = [ "//flutter/fml", + "//flutter/runtime:libdart_flutter_policy", "//third_party/benchmark", ] diff --git a/ci/licenses_golden/licenses_flutter b/ci/licenses_golden/licenses_flutter index c1eba92abb184..ac1ee7063d958 100755 --- a/ci/licenses_golden/licenses_flutter +++ b/ci/licenses_golden/licenses_flutter @@ -288,8 +288,8 @@ FILE: ../../../flutter/fml/time/time_point.cc FILE: ../../../flutter/fml/time/time_point.h FILE: ../../../flutter/fml/time/time_point_unittest.cc FILE: ../../../flutter/fml/time/time_unittest.cc -FILE: ../../../flutter/fml/trace_event.cc -FILE: ../../../flutter/fml/trace_event.h +FILE: ../../../flutter/fml/trace/trace_event.cc +FILE: ../../../flutter/fml/trace/trace_event.h FILE: ../../../flutter/fml/unique_fd.cc FILE: ../../../flutter/fml/unique_fd.h FILE: ../../../flutter/fml/unique_object.h diff --git a/common/graphics/BUILD.gn b/common/graphics/BUILD.gn index 5afc6cae533ed..d58a1d5ed768c 100644 --- a/common/graphics/BUILD.gn +++ b/common/graphics/BUILD.gn @@ -21,6 +21,7 @@ source_set("graphics") { deps = [ "//flutter/assets", "//flutter/fml", + "//flutter/fml/trace", "//flutter/shell/version:version", "//third_party/rapidjson", "//third_party/skia", diff --git a/common/graphics/persistent_cache.cc b/common/graphics/persistent_cache.cc index 69c906fdd3fd8..dcb631745f089 100644 --- a/common/graphics/persistent_cache.cc +++ b/common/graphics/persistent_cache.cc @@ -15,7 +15,7 @@ #include "flutter/fml/make_copyable.h" #include "flutter/fml/mapping.h" #include "flutter/fml/paths.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter/shell/version/version.h" #include "rapidjson/document.h" #include "third_party/skia/include/gpu/GrDirectContext.h" diff --git a/flow/BUILD.gn b/flow/BUILD.gn index e112594570c3e..58d973ea61857 100644 --- a/flow/BUILD.gn +++ b/flow/BUILD.gn @@ -76,6 +76,7 @@ source_set("flow") { "//flutter/common", "//flutter/common/graphics", "//flutter/fml", + "//flutter/fml/trace", "//third_party/skia", ] @@ -177,9 +178,9 @@ if (enable_unittests) { ":flow_testing", "//flutter/common/graphics", "//flutter/fml", + "//flutter/fml/trace", "//flutter/testing:skia", "//flutter/testing:testing_lib", - "//third_party/dart/runtime:libdart_jit", # for tracing "//third_party/googletest:gtest", "//third_party/skia", ] diff --git a/flow/layers/layer.h b/flow/layers/layer.h index c3a38a9089500..17b5c28267f55 100644 --- a/flow/layers/layer.h +++ b/flow/layers/layer.h @@ -17,7 +17,7 @@ #include "flutter/fml/compiler_specific.h" #include "flutter/fml/logging.h" #include "flutter/fml/macros.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkColorFilter.h" diff --git a/flow/layers/layer_tree.cc b/flow/layers/layer_tree.cc index eb58bc1c4aeaf..094f9951eee43 100644 --- a/flow/layers/layer_tree.cc +++ b/flow/layers/layer_tree.cc @@ -5,7 +5,7 @@ #include "flutter/flow/layers/layer_tree.h" #include "flutter/flow/layers/layer.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "third_party/skia/include/core/SkPictureRecorder.h" #include "third_party/skia/include/utils/SkNWayCanvas.h" diff --git a/flow/layers/opacity_layer.cc b/flow/layers/opacity_layer.cc index 5ab3f79cde220..4b988949163b3 100644 --- a/flow/layers/opacity_layer.cc +++ b/flow/layers/opacity_layer.cc @@ -4,7 +4,7 @@ #include "flutter/flow/layers/opacity_layer.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "third_party/skia/include/core/SkPaint.h" namespace flutter { diff --git a/flow/raster_cache.cc b/flow/raster_cache.cc index e748520006724..86e10985d42ce 100644 --- a/flow/raster_cache.cc +++ b/flow/raster_cache.cc @@ -10,7 +10,7 @@ #include "flutter/flow/layers/layer.h" #include "flutter/flow/paint_utils.h" #include "flutter/fml/logging.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkPicture.h" diff --git a/flow/scene_update_context.cc b/flow/scene_update_context.cc index 66e33a831f8d7..3f6b8c41846b8 100644 --- a/flow/scene_update_context.cc +++ b/flow/scene_update_context.cc @@ -10,7 +10,7 @@ #include "flutter/flow/layers/layer.h" #include "flutter/flow/matrix_decomposition.h" #include "flutter/flow/view_holder.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "include/core/SkColor.h" namespace flutter { diff --git a/flow/skia_gpu_object.cc b/flow/skia_gpu_object.cc index 7415916d77954..1ba9eb96cbbeb 100644 --- a/flow/skia_gpu_object.cc +++ b/flow/skia_gpu_object.cc @@ -5,7 +5,7 @@ #include "flutter/flow/skia_gpu_object.h" #include "flutter/fml/message_loop.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" namespace flutter { diff --git a/fml/BUILD.gn b/fml/BUILD.gn index 3a720fae2f9fb..8857e66c2fd2b 100644 --- a/fml/BUILD.gn +++ b/fml/BUILD.gn @@ -82,8 +82,6 @@ source_set("fml") { "time/time_delta.h", "time/time_point.cc", "time/time_point.h", - "trace_event.cc", - "trace_event.h", "unique_fd.cc", "unique_fd.h", "unique_object.h", @@ -193,6 +191,9 @@ source_set("fml") { "$fuchsia_sdk_root/pkg:trace-engine", "$fuchsia_sdk_root/pkg:zx", ] + + libs += + [ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ] } if (is_win) { @@ -237,7 +238,6 @@ if (enable_unittests) { deps = [ "//flutter/benchmarking", "//flutter/fml", - "//flutter/runtime:libdart", ] } @@ -283,13 +283,7 @@ if (enable_unittests) { ":fml_fixtures", "//flutter/fml", "//flutter/fml/dart", - "//flutter/runtime:libdart", "//flutter/testing", ] - - if (is_fuchsia) { - libs = - [ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ] - } } } diff --git a/fml/concurrent_message_loop.cc b/fml/concurrent_message_loop.cc index b58431b7df3d2..fc20f43741e2e 100644 --- a/fml/concurrent_message_loop.cc +++ b/fml/concurrent_message_loop.cc @@ -7,7 +7,6 @@ #include #include "flutter/fml/thread.h" -#include "flutter/fml/trace_event.h" namespace fml { @@ -100,7 +99,6 @@ void ConcurrentMessageLoop::WorkerMain() { // themselves try to post more tasks to the message loop. lock.unlock(); - TRACE_EVENT0("flutter", "ConcurrentWorkerWake"); // Execute the primary task we woke up for. if (task) { task(); diff --git a/fml/message_loop_impl.cc b/fml/message_loop_impl.cc index a206b11a74f22..511343c9ba292 100644 --- a/fml/message_loop_impl.cc +++ b/fml/message_loop_impl.cc @@ -11,7 +11,6 @@ #include "flutter/fml/build_config.h" #include "flutter/fml/logging.h" -#include "flutter/fml/trace_event.h" #if 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 { diff --git a/fml/platform/posix/file_posix.cc b/fml/platform/posix/file_posix.cc index 018be839c1701..f6a90942a9391 100644 --- a/fml/platform/posix/file_posix.cc +++ b/fml/platform/posix/file_posix.cc @@ -16,7 +16,6 @@ #include "flutter/fml/eintr_wrapper.h" #include "flutter/fml/logging.h" #include "flutter/fml/mapping.h" -#include "flutter/fml/trace_event.h" #include "flutter/fml/unique_fd.h" namespace fml { @@ -73,7 +72,6 @@ fml::UniqueFD OpenFile(const fml::UniqueFD& base_directory, const char* path, bool create_if_necessary, FilePermission permission) { - TRACE_EVENT0("flutter", "fml::OpenFile"); if (path == nullptr) { return {}; } diff --git a/fml/trace/BUILD.gn b/fml/trace/BUILD.gn new file mode 100644 index 0000000000000..1558d2c0bf18c --- /dev/null +++ b/fml/trace/BUILD.gn @@ -0,0 +1,15 @@ +# Copyright 2013 The Flutter Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Utilities for tracing to the timeline. The timeline is a Dart utility and +# including this dependency will cause the Dart runtime to be included within +# the target. +source_set("trace") { + sources = [ + "trace_event.cc", + "trace_event.h", + ] + + public_deps = [ "//flutter/fml/dart" ] +} diff --git a/fml/trace_event.cc b/fml/trace/trace_event.cc similarity index 99% rename from fml/trace_event.cc rename to fml/trace/trace_event.cc index 8ee1bed590504..2605e127c23e5 100644 --- a/fml/trace_event.cc +++ b/fml/trace/trace_event.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include #include diff --git a/fml/trace_event.h b/fml/trace/trace_event.h similarity index 100% rename from fml/trace_event.h rename to fml/trace/trace_event.h diff --git a/lib/ui/compositing/scene.cc b/lib/ui/compositing/scene.cc index 46ac6efa534ca..3886f9571b7ea 100644 --- a/lib/ui/compositing/scene.cc +++ b/lib/ui/compositing/scene.cc @@ -4,7 +4,7 @@ #include "flutter/lib/ui/compositing/scene.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter/lib/ui/painting/image.h" #include "flutter/lib/ui/painting/picture.h" #include "flutter/lib/ui/ui_dart_state.h" diff --git a/lib/ui/painting/image_decoder.h b/lib/ui/painting/image_decoder.h index e5f2fba6df1ad..50c82f95a02bf 100644 --- a/lib/ui/painting/image_decoder.h +++ b/lib/ui/painting/image_decoder.h @@ -13,7 +13,7 @@ #include "flutter/fml/concurrent_message_loop.h" #include "flutter/fml/macros.h" #include "flutter/fml/mapping.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter/lib/ui/io_manager.h" #include "flutter/lib/ui/painting/image_descriptor.h" #include "third_party/skia/include/core/SkData.h" diff --git a/lib/ui/painting/image_descriptor.cc b/lib/ui/painting/image_descriptor.cc index 698e7cc21a7b2..27787e8c74b03 100644 --- a/lib/ui/painting/image_descriptor.cc +++ b/lib/ui/painting/image_descriptor.cc @@ -6,7 +6,7 @@ #include "flutter/fml/build_config.h" #include "flutter/fml/logging.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter/lib/ui/painting/codec.h" #include "flutter/lib/ui/painting/image_decoder.h" #include "flutter/lib/ui/painting/multi_frame_codec.h" diff --git a/lib/ui/painting/image_encoding.cc b/lib/ui/painting/image_encoding.cc index 90dbbb6f34bc0..d8784015b4026 100644 --- a/lib/ui/painting/image_encoding.cc +++ b/lib/ui/painting/image_encoding.cc @@ -10,7 +10,7 @@ #include "flutter/common/task_runners.h" #include "flutter/fml/build_config.h" #include "flutter/fml/make_copyable.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter/lib/ui/painting/image.h" #include "flutter/lib/ui/ui_dart_state.h" #include "third_party/skia/include/core/SkCanvas.h" diff --git a/lib/ui/volatile_path_tracker.h b/lib/ui/volatile_path_tracker.h index 40f28311a008a..74d0e7ddd6178 100644 --- a/lib/ui/volatile_path_tracker.h +++ b/lib/ui/volatile_path_tracker.h @@ -11,7 +11,7 @@ #include "flutter/fml/macros.h" #include "flutter/fml/task_runner.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "third_party/skia/include/core/SkPath.h" namespace flutter { diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index e2e9478e23ba7..8d1d58a56674b 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -21,17 +21,45 @@ source_set("test_font") { } } -# Picks the libdart implementation based on the Flutter runtime mode. -group("libdart") { +is_profile_or_release = + flutter_runtime_mode == "profile" || flutter_runtime_mode == "release" + +# Fuchsia is special in that it does not use Flutter's policy of using JIT in +# debug runtime mode and AOT in the profile and release modes. This is to +# accommodate various runner configurations. :libdart allows for this by +# not linking in a runtime and deferring that responsibility to the target. +# However, all other non-runner target are now left with having to decide how to +# link in a VM. +group("libdart_flutter_policy") { public_deps = [] - if (flutter_runtime_mode == "profile" || flutter_runtime_mode == "release") { + # Flutter use AOT in profile or release and JIT in debug. + if (is_profile_or_release) { public_deps += [ "//third_party/dart/runtime:libdart_precompiled_runtime" ] } else { - public_deps += [ - "//flutter/lib/snapshot", - "//third_party/dart/runtime:libdart_jit", - ] + public_deps += [ "//third_party/dart/runtime:libdart_jit" ] + } + + # Instead of packaging the VM and isolate snapshots separately along with the + # AOT blob, JIT variants look for these assets in the binary itself. + if (!is_profile_or_release) { + public_deps += [ "//flutter/lib/snapshot" ] + } +} + +# Picks the libdart implementation based on the Flutter runtime mode. +group("libdart") { + public_deps = [] + + # Whether Fuchsia uses JIT or AOT does not depend on the runtime mode. Instead + # multiple runner variants are built and those runners explicitly link in the + # right variant of the VM. + if (!is_fuchsia) { + public_deps += [ ":libdart_flutter_policy" ] + } + + if (!is_profile_or_release) { + public_deps += [ "//flutter/lib/snapshot" ] } } diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index ddec2276191e7..2995da746c42d 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -9,7 +9,7 @@ #include "flutter/fml/paths.h" #include "flutter/fml/posix_wrappers.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter/lib/io/dart_io.h" #include "flutter/lib/ui/dart_runtime_hooks.h" #include "flutter/lib/ui/dart_ui.h" diff --git a/runtime/dart_snapshot.cc b/runtime/dart_snapshot.cc index 0dbbab8b12fbe..66aa279b55c8f 100644 --- a/runtime/dart_snapshot.cc +++ b/runtime/dart_snapshot.cc @@ -8,7 +8,7 @@ #include "flutter/fml/native_library.h" #include "flutter/fml/paths.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter/lib/snapshot/snapshot.h" #include "flutter/runtime/dart_vm.h" #include "third_party/dart/runtime/include/dart_api.h" diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index 0beb81259c28e..38a56e1589c19 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -18,7 +18,7 @@ #include "flutter/fml/size.h" #include "flutter/fml/synchronization/count_down_latch.h" #include "flutter/fml/time/time_delta.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter/lib/io/dart_io.h" #include "flutter/lib/ui/dart_runtime_hooks.h" #include "flutter/lib/ui/dart_ui.h" diff --git a/runtime/dart_vm_initializer.cc b/runtime/dart_vm_initializer.cc index 5ee62aa2302e2..d9e7760b607f7 100644 --- a/runtime/dart_vm_initializer.cc +++ b/runtime/dart_vm_initializer.cc @@ -8,7 +8,7 @@ #include "flutter/fml/logging.h" #include "flutter/fml/synchronization/shared_mutex.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" // Tracks whether Dart has been initialized and if it is safe to call Dart // APIs. diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index d9abb720e1f21..ad5d9cdf15f88 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -5,7 +5,7 @@ #include "flutter/runtime/runtime_controller.h" #include "flutter/fml/message_loop.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter/lib/ui/compositing/scene.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/platform_configuration.h" diff --git a/runtime/skia_concurrent_executor.cc b/runtime/skia_concurrent_executor.cc index 843b9386425b0..f7e8ec41c903f 100644 --- a/runtime/skia_concurrent_executor.cc +++ b/runtime/skia_concurrent_executor.cc @@ -4,7 +4,7 @@ #include "flutter/runtime/skia_concurrent_executor.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" namespace flutter { diff --git a/shell/common/animator.cc b/shell/common/animator.cc index c2fc83e45d60e..9248954a0d177 100644 --- a/shell/common/animator.cc +++ b/shell/common/animator.cc @@ -4,7 +4,7 @@ #include "flutter/shell/common/animator.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "third_party/dart/runtime/include/dart_tools_api.h" namespace flutter { diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 7afffbdfdf207..2a337b16c5cb1 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -14,7 +14,7 @@ #include "flutter/fml/file.h" #include "flutter/fml/make_copyable.h" #include "flutter/fml/paths.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter/fml/unique_fd.h" #include "flutter/lib/snapshot/snapshot.h" #include "flutter/lib/ui/text/font_collection.h" diff --git a/shell/common/pipeline.h b/shell/common/pipeline.h index d05e0f50612c0..263598e3ec612 100644 --- a/shell/common/pipeline.h +++ b/shell/common/pipeline.h @@ -12,7 +12,7 @@ #include "flutter/fml/macros.h" #include "flutter/fml/memory/ref_counted.h" #include "flutter/fml/synchronization/semaphore.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" namespace flutter { diff --git a/shell/common/pointer_data_dispatcher.cc b/shell/common/pointer_data_dispatcher.cc index 78346a9d0ced3..2fb5e21106d82 100644 --- a/shell/common/pointer_data_dispatcher.cc +++ b/shell/common/pointer_data_dispatcher.cc @@ -4,7 +4,7 @@ #include "flutter/shell/common/pointer_data_dispatcher.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" namespace flutter { diff --git a/shell/common/shell.cc b/shell/common/shell.cc index ad33a6e517558..65e2d2d6afb1d 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -18,7 +18,7 @@ #include "flutter/fml/make_copyable.h" #include "flutter/fml/message_loop.h" #include "flutter/fml/paths.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter/fml/unique_fd.h" #include "flutter/runtime/dart_vm.h" #include "flutter/shell/common/engine.h" diff --git a/shell/common/skia_event_tracer_impl.cc b/shell/common/skia_event_tracer_impl.cc index 053df0993c33b..4efb993975ff4 100644 --- a/shell/common/skia_event_tracer_impl.cc +++ b/shell/common/skia_event_tracer_impl.cc @@ -9,7 +9,7 @@ #include "flutter/fml/logging.h" #include "flutter/fml/posix_wrappers.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "third_party/dart/runtime/include/dart_tools_api.h" #include "third_party/skia/include/utils/SkEventTracer.h" #include "third_party/skia/include/utils/SkTraceEventPhase.h" diff --git a/shell/common/vsync_waiter.cc b/shell/common/vsync_waiter.cc index 40ced727abcfe..6748f5518ba65 100644 --- a/shell/common/vsync_waiter.cc +++ b/shell/common/vsync_waiter.cc @@ -5,7 +5,7 @@ #include "flutter/shell/common/vsync_waiter.h" #include "flutter/fml/task_runner.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "fml/message_loop_task_queues.h" namespace flutter { diff --git a/shell/common/vsync_waiter_fallback.cc b/shell/common/vsync_waiter_fallback.cc index 8bf51c5ce2f4e..f740796cf959e 100644 --- a/shell/common/vsync_waiter_fallback.cc +++ b/shell/common/vsync_waiter_fallback.cc @@ -5,7 +5,7 @@ #include "flutter/shell/common/vsync_waiter_fallback.h" #include "flutter/fml/logging.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" namespace flutter { namespace { diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index b78c0a5bf1d01..4ce580b6c8ff7 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -8,7 +8,7 @@ #include "flutter/fml/base32.h" #include "flutter/fml/logging.h" #include "flutter/fml/size.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "third_party/skia/include/core/SkColorFilter.h" #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" diff --git a/shell/gpu/gpu_surface_metal.mm b/shell/gpu/gpu_surface_metal.mm index ea40dda5893dd..434d18954b6df 100644 --- a/shell/gpu/gpu_surface_metal.mm +++ b/shell/gpu/gpu_surface_metal.mm @@ -9,7 +9,7 @@ #include "flutter/common/graphics/persistent_cache.h" #include "flutter/fml/make_copyable.h" #include "flutter/fml/platform/darwin/cf_utils.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter/shell/gpu/gpu_surface_metal_delegate.h" #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" diff --git a/shell/platform/android/android_context_gl.cc b/shell/platform/android/android_context_gl.cc index 04e8b43d902be..e3b682ef78a61 100644 --- a/shell/platform/android/android_context_gl.cc +++ b/shell/platform/android/android_context_gl.cc @@ -8,7 +8,7 @@ #include -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" namespace flutter { diff --git a/shell/platform/android/android_surface_software.cc b/shell/platform/android/android_surface_software.cc index 3c85cd175c59b..d8303af861ca8 100644 --- a/shell/platform/android/android_surface_software.cc +++ b/shell/platform/android/android_surface_software.cc @@ -10,7 +10,7 @@ #include "flutter/fml/logging.h" #include "flutter/fml/platform/android/jni_weak_ref.h" #include "flutter/fml/platform/android/scoped_java_ref.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter/shell/platform/android/android_shell_holder.h" #include "flutter/shell/platform/android/jni/platform_view_android_jni.h" #include "third_party/skia/include/core/SkImage.h" diff --git a/shell/platform/android/external_view_embedder/BUILD.gn b/shell/platform/android/external_view_embedder/BUILD.gn index 44bcdaddae280..213eee6c5fef4 100644 --- a/shell/platform/android/external_view_embedder/BUILD.gn +++ b/shell/platform/android/external_view_embedder/BUILD.gn @@ -19,6 +19,7 @@ source_set("external_view_embedder") { "//flutter/common", "//flutter/flow", "//flutter/fml", + "//flutter/fml/trace", "//flutter/shell/platform/android/context", "//flutter/shell/platform/android/jni", "//flutter/shell/platform/android/surface", diff --git a/shell/platform/android/external_view_embedder/external_view_embedder.cc b/shell/platform/android/external_view_embedder/external_view_embedder.cc index c22462c02c7ad..7a299ff10d724 100644 --- a/shell/platform/android/external_view_embedder/external_view_embedder.cc +++ b/shell/platform/android/external_view_embedder/external_view_embedder.cc @@ -4,7 +4,7 @@ #include "flutter/shell/platform/android/external_view_embedder/external_view_embedder.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter/shell/platform/android/surface/android_surface.h" namespace flutter { diff --git a/shell/platform/android/vsync_waiter_android.cc b/shell/platform/android/vsync_waiter_android.cc index 2851eec5f58e5..571bb63aafe67 100644 --- a/shell/platform/android/vsync_waiter_android.cc +++ b/shell/platform/android/vsync_waiter_android.cc @@ -12,7 +12,7 @@ #include "flutter/fml/platform/android/jni_util.h" #include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/fml/size.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" namespace flutter { diff --git a/shell/platform/common/BUILD.gn b/shell/platform/common/BUILD.gn index 323f8e5477853..9fc4261d53826 100644 --- a/shell/platform/common/BUILD.gn +++ b/shell/platform/common/BUILD.gn @@ -148,7 +148,6 @@ if (enable_unittests) { ":common_cpp_core", ":common_cpp_core_fixtures", "//flutter/testing", - "//third_party/dart/runtime:libdart_jit", ] public_configs = [ "//flutter:config" ] diff --git a/shell/platform/common/client_wrapper/BUILD.gn b/shell/platform/common/client_wrapper/BUILD.gn index 660f44403ef8d..5a203ffc27744 100644 --- a/shell/platform/common/client_wrapper/BUILD.gn +++ b/shell/platform/common/client_wrapper/BUILD.gn @@ -58,11 +58,6 @@ executable("client_wrapper_unittests") { ":client_wrapper_fixtures", ":client_wrapper_library_stubs", "//flutter/testing", - - # TODO(chunhtai): Consider refactoring flutter_root/testing so that there's a testing - # target that doesn't require a Dart runtime to be linked in. - # https://github.com/flutter/flutter/issues/41414. - "//third_party/dart/runtime:libdart_jit", ] defines = [ "FLUTTER_DESKTOP_LIBRARY" ] diff --git a/shell/platform/darwin/BUILD.gn b/shell/platform/darwin/BUILD.gn index 23c8e4055acf7..f20e12b0151ea 100644 --- a/shell/platform/darwin/BUILD.gn +++ b/shell/platform/darwin/BUILD.gn @@ -64,7 +64,6 @@ executable("flutter_channels_unittests") { ":flutter_channels", ":flutter_channels_fixtures", "//flutter/testing", - "//third_party/dart/runtime:libdart_jit", ] public_configs = [ "//flutter:config" ] diff --git a/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm b/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm index d5e3564ecffca..1f945f2d38bbf 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm @@ -10,7 +10,7 @@ #include "flutter/fml/message_loop.h" #include "flutter/fml/platform/darwin/platform_version.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter/runtime/ptrace_check.h" #include "flutter/shell/common/engine.h" #include "flutter/shell/common/platform_view.h" diff --git a/shell/platform/darwin/ios/framework/Source/FlutterOverlayView.mm b/shell/platform/darwin/ios/framework/Source/FlutterOverlayView.mm index 345d3a36798cb..f1ae5d75e4b59 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterOverlayView.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterOverlayView.mm @@ -9,7 +9,7 @@ #include "flutter/flow/layers/layer_tree.h" #include "flutter/fml/platform/darwin/cf_utils.h" #include "flutter/fml/synchronization/waitable_event.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/rasterizer.h" #import "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h" diff --git a/shell/platform/darwin/ios/framework/Source/FlutterView.mm b/shell/platform/darwin/ios/framework/Source/FlutterView.mm index 36b1bbb346e3e..418da2d02b697 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterView.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterView.mm @@ -9,7 +9,7 @@ #include "flutter/flow/layers/layer_tree.h" #include "flutter/fml/platform/darwin/cf_utils.h" #include "flutter/fml/synchronization/waitable_event.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/rasterizer.h" #import "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h" diff --git a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm index 37d9b23c0c7f9..6fe0660d69795 100644 --- a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm +++ b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm @@ -13,7 +13,7 @@ #include "flutter/common/task_runners.h" #include "flutter/fml/logging.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" namespace flutter { diff --git a/shell/platform/darwin/ios/ios_render_target_gl.mm b/shell/platform/darwin/ios/ios_render_target_gl.mm index 28fb24263b262..bcd81ad65ec01 100644 --- a/shell/platform/darwin/ios/ios_render_target_gl.mm +++ b/shell/platform/darwin/ios/ios_render_target_gl.mm @@ -6,7 +6,7 @@ #include -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "third_party/skia/include/gpu/GrContextOptions.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h" diff --git a/shell/platform/darwin/ios/ios_surface_gl.mm b/shell/platform/darwin/ios/ios_surface_gl.mm index 34983f3a5bb21..f696ce8de90cf 100644 --- a/shell/platform/darwin/ios/ios_surface_gl.mm +++ b/shell/platform/darwin/ios/ios_surface_gl.mm @@ -4,7 +4,7 @@ #import "flutter/shell/platform/darwin/ios/ios_surface_gl.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter/shell/gpu/gpu_surface_gl.h" #import "flutter/shell/platform/darwin/ios/ios_context_gl.h" diff --git a/shell/platform/darwin/ios/ios_surface_software.mm b/shell/platform/darwin/ios/ios_surface_software.mm index 687ab7403ca3b..2ae33111519d9 100644 --- a/shell/platform/darwin/ios/ios_surface_software.mm +++ b/shell/platform/darwin/ios/ios_surface_software.mm @@ -10,7 +10,7 @@ #include "flutter/fml/logging.h" #include "flutter/fml/platform/darwin/cf_utils.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "third_party/skia/include/utils/mac/SkCGUtils.h" namespace flutter { diff --git a/shell/platform/darwin/ios/platform_view_ios.mm b/shell/platform/darwin/ios/platform_view_ios.mm index 17974a0700d1b..e2505bc9a88c7 100644 --- a/shell/platform/darwin/ios/platform_view_ios.mm +++ b/shell/platform/darwin/ios/platform_view_ios.mm @@ -9,7 +9,7 @@ #include "flutter/common/task_runners.h" #include "flutter/fml/synchronization/waitable_event.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter/shell/common/shell_io_manager.h" #import "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h" #import "flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h" diff --git a/shell/platform/embedder/BUILD.gn b/shell/platform/embedder/BUILD.gn index b6d93bc60a7d2..3b61971b618e8 100644 --- a/shell/platform/embedder/BUILD.gn +++ b/shell/platform/embedder/BUILD.gn @@ -81,6 +81,7 @@ template("embedder_source_set") { "//flutter/common/graphics", "//flutter/flow", "//flutter/fml", + "//flutter/fml/trace", "//flutter/lib/ui", "//flutter/runtime:libdart", "//flutter/shell/common", diff --git a/shell/platform/embedder/embedder.cc b/shell/platform/embedder/embedder.cc index cc9028f6a72b6..bdd0ba80e4580 100644 --- a/shell/platform/embedder/embedder.cc +++ b/shell/platform/embedder/embedder.cc @@ -43,7 +43,7 @@ extern const intptr_t kPlatformStrongDillSize; #include "flutter/fml/make_copyable.h" #include "flutter/fml/message_loop.h" #include "flutter/fml/paths.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/switches.h" #include "flutter/shell/platform/embedder/embedder.h" diff --git a/shell/platform/embedder/embedder_external_view.cc b/shell/platform/embedder/embedder_external_view.cc index e5ca23d0fb130..833ba4efa7cbd 100644 --- a/shell/platform/embedder/embedder_external_view.cc +++ b/shell/platform/embedder/embedder_external_view.cc @@ -3,7 +3,7 @@ // found in the LICENSE file. #include "flutter/shell/platform/embedder/embedder_external_view.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter/shell/common/canvas_spy.h" namespace flutter { diff --git a/shell/platform/embedder/embedder_surface_software.cc b/shell/platform/embedder/embedder_surface_software.cc index e427936b6ba3b..b98e1ec2ed0fc 100644 --- a/shell/platform/embedder/embedder_surface_software.cc +++ b/shell/platform/embedder/embedder_surface_software.cc @@ -4,7 +4,7 @@ #include "flutter/shell/platform/embedder/embedder_surface_software.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "third_party/skia/include/gpu/GrDirectContext.h" namespace flutter { diff --git a/shell/platform/fuchsia/dart_runner/BUILD.gn b/shell/platform/fuchsia/dart_runner/BUILD.gn index ebdc71ac5ae36..30e43c604265b 100644 --- a/shell/platform/fuchsia/dart_runner/BUILD.gn +++ b/shell/platform/fuchsia/dart_runner/BUILD.gn @@ -56,6 +56,7 @@ template("runner") { deps = [ "//flutter/common", "//flutter/fml", + "//flutter/fml/trace", "//flutter/shell/platform/fuchsia/dart-pkg/fuchsia", "//flutter/shell/platform/fuchsia/dart-pkg/zircon", "$fuchsia_sdk_root/pkg:async", diff --git a/shell/platform/fuchsia/dart_runner/dart_runner.cc b/shell/platform/fuchsia/dart_runner/dart_runner.cc index 2a87776cb4d51..6dc132670b32c 100644 --- a/shell/platform/fuchsia/dart_runner/dart_runner.cc +++ b/shell/platform/fuchsia/dart_runner/dart_runner.cc @@ -17,7 +17,7 @@ #include #include "dart_component_controller.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "logging.h" #include "runtime/dart/utils/inlines.h" #include "runtime/dart/utils/vmservice_object.h" diff --git a/shell/platform/fuchsia/dart_runner/main.cc b/shell/platform/fuchsia/dart_runner/main.cc index b652bc547ceb0..34bed7ea7be1d 100644 --- a/shell/platform/fuchsia/dart_runner/main.cc +++ b/shell/platform/fuchsia/dart_runner/main.cc @@ -11,7 +11,7 @@ #include "dart_runner.h" #include "flutter/fml/logging.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "logging.h" #include "platform/utils.h" #include "runtime/dart/utils/files.h" diff --git a/shell/platform/fuchsia/flutter/BUILD.gn b/shell/platform/fuchsia/flutter/BUILD.gn index 728d2c4e819d4..ca102824ec5f0 100644 --- a/shell/platform/fuchsia/flutter/BUILD.gn +++ b/shell/platform/fuchsia/flutter/BUILD.gn @@ -118,6 +118,7 @@ template("runner_sources") { "//flutter/assets", "//flutter/common", "//flutter/fml", + "//flutter/fml/trace", "//flutter/vulkan", ] diff --git a/shell/platform/fuchsia/flutter/fuchsia_external_view_embedder.cc b/shell/platform/fuchsia/flutter/fuchsia_external_view_embedder.cc index f14d5e8e9d856..6b48ed424f4f0 100644 --- a/shell/platform/fuchsia/flutter/fuchsia_external_view_embedder.cc +++ b/shell/platform/fuchsia/flutter/fuchsia_external_view_embedder.cc @@ -10,7 +10,7 @@ #include // For std::clamp -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "third_party/skia/include/core/SkPicture.h" #include "third_party/skia/include/core/SkSurface.h" diff --git a/shell/platform/fuchsia/flutter/session_connection.cc b/shell/platform/fuchsia/flutter/session_connection.cc index ea686a88c7c50..8044e380eb4db 100644 --- a/shell/platform/fuchsia/flutter/session_connection.cc +++ b/shell/platform/fuchsia/flutter/session_connection.cc @@ -5,7 +5,7 @@ #include "session_connection.h" #include "flutter/fml/make_copyable.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "vsync_recorder.h" #include "vsync_waiter.h" diff --git a/shell/platform/fuchsia/flutter/vsync_waiter.cc b/shell/platform/fuchsia/flutter/vsync_waiter.cc index fd8f60122a0fa..4524fa1649666 100644 --- a/shell/platform/fuchsia/flutter/vsync_waiter.cc +++ b/shell/platform/fuchsia/flutter/vsync_waiter.cc @@ -12,7 +12,7 @@ #include "flutter/fml/make_copyable.h" #include "flutter/fml/synchronization/waitable_event.h" #include "flutter/fml/time/time_delta.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "flutter_runner_product_configuration.h" #include "vsync_recorder.h" diff --git a/shell/platform/fuchsia/flutter/vulkan_surface.cc b/shell/platform/fuchsia/flutter/vulkan_surface.cc index c5f47ed75b571..f6c300dc2efac 100644 --- a/shell/platform/fuchsia/flutter/vulkan_surface.cc +++ b/shell/platform/fuchsia/flutter/vulkan_surface.cc @@ -9,7 +9,7 @@ #include -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "runtime/dart/utils/inlines.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/gpu/GrBackendSemaphore.h" diff --git a/shell/platform/fuchsia/flutter/vulkan_surface_pool.cc b/shell/platform/fuchsia/flutter/vulkan_surface_pool.cc index b9f83e8eabb30..11d1f5a0901d2 100644 --- a/shell/platform/fuchsia/flutter/vulkan_surface_pool.cc +++ b/shell/platform/fuchsia/flutter/vulkan_surface_pool.cc @@ -10,7 +10,7 @@ #include #include -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "third_party/skia/include/gpu/GrDirectContext.h" namespace flutter_runner { diff --git a/shell/platform/fuchsia/flutter/vulkan_surface_producer.cc b/shell/platform/fuchsia/flutter/vulkan_surface_producer.cc index ad38223a351d7..783bf8a56e8d2 100644 --- a/shell/platform/fuchsia/flutter/vulkan_surface_producer.cc +++ b/shell/platform/fuchsia/flutter/vulkan_surface_producer.cc @@ -11,7 +11,7 @@ #include #include -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "third_party/skia/include/gpu/GrBackendSemaphore.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" #include "third_party/skia/include/gpu/GrDirectContext.h" diff --git a/shell/platform/glfw/client_wrapper/BUILD.gn b/shell/platform/glfw/client_wrapper/BUILD.gn index 6f1faae1f534c..db402d87d3395 100644 --- a/shell/platform/glfw/client_wrapper/BUILD.gn +++ b/shell/platform/glfw/client_wrapper/BUILD.gn @@ -87,10 +87,5 @@ executable("client_wrapper_glfw_unittests") { ":client_wrapper_library_stubs_glfw", "//flutter/shell/platform/common/client_wrapper:client_wrapper_library_stubs", "//flutter/testing", - - # TODO(chunhtai): Consider refactoring flutter_root/testing so that there's a testing - # target that doesn't require a Dart runtime to be linked in. - # https://github.com/flutter/flutter/issues/41414. - "//third_party/dart/runtime:libdart_jit", ] } diff --git a/shell/platform/windows/client_wrapper/BUILD.gn b/shell/platform/windows/client_wrapper/BUILD.gn index 18cf24d75abd3..cf4ff293a1da7 100644 --- a/shell/platform/windows/client_wrapper/BUILD.gn +++ b/shell/platform/windows/client_wrapper/BUILD.gn @@ -90,10 +90,5 @@ executable("client_wrapper_windows_unittests") { ":client_wrapper_windows_fixtures", "//flutter/shell/platform/common/client_wrapper:client_wrapper_library_stubs", "//flutter/testing", - - # TODO(chunhtai): Consider refactoring flutter_root/testing so that there's a testing - # target that doesn't require a Dart runtime to be linked in. - # https://github.com/flutter/flutter/issues/41414. - "//third_party/dart/runtime:libdart_jit", ] } diff --git a/shell/profiling/BUILD.gn b/shell/profiling/BUILD.gn index 457ef6d2972f5..fbbe1a55da902 100644 --- a/shell/profiling/BUILD.gn +++ b/shell/profiling/BUILD.gn @@ -7,6 +7,7 @@ import("//flutter/shell/config.gni") _profiler_deps = [ "//flutter/common", "//flutter/fml", + "//flutter/fml/trace", ] source_set("profiling") { diff --git a/shell/profiling/sampling_profiler.h b/shell/profiling/sampling_profiler.h index 8b4b06c007622..46f65af6f9dae 100644 --- a/shell/profiling/sampling_profiler.h +++ b/shell/profiling/sampling_profiler.h @@ -12,7 +12,7 @@ #include "flutter/fml/synchronization/count_down_latch.h" #include "flutter/fml/task_runner.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" namespace flutter { diff --git a/shell/testing/BUILD.gn b/shell/testing/BUILD.gn index 247b168bae9c5..eec5f1ca817f0 100644 --- a/shell/testing/BUILD.gn +++ b/shell/testing/BUILD.gn @@ -2,37 +2,42 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") +import("//flutter/common/config.gni") -executable("testing") { - output_name = "flutter_tester" +if (flutter_runtime_mode == "debug") { + executable("testing") { + output_name = "flutter_tester" - public_configs = [ - "//flutter:config", - "//flutter:export_dynamic_symbols", - ] + public_configs = [ + "//flutter:config", + "//flutter:export_dynamic_symbols", + ] + + sources = [ "tester_main.cc" ] + if (is_win) { + libs = [ + "psapi.lib", + "user32.lib", + "FontSub.lib", + "shlwapi.lib", + ] + } - sources = [ "tester_main.cc" ] - if (is_win) { - libs = [ - "psapi.lib", - "user32.lib", - "FontSub.lib", - "shlwapi.lib", + deps = [ + "//flutter/assets", + "//flutter/common", + "//flutter/flow", + "//flutter/fml", + "//flutter/fml/trace", + "//flutter/lib/snapshot", + "//flutter/shell/common", + "//flutter/shell/gpu:gpu_surface_software", + "//third_party/dart/runtime/bin:dart_io_api", + "//third_party/skia", ] } - - deps = [ - "//flutter/assets", - "//flutter/common", - "//flutter/flow", - "//flutter/fml", - "//flutter/lib/snapshot", - "//flutter/shell/common", - "//flutter/shell/gpu:gpu_surface_software", - "//flutter/third_party/tonic", - "//third_party/dart/runtime:libdart_jit", - "//third_party/dart/runtime/bin:dart_io_api", - "//third_party/skia", - ] +} else { + group("testing") { + # The Flutter Dart tester is only available in JIT runtime modes. + } } diff --git a/testing/BUILD.gn b/testing/BUILD.gn index 3b1c3bd19de11..9baabc6459709 100644 --- a/testing/BUILD.gn +++ b/testing/BUILD.gn @@ -19,6 +19,7 @@ source_set("testing_lib") { public_deps = [ "//flutter/fml", + "//flutter/fml/trace", "//third_party/googletest:gmock", "//third_party/googletest:gtest", ] @@ -36,7 +37,10 @@ source_set("testing") { "test_timeout_listener.h", ] - public_deps = [ ":testing_lib" ] + public_deps = [ + ":testing_lib", + "//flutter/runtime:libdart_flutter_policy", + ] } source_set("dart") { diff --git a/testing/run_tests.py b/testing/run_tests.py index f37904cee616a..b9588a64ab341 100755 --- a/testing/run_tests.py +++ b/testing/run_tests.py @@ -509,7 +509,10 @@ def main(): args = parser.parse_args() if args.type == 'all': - types = ['engine', 'dart', 'benchmarks', 'java', 'objc', 'font-subset'] + types = ['engine', 'benchmarks', 'java', 'objc', 'font-subset'] + if args.variant == 'host_debug' or args.variant == 'host_debug_unopt': + # flutter_tester can only be built in JIT mode. So Dart tests may only run in JIT runtime modes. + types.append('dart') else: types = args.type.split(',') @@ -523,6 +526,7 @@ def main(): if 'dart' in types: assert not IsWindows(), "Dart tests can't be run on windows. https://github.com/flutter/flutter/issues/36301." + assert args.variant == 'host_debug' or args.variant == 'host_debug_unopt', "Dart tests can only be run in Debug runtime modes." dart_filter = args.dart_filter.split(',') if args.dart_filter else None RunDartTests(build_dir, dart_filter, args.verbose_dart_snapshot) RunConstFinderTests(build_dir) diff --git a/third_party/txt/BUILD.gn b/third_party/txt/BUILD.gn index c236e8c10fbcd..ad0298ac3ceea 100644 --- a/third_party/txt/BUILD.gn +++ b/third_party/txt/BUILD.gn @@ -143,6 +143,7 @@ source_set("txt") { public_deps = [ "//flutter/fml", + "//flutter/fml/trace", "//third_party/harfbuzz", "//third_party/icu", "//third_party/skia", @@ -184,7 +185,7 @@ source_set("txt") { if (enable_unittests) { txt_common_executable_deps = [ "//flutter/fml", # For ICU initialization. - "//third_party/dart/runtime:libdart_jit", # For logging. + "//flutter/fml/trace", ] test_fixtures("txt_fixtures") { diff --git a/third_party/txt/src/txt/font_collection.cc b/third_party/txt/src/txt/font_collection.cc index 7c0e4e483054c..cc97e4fb81579 100644 --- a/third_party/txt/src/txt/font_collection.cc +++ b/third_party/txt/src/txt/font_collection.cc @@ -25,7 +25,7 @@ #include #include #include "flutter/fml/logging.h" -#include "flutter/fml/trace_event.h" +#include "flutter/fml/trace/trace_event.h" #include "font_skia.h" #include "minikin/Layout.h" #include "txt/platform.h" From 97affb0d4093132e9726c9fede876862ff8fcf45 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 4 May 2021 13:29:44 -0700 Subject: [PATCH 2/2] Back out changes related to VM mode selection based on Flutter runtime mode. --- benchmarking/BUILD.gn | 2 +- runtime/BUILD.gn | 42 +++---------- shell/platform/common/BUILD.gn | 1 + shell/platform/common/client_wrapper/BUILD.gn | 5 ++ shell/platform/darwin/BUILD.gn | 1 + shell/platform/glfw/client_wrapper/BUILD.gn | 5 ++ .../platform/windows/client_wrapper/BUILD.gn | 5 ++ shell/testing/BUILD.gn | 61 +++++++++---------- testing/BUILD.gn | 5 +- testing/run_tests.py | 6 +- third_party/txt/BUILD.gn | 2 +- 11 files changed, 56 insertions(+), 79 deletions(-) diff --git a/benchmarking/BUILD.gn b/benchmarking/BUILD.gn index e357dcb590872..14ef8a0c1cb33 100644 --- a/benchmarking/BUILD.gn +++ b/benchmarking/BUILD.gn @@ -16,7 +16,7 @@ source_set("benchmarking") { public_deps = [ "//flutter/fml", - "//flutter/runtime:libdart_flutter_policy", + "//flutter/runtime:libdart", "//third_party/benchmark", ] diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index 8d1d58a56674b..e2e9478e23ba7 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -21,45 +21,17 @@ source_set("test_font") { } } -is_profile_or_release = - flutter_runtime_mode == "profile" || flutter_runtime_mode == "release" - -# Fuchsia is special in that it does not use Flutter's policy of using JIT in -# debug runtime mode and AOT in the profile and release modes. This is to -# accommodate various runner configurations. :libdart allows for this by -# not linking in a runtime and deferring that responsibility to the target. -# However, all other non-runner target are now left with having to decide how to -# link in a VM. -group("libdart_flutter_policy") { - public_deps = [] - - # Flutter use AOT in profile or release and JIT in debug. - if (is_profile_or_release) { - public_deps += [ "//third_party/dart/runtime:libdart_precompiled_runtime" ] - } else { - public_deps += [ "//third_party/dart/runtime:libdart_jit" ] - } - - # Instead of packaging the VM and isolate snapshots separately along with the - # AOT blob, JIT variants look for these assets in the binary itself. - if (!is_profile_or_release) { - public_deps += [ "//flutter/lib/snapshot" ] - } -} - # Picks the libdart implementation based on the Flutter runtime mode. group("libdart") { public_deps = [] - # Whether Fuchsia uses JIT or AOT does not depend on the runtime mode. Instead - # multiple runner variants are built and those runners explicitly link in the - # right variant of the VM. - if (!is_fuchsia) { - public_deps += [ ":libdart_flutter_policy" ] - } - - if (!is_profile_or_release) { - public_deps += [ "//flutter/lib/snapshot" ] + if (flutter_runtime_mode == "profile" || flutter_runtime_mode == "release") { + public_deps += [ "//third_party/dart/runtime:libdart_precompiled_runtime" ] + } else { + public_deps += [ + "//flutter/lib/snapshot", + "//third_party/dart/runtime:libdart_jit", + ] } } diff --git a/shell/platform/common/BUILD.gn b/shell/platform/common/BUILD.gn index 9fc4261d53826..323f8e5477853 100644 --- a/shell/platform/common/BUILD.gn +++ b/shell/platform/common/BUILD.gn @@ -148,6 +148,7 @@ if (enable_unittests) { ":common_cpp_core", ":common_cpp_core_fixtures", "//flutter/testing", + "//third_party/dart/runtime:libdart_jit", ] public_configs = [ "//flutter:config" ] diff --git a/shell/platform/common/client_wrapper/BUILD.gn b/shell/platform/common/client_wrapper/BUILD.gn index 5a203ffc27744..660f44403ef8d 100644 --- a/shell/platform/common/client_wrapper/BUILD.gn +++ b/shell/platform/common/client_wrapper/BUILD.gn @@ -58,6 +58,11 @@ executable("client_wrapper_unittests") { ":client_wrapper_fixtures", ":client_wrapper_library_stubs", "//flutter/testing", + + # TODO(chunhtai): Consider refactoring flutter_root/testing so that there's a testing + # target that doesn't require a Dart runtime to be linked in. + # https://github.com/flutter/flutter/issues/41414. + "//third_party/dart/runtime:libdart_jit", ] defines = [ "FLUTTER_DESKTOP_LIBRARY" ] diff --git a/shell/platform/darwin/BUILD.gn b/shell/platform/darwin/BUILD.gn index f20e12b0151ea..23c8e4055acf7 100644 --- a/shell/platform/darwin/BUILD.gn +++ b/shell/platform/darwin/BUILD.gn @@ -64,6 +64,7 @@ executable("flutter_channels_unittests") { ":flutter_channels", ":flutter_channels_fixtures", "//flutter/testing", + "//third_party/dart/runtime:libdart_jit", ] public_configs = [ "//flutter:config" ] diff --git a/shell/platform/glfw/client_wrapper/BUILD.gn b/shell/platform/glfw/client_wrapper/BUILD.gn index db402d87d3395..6f1faae1f534c 100644 --- a/shell/platform/glfw/client_wrapper/BUILD.gn +++ b/shell/platform/glfw/client_wrapper/BUILD.gn @@ -87,5 +87,10 @@ executable("client_wrapper_glfw_unittests") { ":client_wrapper_library_stubs_glfw", "//flutter/shell/platform/common/client_wrapper:client_wrapper_library_stubs", "//flutter/testing", + + # TODO(chunhtai): Consider refactoring flutter_root/testing so that there's a testing + # target that doesn't require a Dart runtime to be linked in. + # https://github.com/flutter/flutter/issues/41414. + "//third_party/dart/runtime:libdart_jit", ] } diff --git a/shell/platform/windows/client_wrapper/BUILD.gn b/shell/platform/windows/client_wrapper/BUILD.gn index cf4ff293a1da7..18cf24d75abd3 100644 --- a/shell/platform/windows/client_wrapper/BUILD.gn +++ b/shell/platform/windows/client_wrapper/BUILD.gn @@ -90,5 +90,10 @@ executable("client_wrapper_windows_unittests") { ":client_wrapper_windows_fixtures", "//flutter/shell/platform/common/client_wrapper:client_wrapper_library_stubs", "//flutter/testing", + + # TODO(chunhtai): Consider refactoring flutter_root/testing so that there's a testing + # target that doesn't require a Dart runtime to be linked in. + # https://github.com/flutter/flutter/issues/41414. + "//third_party/dart/runtime:libdart_jit", ] } diff --git a/shell/testing/BUILD.gn b/shell/testing/BUILD.gn index eec5f1ca817f0..247b168bae9c5 100644 --- a/shell/testing/BUILD.gn +++ b/shell/testing/BUILD.gn @@ -2,42 +2,37 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//flutter/common/config.gni") +import("//build/fuchsia/sdk.gni") -if (flutter_runtime_mode == "debug") { - executable("testing") { - output_name = "flutter_tester" +executable("testing") { + output_name = "flutter_tester" - public_configs = [ - "//flutter:config", - "//flutter:export_dynamic_symbols", - ] - - sources = [ "tester_main.cc" ] - if (is_win) { - libs = [ - "psapi.lib", - "user32.lib", - "FontSub.lib", - "shlwapi.lib", - ] - } + public_configs = [ + "//flutter:config", + "//flutter:export_dynamic_symbols", + ] - deps = [ - "//flutter/assets", - "//flutter/common", - "//flutter/flow", - "//flutter/fml", - "//flutter/fml/trace", - "//flutter/lib/snapshot", - "//flutter/shell/common", - "//flutter/shell/gpu:gpu_surface_software", - "//third_party/dart/runtime/bin:dart_io_api", - "//third_party/skia", + sources = [ "tester_main.cc" ] + if (is_win) { + libs = [ + "psapi.lib", + "user32.lib", + "FontSub.lib", + "shlwapi.lib", ] } -} else { - group("testing") { - # The Flutter Dart tester is only available in JIT runtime modes. - } + + deps = [ + "//flutter/assets", + "//flutter/common", + "//flutter/flow", + "//flutter/fml", + "//flutter/lib/snapshot", + "//flutter/shell/common", + "//flutter/shell/gpu:gpu_surface_software", + "//flutter/third_party/tonic", + "//third_party/dart/runtime:libdart_jit", + "//third_party/dart/runtime/bin:dart_io_api", + "//third_party/skia", + ] } diff --git a/testing/BUILD.gn b/testing/BUILD.gn index 9baabc6459709..47c5c36b463a5 100644 --- a/testing/BUILD.gn +++ b/testing/BUILD.gn @@ -37,10 +37,7 @@ source_set("testing") { "test_timeout_listener.h", ] - public_deps = [ - ":testing_lib", - "//flutter/runtime:libdart_flutter_policy", - ] + public_deps = [ ":testing_lib" ] } source_set("dart") { diff --git a/testing/run_tests.py b/testing/run_tests.py index b9588a64ab341..f37904cee616a 100755 --- a/testing/run_tests.py +++ b/testing/run_tests.py @@ -509,10 +509,7 @@ def main(): args = parser.parse_args() if args.type == 'all': - types = ['engine', 'benchmarks', 'java', 'objc', 'font-subset'] - if args.variant == 'host_debug' or args.variant == 'host_debug_unopt': - # flutter_tester can only be built in JIT mode. So Dart tests may only run in JIT runtime modes. - types.append('dart') + types = ['engine', 'dart', 'benchmarks', 'java', 'objc', 'font-subset'] else: types = args.type.split(',') @@ -526,7 +523,6 @@ def main(): if 'dart' in types: assert not IsWindows(), "Dart tests can't be run on windows. https://github.com/flutter/flutter/issues/36301." - assert args.variant == 'host_debug' or args.variant == 'host_debug_unopt', "Dart tests can only be run in Debug runtime modes." dart_filter = args.dart_filter.split(',') if args.dart_filter else None RunDartTests(build_dir, dart_filter, args.verbose_dart_snapshot) RunConstFinderTests(build_dir) diff --git a/third_party/txt/BUILD.gn b/third_party/txt/BUILD.gn index ad0298ac3ceea..0f0496e756c57 100644 --- a/third_party/txt/BUILD.gn +++ b/third_party/txt/BUILD.gn @@ -185,7 +185,7 @@ source_set("txt") { if (enable_unittests) { txt_common_executable_deps = [ "//flutter/fml", # For ICU initialization. - "//flutter/fml/trace", + "//third_party/dart/runtime:libdart_jit", # For logging. ] test_fixtures("txt_fixtures") {