tracing: Enable using Perfetto client library from Chromium

We are currently porting Chromium over to use the Perfetto client
library for tracing[1]. When this mode is enabled, V8 should also use
the Perfetto library built by Chromium instead of building an
indepedendent copy. This patch enables that behavior, gated by the
|use_perfetto_client_library| flag set by Chromium.

We also roll Perfetto to the latest version, add a couple of missing
dependencies on v8_tracing and add a missing tracing category group.

[1] https://docs.google.com/document/d/1f7tt4cb-JcA5bQFR1oXk60ncJPpkL02_Hi_Bc6MfTQk/

(Internal) Bug: 155075662

Change-Id: I76d9626b1c83cb7a278dc3281b3a1db653ab8733
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2182637
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Tamer Tas <tmrts@chromium.org>
Commit-Queue: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67706}
This commit is contained in:
Sami Kyostila 2020-05-05 18:13:11 +01:00 committed by Commit Bot
parent 0a69768a4e
commit 0056effb20
5 changed files with 21 additions and 3 deletions

View File

@ -1606,7 +1606,10 @@ v8_source_set("v8_initializers") {
"test/cctest:*",
]
deps = [ ":torque_generated_initializers" ]
deps = [
":torque_generated_initializers",
":v8_tracing",
]
sources = [
### gcmole(all) ###
@ -1735,7 +1738,10 @@ v8_source_set("v8_initializers") {
v8_source_set("v8_init") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
deps = [ ":v8_initializers" ]
deps = [
":v8_initializers",
":v8_tracing",
]
sources = [
### gcmole(all) ###
@ -4232,6 +4238,7 @@ if (current_toolchain == v8_snapshot_toolchain) {
":v8_libbase",
":v8_libplatform",
":v8_maybe_icu",
":v8_tracing",
"//build/win:default_exe_manifest",
]
}

2
DEPS
View File

@ -266,7 +266,7 @@ deps = {
'dep_type': 'cipd',
},
'v8/third_party/perfetto':
Var('android_url') + '/platform/external/perfetto.git' + '@' + '9bd480acdcad450c5ed5d2aa329eb603c53e5f40',
Var('android_url') + '/platform/external/perfetto.git' + '@' + 'ff70e0d273ed10995866c803f23e11250eb3dc52',
'v8/third_party/protobuf':
Var('chromium_url') + '/external/github.com/google/protobuf'+ '@' + 'b68a347f56137b4b1a746e8c7438495a6ac1bd91',
'v8/third_party/zlib':

View File

@ -20,6 +20,10 @@ perfetto_protobuf_gni = "//gni/proto_library.gni"
# format.
enable_perfetto_trace_processor = true
# When building with chromium, determines whether we want to also use the
# perfetto library from chromium instead declaring our own.
use_perfetto_client_library = false
# Uncomment these to specify a different NDK location and version in
# non-Chromium builds.
# default_android_ndk_root = "//third_party/android_ndk"

View File

@ -81,6 +81,12 @@ if (v8_enable_backtrace == "") {
v8_enable_backtrace = is_debug && !v8_optimized_debug
}
# If chromium is configured to use the perfetto client library, v8 should also
# use perfetto for tracing.
if (build_with_chromium && use_perfetto_client_library) {
v8_use_perfetto = true
}
# Points to // in v8 stand-alone or to //v8/ in chromium. We need absolute
# paths for all configs in templates as they are shared in different
# subdirectories.

View File

@ -47,6 +47,7 @@ PERFETTO_DEFINE_CATEGORIES(
perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.runtime_stats_sampling")),
perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.turbofan")),
perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.wasm")),
perfetto::Category::Group("v8,devtools.timeline"),
perfetto::Category::Group(TRACE_DISABLED_BY_DEFAULT("v8.turbofan") ","
TRACE_DISABLED_BY_DEFAULT("v8.wasm")),
perfetto::Category::Group(TRACE_DISABLED_BY_DEFAULT("v8.gc")