mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 01:45:06 +00:00
2e01df50e9
This reverts commit 7424295ce9
.
Reason for revert: Causes VM crash in internal tests - b/271081079
Original change's description:
> [VM] Begin supporting Perfetto file recorder
>
> This CL adds the `TimelineEventPerfettoFileRecorder` class, which is a
> timeline recorder that writes a trace to file in Perfetto's proto
> format. This CL supports the recording of all types of timeline events
> except flow events. Support for flow events will be added in a future
> CL.
>
> TEST=Recorded traces with the Perfetto file recorder and explored them
> in Perfetto's trace viewer, CI
>
> Change-Id: Iaa2051e536589a473c5e15f9de9bb9c251f13d38
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278942
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>
Change-Id: I1c4b0b78be3748b525b82ea66079dd95d412d82e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285906
Auto-Submit: Oleh Prypin <oprypin@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
255 lines
7.9 KiB
Plaintext
255 lines
7.9 KiB
Plaintext
# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
|
# for details. All rights reserved. Use of this source code is governed by a
|
|
# BSD-style license that can be found in the LICENSE file.
|
|
|
|
import("../../build/executable_suffix.gni")
|
|
import("../../sdk/lib/async/async_sources.gni")
|
|
import("../../sdk/lib/collection/collection_sources.gni")
|
|
import("../../sdk/lib/convert/convert_sources.gni")
|
|
import("../../sdk/lib/core/core_sources.gni")
|
|
import("../../sdk/lib/developer/developer_sources.gni")
|
|
import("../../sdk/lib/ffi/ffi_sources.gni")
|
|
import("../../sdk/lib/internal/internal_sources.gni")
|
|
import("../../sdk/lib/isolate/isolate_sources.gni")
|
|
import("../../sdk/lib/math/math_sources.gni")
|
|
import("../../sdk/lib/mirrors/mirrors_sources.gni")
|
|
import("../../sdk/lib/typed_data/typed_data_sources.gni")
|
|
import("../../sdk/lib/vmservice/vmservice_sources.gni")
|
|
import("../../sdk_args.gni")
|
|
import("../../utils/compile_platform.gni")
|
|
import("../bin/cli_sources.gni")
|
|
import("../bin/io_sources.gni")
|
|
import("../configs.gni")
|
|
import("../lib/async_sources.gni")
|
|
import("../lib/convert_sources.gni")
|
|
import("../lib/core_sources.gni")
|
|
import("../lib/developer_sources.gni")
|
|
import("../lib/ffi_sources.gni")
|
|
import("../lib/isolate_sources.gni")
|
|
import("../lib/math_sources.gni")
|
|
import("../lib/mirrors_sources.gni")
|
|
import("../lib/profiler_sources.gni")
|
|
import("../lib/typed_data_sources.gni")
|
|
import("../lib/vmservice_sources.gni")
|
|
import("../runtime_args.gni")
|
|
import("compiler/compiler_sources.gni")
|
|
import("ffi/ffi_sources.gni")
|
|
import("heap/heap_sources.gni")
|
|
import("vm_sources.gni")
|
|
|
|
if (is_fuchsia) {
|
|
import("//build/fuchsia/sdk.gni")
|
|
}
|
|
|
|
config("libdart_vm_config") {
|
|
if (is_fuchsia) {
|
|
libs = [ "zircon" ]
|
|
} else if (is_win) {
|
|
libs = [
|
|
"advapi32.lib",
|
|
"shell32.lib",
|
|
]
|
|
if (target_os != "winuwp") {
|
|
libs += [ "dbghelp.lib" ]
|
|
}
|
|
} else {
|
|
libs = [ "dl" ]
|
|
if (!is_android) {
|
|
libs += [ "pthread" ]
|
|
}
|
|
|
|
# Clang with libc++ does not require an explicit atomic library reference.
|
|
# (similar to https://github.com/flutter/buildroot/blob/master/build/config/compiler/BUILD.gn#L562)
|
|
if (!is_clang) {
|
|
libs += [ "atomic" ]
|
|
}
|
|
}
|
|
}
|
|
|
|
library_for_all_configs("libdart_vm") {
|
|
target_type = "source_set"
|
|
extra_product_deps = [
|
|
"//third_party/icu:icui18n_hidden_visibility",
|
|
"//third_party/icu:icuuc_hidden_visibility",
|
|
]
|
|
extra_nonproduct_deps = [
|
|
"//third_party/icu:icui18n",
|
|
"//third_party/icu:icuuc",
|
|
]
|
|
if (is_fuchsia) {
|
|
if (using_fuchsia_gn_sdk) {
|
|
extra_deps = [
|
|
"$fuchsia_sdk_root/fidl/fuchsia.intl",
|
|
"$fuchsia_sdk_root/pkg/async",
|
|
"$fuchsia_sdk_root/pkg/async-default",
|
|
"$fuchsia_sdk_root/pkg/async-loop",
|
|
"$fuchsia_sdk_root/pkg/async-loop-default",
|
|
"$fuchsia_sdk_root/pkg/inspect",
|
|
"$fuchsia_sdk_root/pkg/inspect_service_cpp",
|
|
"$fuchsia_sdk_root/pkg/sys_cpp",
|
|
"$fuchsia_sdk_root/pkg/sys_inspect_cpp",
|
|
"$fuchsia_sdk_root/pkg/trace-engine",
|
|
]
|
|
} else if (using_fuchsia_sdk) {
|
|
extra_deps = [
|
|
"$fuchsia_sdk_root/fidl:fuchsia.intl",
|
|
"$fuchsia_sdk_root/pkg:async-loop",
|
|
"$fuchsia_sdk_root/pkg:async-loop-default",
|
|
"$fuchsia_sdk_root/pkg:inspect",
|
|
"$fuchsia_sdk_root/pkg:inspect_service_cpp",
|
|
"$fuchsia_sdk_root/pkg:sys_cpp",
|
|
"$fuchsia_sdk_root/pkg:sys_inspect_cpp",
|
|
"$fuchsia_sdk_root/pkg:trace-engine",
|
|
]
|
|
} else {
|
|
extra_deps = [
|
|
"//sdk/fidl/fuchsia.intl",
|
|
"//sdk/lib/sys/cpp",
|
|
"//sdk/lib/sys/inspect/cpp",
|
|
"//zircon/public/lib/fbl",
|
|
"//zircon/system/ulib/trace-engine",
|
|
]
|
|
}
|
|
}
|
|
public_configs = [ ":libdart_vm_config" ]
|
|
sources = vm_sources + rebase_path(compiler_api_sources, ".", "./compiler/") +
|
|
rebase_path(disassembler_sources, ".", "./compiler/") +
|
|
rebase_path(ffi_sources, ".", "./ffi/") +
|
|
rebase_path(heap_sources, ".", "./heap/")
|
|
if (is_android) {
|
|
# Android specific workaround for a kernel bug. This source file can't
|
|
# go into vm_sources list because it will break Windows build which
|
|
# uses different assembler syntax.
|
|
sources += [ "thread_interrupter_android_arm.S" ]
|
|
}
|
|
include_dirs = [ ".." ]
|
|
}
|
|
|
|
library_for_all_configs_with_compiler("libdart_compiler") {
|
|
target_type = "source_set"
|
|
public_configs = [ ":libdart_vm_config" ]
|
|
sources = rebase_path(compiler_sources, ".", "./compiler/")
|
|
include_dirs = [ ".." ]
|
|
if (is_fuchsia) {
|
|
if (using_fuchsia_gn_sdk) {
|
|
extra_deps = [ "$fuchsia_sdk_root/pkg/trace-engine" ]
|
|
} else if (using_fuchsia_sdk) {
|
|
extra_deps = [ "$fuchsia_sdk_root/pkg:trace-engine" ]
|
|
} else {
|
|
extra_deps = [
|
|
"//zircon/public/lib/fbl",
|
|
"//zircon/system/ulib/trace-engine",
|
|
]
|
|
}
|
|
}
|
|
}
|
|
|
|
library_for_all_configs("libdart_lib") {
|
|
target_type = "source_set"
|
|
if (is_fuchsia) {
|
|
if (using_fuchsia_gn_sdk) {
|
|
extra_deps = [ "$fuchsia_sdk_root/pkg/trace-engine" ]
|
|
} else if (using_fuchsia_sdk) {
|
|
extra_deps = [ "$fuchsia_sdk_root/pkg:trace-engine" ]
|
|
} else {
|
|
extra_deps = [
|
|
"//zircon/public/lib/fbl",
|
|
"//zircon/system/ulib/trace-engine",
|
|
]
|
|
}
|
|
}
|
|
include_dirs = [ ".." ]
|
|
allsources = async_runtime_cc_files + core_runtime_cc_files +
|
|
developer_runtime_cc_files + isolate_runtime_cc_files +
|
|
math_runtime_cc_files + mirrors_runtime_cc_files +
|
|
typed_data_runtime_cc_files + vmservice_runtime_cc_files +
|
|
ffi_runtime_cc_files
|
|
sources = [ "bootstrap.cc" ] + rebase_path(allsources, ".", "../lib")
|
|
snapshot_sources = []
|
|
}
|
|
|
|
template("gen_vm_platform") {
|
|
assert(defined(invoker.output_postfix),
|
|
"Must define output postfix (e.g., '_strong'")
|
|
is_product_flag = dart_runtime_mode == "release"
|
|
if (defined(invoker.product_mode)) {
|
|
is_product_flag = invoker.product_mode
|
|
}
|
|
compile_platform(target_name) {
|
|
output_postfix = invoker.output_postfix
|
|
if (defined(invoker.add_implicit_vm_platform_dependency)) {
|
|
add_implicit_vm_platform_dependency =
|
|
invoker.add_implicit_vm_platform_dependency
|
|
}
|
|
single_root_scheme = "org-dartlang-sdk"
|
|
single_root_base = rebase_path("../../")
|
|
libraries_specification_uri = "org-dartlang-sdk:///sdk/lib/libraries.json"
|
|
outputs = [
|
|
"$root_out_dir/vm_platform" + output_postfix + ".dill",
|
|
"$root_out_dir/vm_outline" + output_postfix + ".dill",
|
|
]
|
|
args = [ "dart:core" ]
|
|
args += [
|
|
"-Ddart.vm.product=$is_product_flag",
|
|
"-Ddart.isVM=true",
|
|
"--nnbd-agnostic",
|
|
]
|
|
if (defined(invoker.exclude_source) && invoker.exclude_source) {
|
|
args += [ "--exclude-source" ]
|
|
}
|
|
outline = "vm_outline" + output_postfix + ".dill"
|
|
}
|
|
}
|
|
|
|
gen_vm_platform("vm_platform") {
|
|
add_implicit_vm_platform_dependency = false
|
|
exclude_source = false
|
|
output_postfix = "_strong"
|
|
}
|
|
|
|
gen_vm_platform("vm_platform_product") {
|
|
add_implicit_vm_platform_dependency = false
|
|
exclude_source = false
|
|
output_postfix = "_strong_product"
|
|
|
|
# In Debug mode we use debug binaries for dart2native.
|
|
# (see also the "dart_product_config" config)
|
|
product_mode = !is_debug
|
|
}
|
|
|
|
gen_vm_platform("vm_platform_stripped") {
|
|
add_implicit_vm_platform_dependency = false
|
|
exclude_source = true
|
|
output_postfix = "_strong_stripped"
|
|
}
|
|
|
|
group("kernel_platform_files") {
|
|
public_deps = [
|
|
":vm_platform",
|
|
":vm_platform_stripped",
|
|
]
|
|
}
|
|
|
|
executable("offsets_extractor") {
|
|
configs += [
|
|
"..:dart_arch_config",
|
|
"..:dart_config",
|
|
"..:dart_maybe_product_config",
|
|
":libdart_vm_config",
|
|
]
|
|
sources = [ "compiler/offsets_extractor.cc" ]
|
|
include_dirs = [ ".." ]
|
|
}
|
|
|
|
executable("offsets_extractor_precompiled_runtime") {
|
|
configs += [
|
|
"..:dart_arch_config",
|
|
"..:dart_config",
|
|
"..:dart_precompiled_runtime_config",
|
|
"..:dart_maybe_product_config",
|
|
":libdart_vm_config",
|
|
]
|
|
sources = [ "compiler/offsets_extractor.cc" ]
|
|
include_dirs = [ ".." ]
|
|
}
|