Roll Perfetto forward, adapting to proto_library changes
This patch rolls v8 to the latest Perfetto revision. Since Perfetto has changed the way the GN protobuf integration works, we need to make some corresponding changes in V8. Bug: chromium:639003 Change-Id: I263c591560503c9779bbab3ec266cfb2708fc51f Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2085175 Reviewed-by: Peter Marshall <petermarshall@chromium.org> Reviewed-by: Michael Achenbach <machenbach@chromium.org> Commit-Queue: Michael Achenbach <machenbach@chromium.org> Auto-Submit: Sami Kyöstilä <skyostil@chromium.org> Cr-Commit-Position: refs/heads/master@{#66583}
This commit is contained in:
parent
22afaacd47
commit
e4b5dfed0d
15
BUILD.gn
15
BUILD.gn
@ -308,6 +308,7 @@ config("internal_config") {
|
||||
"//build/config/compiler:wexit_time_destructors",
|
||||
":internal_config_base",
|
||||
":v8_header_features",
|
||||
":v8_tracing_config",
|
||||
]
|
||||
|
||||
if (is_component_build) {
|
||||
@ -315,6 +316,17 @@ config("internal_config") {
|
||||
}
|
||||
}
|
||||
|
||||
# Should be applied to all targets that write trace events.
|
||||
config("v8_tracing_config") {
|
||||
if (v8_use_perfetto) {
|
||||
include_dirs = [
|
||||
"third_party/perfetto/include",
|
||||
"$root_gen_dir/third_party/perfetto",
|
||||
"$root_gen_dir/third_party/perfetto/build_config",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
# This config should be applied to code using the libplatform.
|
||||
config("libplatform_config") {
|
||||
include_dirs = [ "include" ]
|
||||
@ -4275,6 +4287,7 @@ v8_executable("d8") {
|
||||
# the :external_config applied to it by virtue of depending on :v8, and
|
||||
# you can't have both applied to the same target.
|
||||
":internal_config_base",
|
||||
":v8_tracing_config",
|
||||
]
|
||||
|
||||
deps = [
|
||||
@ -4301,7 +4314,7 @@ v8_executable("d8") {
|
||||
}
|
||||
|
||||
if (v8_use_perfetto) {
|
||||
deps += [ "//third_party/perfetto/include/perfetto/tracing" ]
|
||||
deps += [ "//third_party/perfetto/src/tracing:in_process_backend" ]
|
||||
}
|
||||
}
|
||||
|
||||
|
2
DEPS
2
DEPS
@ -266,7 +266,7 @@ deps = {
|
||||
'dep_type': 'cipd',
|
||||
},
|
||||
'v8/third_party/perfetto':
|
||||
Var('android_url') + '/platform/external/perfetto.git' + '@' + '12dc10e0278cded35205cf84f80a821348cb6c56',
|
||||
Var('android_url') + '/platform/external/perfetto.git' + '@' + 'b9b24d1b0b80aafec393af085067e9eae829412f',
|
||||
'v8/third_party/protobuf':
|
||||
Var('chromium_url') + '/external/github.com/google/protobuf'+ '@' + 'b68a347f56137b4b1a746e8c7438495a6ac1bd91',
|
||||
'v8/third_party/zlib':
|
||||
|
@ -124,9 +124,13 @@ template("proto_library") {
|
||||
rebase_path(proto_in_dir, root_build_dir),
|
||||
]
|
||||
if (generate_cc) {
|
||||
cc_generator_options_ = ""
|
||||
if (defined(invoker.cc_generator_options)) {
|
||||
cc_generator_options_ = invoker.cc_generator_options
|
||||
}
|
||||
args += [
|
||||
"--cpp_out",
|
||||
rel_cc_out_dir,
|
||||
cc_generator_options_ + rel_cc_out_dir,
|
||||
]
|
||||
}
|
||||
if (generate_descriptor != "") {
|
||||
@ -153,13 +157,9 @@ template("proto_library") {
|
||||
|
||||
args += rebase_path(proto_sources, root_build_dir)
|
||||
|
||||
inputs = [
|
||||
protoc_path,
|
||||
]
|
||||
inputs = [ protoc_path ]
|
||||
|
||||
deps = [
|
||||
protoc_label,
|
||||
]
|
||||
deps = [ protoc_label ]
|
||||
if (generate_with_plugin) {
|
||||
inputs += [ plugin_path ]
|
||||
if (defined(plugin_host_label)) {
|
||||
@ -201,21 +201,23 @@ template("proto_library") {
|
||||
public_configs = []
|
||||
}
|
||||
|
||||
public_configs += [
|
||||
"//:protobuf_gen_config",
|
||||
":$config_name",
|
||||
]
|
||||
public_configs += [ "//:protobuf_gen_config" ]
|
||||
|
||||
propagate_imports_configs = !defined(invoker.propagate_imports_configs) ||
|
||||
invoker.propagate_imports_configs
|
||||
if (propagate_imports_configs) {
|
||||
public_configs += [ ":$config_name" ]
|
||||
} else {
|
||||
# Embedder handles include directory propagation to dependents.
|
||||
configs += [ ":$config_name" ]
|
||||
}
|
||||
|
||||
# Use protobuf_full only for tests.
|
||||
if (defined(invoker.use_protobuf_full) &&
|
||||
invoker.use_protobuf_full == true) {
|
||||
deps = [
|
||||
"//:protobuf_full",
|
||||
]
|
||||
deps = [ "//:protobuf_full" ]
|
||||
} else {
|
||||
deps = [
|
||||
"//:protobuf_lite",
|
||||
]
|
||||
deps = [ "//:protobuf_lite" ]
|
||||
}
|
||||
|
||||
deps += [ ":$action_name" ]
|
||||
|
@ -1,4 +1,5 @@
|
||||
include_rules = [
|
||||
"+libplatform",
|
||||
"+perfetto",
|
||||
"+protos/perfetto",
|
||||
]
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include <ostream>
|
||||
|
||||
#include "libplatform/libplatform-export.h"
|
||||
#include "src/libplatform/tracing/trace-event-listener.h"
|
||||
|
||||
namespace perfetto {
|
||||
@ -21,7 +22,8 @@ namespace tracing {
|
||||
|
||||
// A listener that converts the proto trace data to JSON and writes it to a
|
||||
// file.
|
||||
class JSONTraceEventListener final : public TraceEventListener {
|
||||
class V8_PLATFORM_EXPORT JSONTraceEventListener final
|
||||
: public TraceEventListener {
|
||||
public:
|
||||
explicit JSONTraceEventListener(std::ostream* stream);
|
||||
~JSONTraceEventListener() override;
|
||||
|
@ -7,6 +7,8 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "libplatform/libplatform-export.h"
|
||||
|
||||
namespace perfetto {
|
||||
namespace protos {
|
||||
class TracePacket;
|
||||
@ -22,7 +24,7 @@ namespace tracing {
|
||||
// the PerfettoConsumer class has to perform. Clients override ProcessPacket()
|
||||
// to respond to trace events, e.g. to write them to a file as JSON or for
|
||||
// testing purposes.
|
||||
class TraceEventListener {
|
||||
class V8_PLATFORM_EXPORT TraceEventListener {
|
||||
public:
|
||||
virtual ~TraceEventListener() = default;
|
||||
virtual void ProcessPacket(const ::perfetto::protos::TracePacket& packet) = 0;
|
||||
|
@ -29,15 +29,12 @@ v8_executable("cctest") {
|
||||
configs = [
|
||||
"../..:external_config",
|
||||
"../..:internal_config_base",
|
||||
"../..:v8_tracing_config",
|
||||
":cctest_config",
|
||||
]
|
||||
|
||||
ldflags = []
|
||||
|
||||
if (v8_use_perfetto) {
|
||||
deps += [ "//third_party/perfetto/include/perfetto/tracing" ]
|
||||
}
|
||||
|
||||
# TODO(machenbach): Translate from gyp.
|
||||
#["OS=="aix"", {
|
||||
# "ldflags": [ "-Wl,-bbigtoc" ],
|
||||
@ -378,6 +375,7 @@ v8_source_set("cctest_sources") {
|
||||
configs = [
|
||||
"../..:external_config",
|
||||
"../..:internal_config_base",
|
||||
"../..:v8_tracing_config",
|
||||
]
|
||||
|
||||
public_deps = [
|
||||
@ -434,6 +432,7 @@ v8_source_set("cctest_sources") {
|
||||
"//third_party/perfetto/include/perfetto/tracing",
|
||||
"//third_party/perfetto/protos/perfetto/trace/chrome:lite",
|
||||
"//third_party/perfetto/protos/perfetto/trace/chrome:zero",
|
||||
"//third_party/perfetto/src/tracing:in_process_backend",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user