From 0d4200055b7fa77b14d57f40362a36952769d9d1 Mon Sep 17 00:00:00 2001 From: Mikhail Khokhlov Date: Wed, 1 Feb 2023 11:04:00 +0000 Subject: [PATCH] Reduce build size when building with Perfetto SDK Building Chromium with full Perfetto SDK included increases build time significantly. We can reduce this overhead by including only those parts that are required. See b/266913150 for context. Change-Id: I0cde5cb7df7b6151ec686e993488d8467c416fac Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4212390 Reviewed-by: Toon Verwaest Commit-Queue: Mikhail Khokhlov Cr-Commit-Position: refs/heads/main@{#85603} --- src/DEPS | 3 ++- src/d8/d8.cc | 3 ++- src/tracing/DEPS | 3 ++- src/tracing/trace-categories.h | 3 ++- test/unittests/libplatform/tracing-unittest.cc | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/DEPS b/src/DEPS index c30ccb1567..ebe2dd0dc5 100644 --- a/src/DEPS +++ b/src/DEPS @@ -86,7 +86,8 @@ specific_include_rules = { "d8\.cc": [ "+include/libplatform/libplatform.h", "+include/libplatform/v8-tracing.h", - "+perfetto/tracing.h" + "+perfetto/tracing/track_event.h", + "+perfetto/tracing/track_event_legacy.h" ], "d8-platforms\.cc": [ "+include/libplatform/libplatform.h", diff --git a/src/d8/d8.cc b/src/d8/d8.cc index 8f9d5dbaf9..598b985298 100644 --- a/src/d8/d8.cc +++ b/src/d8/d8.cc @@ -79,7 +79,8 @@ #endif // V8_FUZZILLI #ifdef V8_USE_PERFETTO -#include "perfetto/tracing.h" +#include "perfetto/tracing/track_event.h" +#include "perfetto/tracing/track_event_legacy.h" #endif // V8_USE_PERFETTO #ifdef V8_INTL_SUPPORT diff --git a/src/tracing/DEPS b/src/tracing/DEPS index fd3531bfcc..a189e1ee78 100644 --- a/src/tracing/DEPS +++ b/src/tracing/DEPS @@ -1,4 +1,5 @@ include_rules = [ - "+perfetto/tracing.h", + "+perfetto/tracing/track_event.h", + "+perfetto/tracing/track_event_legacy.h", "+protos/perfetto" ] diff --git a/src/tracing/trace-categories.h b/src/tracing/trace-categories.h index 0150963a88..01112b1887 100644 --- a/src/tracing/trace-categories.h +++ b/src/tracing/trace-categories.h @@ -19,7 +19,8 @@ // For now most of v8 uses legacy trace events. #define PERFETTO_ENABLE_LEGACY_TRACE_EVENTS 1 -#include "perfetto/tracing.h" +#include "perfetto/tracing/track_event.h" +#include "perfetto/tracing/track_event_legacy.h" // Trace category prefixes used in tests. PERFETTO_DEFINE_TEST_CATEGORY_PREFIXES("v8-cat", "cat", "v8.Test2"); diff --git a/test/unittests/libplatform/tracing-unittest.cc b/test/unittests/libplatform/tracing-unittest.cc index d6cf31cb2a..f90b811d0d 100644 --- a/test/unittests/libplatform/tracing-unittest.cc +++ b/test/unittests/libplatform/tracing-unittest.cc @@ -11,7 +11,8 @@ #include "testing/gtest/include/gtest/gtest.h" #ifdef V8_USE_PERFETTO -#include "perfetto/tracing.h" +#include "perfetto/tracing/track_event.h" +#include "perfetto/tracing/track_event_legacy.h" #include "protos/perfetto/trace/trace.pb.h" // nogncheck #include "src/libplatform/tracing/trace-event-listener.h" #include "src/tracing/traced-value.h"