Skip to content

Commit

Permalink
Reland "[tracing] Remove base/trace_event/common dependency"
Browse files Browse the repository at this point in the history
This reland additionally removes `base` from
`generate-header-include-checks.py`, as the root directory got
removed. See https://crrev.com/c/5529240/1..3.

Original change's description:
> Revert "[tracing] Remove `base/trace_event/common` dependency"
>
> This reverts commit 993b79e.
>
> Reason for revert:
> https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20-%20debug%20-%20header%20includes%20-%20builder/15361/overview
>
> And this, but not consistent it seems. Maybe an incremental
> build problem:
> https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux%20-%20builder/73951/overview
>
> Original change's description:
> > [tracing] Remove `base/trace_event/common` dependency
> >
> > Currently, V8 depends on base/trace_event/common which includes a single
> > file being shared. It contains two tracing macro implementations: one
> > which is based on perfetto, and a second legacy one.
> >
> > V8 is the only client of the legacy version, which got removed in
> > https://crrev.com/c/5505657 and causes a failure of our roll (e.g.
> > https://crrev.com/c/5512234).
> >
> > This change moves the legacy code into V8, removes the obsolete
> > dependency, and refactors the build configurations.
> >
> > Bug: 338608342
> > Change-Id: I9254592b5c581d64807fe25c92ac931356569453
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5522493
> > Commit-Queue: Alexander Schulze <alexschulze@chromium.org>
> > Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> > Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#93823}
>
> Bug: 338608342
> Change-Id: Iefbd2c7e9a8c0af0f437a60faa345db72879d50d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5529239
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Alexander Schulze <alexschulze@chromium.org>
> Owners-Override: Michael Achenbach <machenbach@chromium.org>
> Auto-Submit: Michael Achenbach <machenbach@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#93825}

Bug: 338608342
Change-Id: I90b8def2f3bf0142b3bc545b95cb3ebb689ec46c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5529240
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Alexander Schulze <alexschulze@chromium.org>
Cr-Commit-Position: refs/heads/main@{#93832}
  • Loading branch information
alexanderschulze authored and V8 LUCI CQ committed May 10, 2024
1 parent 850eb54 commit f8fa220
Show file tree
Hide file tree
Showing 16 changed files with 887 additions and 39 deletions.
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2408,6 +2408,7 @@ filegroup(
"src/torque/runtime-macro-shims.h",
"src/tracing/trace-event.cc",
"src/tracing/trace-event.h",
"src/tracing/trace-event-no-perfetto.h",
"src/tracing/traced-value.cc",
"src/tracing/traced-value.h",
"src/tracing/tracing-category-observer.cc",
Expand Down Expand Up @@ -4198,7 +4199,6 @@ v8_library(
deps = [
":lib_fp16",
":v8_libbase",
"//external:base_trace_event_common",
"//external:absl_btree",
"//external:absl_flat_hash_map",
"//external:absl_flat_hash_set",
Expand Down
10 changes: 5 additions & 5 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -3202,7 +3202,6 @@ v8_header_set("v8_internal_headers") {
sources = [
### gcmole(all) ###
"$target_gen_dir/builtins-generated/bytecodes-builtins-list.h",
"//base/trace_event/common/trace_event_common.h",
"include/cppgc/common.h",
"include/v8-inspector-protocol.h",
"include/v8-inspector.h",
Expand Down Expand Up @@ -4145,6 +4144,7 @@ v8_header_set("v8_internal_headers") {
"src/third_party/utf8-decoder/utf8-decoder.h",
"src/torque/runtime-macro-shims.h",
"src/tracing/trace-event.h",
"src/tracing/trace-event-no-perfetto.h",
"src/tracing/traced-value.h",
"src/tracing/tracing-category-observer.h",
"src/utils/address-map.h",
Expand Down Expand Up @@ -4186,7 +4186,7 @@ v8_header_set("v8_internal_headers") {
}

if (v8_use_perfetto) {
sources -= [ "//base/trace_event/common/trace_event_common.h" ]
sources -= [ "src/tracing/trace-event-no-perfetto.h" ]
sources += [
"src/tracing/code-data-source.h",
"src/tracing/code-trace-context.h",
Expand Down Expand Up @@ -6639,7 +6639,6 @@ if (v8_use_libm_trig_functions) {

v8_component("v8_libplatform") {
sources = [
"//base/trace_event/common/trace_event_common.h",
"include/libplatform/libplatform-export.h",
"include/libplatform/libplatform.h",
"include/libplatform/v8-tracing.h",
Expand All @@ -6666,6 +6665,7 @@ v8_component("v8_libplatform") {
"src/libplatform/tracing/tracing-controller.cc",
"src/libplatform/worker-thread.cc",
"src/libplatform/worker-thread.h",
"src/tracing/trace-event-no-perfetto.h",
]

configs = [ ":internal_config_base" ]
Expand All @@ -6686,12 +6686,12 @@ v8_component("v8_libplatform") {

if (v8_use_perfetto) {
sources -= [
"//base/trace_event/common/trace_event_common.h",
"src/libplatform/tracing/trace-buffer.cc",
"src/libplatform/tracing/trace-buffer.h",
"src/libplatform/tracing/trace-object.cc",
"src/libplatform/tracing/trace-writer.cc",
"src/libplatform/tracing/trace-writer.h",
"src/tracing/trace-event-no-perfetto.h",
]
sources += [ "src/libplatform/tracing/trace-event-listener.h" ]
}
Expand Down Expand Up @@ -7014,7 +7014,7 @@ v8_source_set("cppgc_base") {
]

if (cppgc_is_standalone && !v8_use_perfetto) {
sources += [ "//base/trace_event/common/trace_event_common.h" ]
sources += [ "src/tracing/trace-event-no-perfetto.h" ]
} else {
public_deps += [ ":v8_tracing" ]
}
Expand Down
2 changes: 0 additions & 2 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ vars = {
}

deps = {
'base/trace_event/common':
Var('chromium_url') + '/chromium/src/base/trace_event/common.git' + '@' + '29ac73db520575590c3aceb0a6f1f58dda8934f6',
'build':
Var('chromium_url') + '/chromium/src/build.git' + '@' + '7796c50af5b192c01d7c92f930de2093a8507097',
'buildtools':
Expand Down
11 changes: 0 additions & 11 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,6 @@ bind(
actual = "@com_googlesource_chromium_icu//:icu",
)

new_local_repository(
name = "com_googlesource_chromium_base_trace_event_common",
build_file = "//:bazel/BUILD.trace_event_common",
path = "base/trace_event/common",
)

bind(
name = "base_trace_event_common",
actual = "@com_googlesource_chromium_base_trace_event_common//:trace_event_common",
)

http_archive(
name = "intel_ittapi",
add_prefix = "third_party/ittapi",
Expand Down
10 changes: 0 additions & 10 deletions bazel/BUILD.trace_event_common

This file was deleted.

2 changes: 1 addition & 1 deletion include/v8-platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ class TracingController {

/**
* Adds a trace event to the platform tracing system. These function calls are
* usually the result of a TRACE_* macro from trace_event_common.h when
* usually the result of a TRACE_* macro from trace-event-no-perfetto.h when
* tracing and the category of the particular trace are enabled. It is not
* advisable to call these functions on their own; they are really only meant
* to be used by the trace macros. The returned handle can be used by
Expand Down
2 changes: 1 addition & 1 deletion src/DEPS
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include_rules = [
"+base/trace_event/common/trace_event_common.h",
"+src",
"-src/asmjs",
"+src/asmjs/asm-js.h",
Expand Down Expand Up @@ -70,6 +69,7 @@ include_rules = [
"+src/regexp/regexp-flags.h",
"+src/regexp/regexp-stack.h",
"+src/regexp/regexp-utils.h",
"+src/tracing/trace-event-no-perfetto.h",
"-src/trap-handler",
"+src/trap-handler/handler-inside-posix.h",
"+src/trap-handler/handler-inside-win.h",
Expand Down
1 change: 1 addition & 0 deletions src/heap/cppgc/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ include_rules = [
"+src/heap/base",
"+src/heap/cppgc",
"+src/tracing/trace-event.h",
"+src/tracing/trace-event-no-perfetto.h",
]
4 changes: 2 additions & 2 deletions src/heap/cppgc/trace-event.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ using ConvertableToTraceFormat = v8::ConvertableToTraceFormat;
// This is a subset of stc/tracing/trace-event.h required to support
// tracing in the cppgc standalone library using TracingController.

#include "base/trace_event/common/trace_event_common.h"
#include "include/cppgc/platform.h"
#include "src/base/atomicops.h"
#include "src/base/macros.h"
#include "src/tracing/trace-event-no-perfetto.h"

// This header file defines implementation details of how the trace macros in
// trace_event_common.h collect and store trace events. Anything not
// trace-event-no-erfetto.h collect and store trace events. Anything not
// implementation-specific should go in trace_macros_common.h instead of here.

// The pointer returned from GetCategoryGroupEnabled() points to a
Expand Down
1 change: 1 addition & 0 deletions src/libplatform/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ include_rules = [
"-src",
"+src/base",
"+src/libplatform",
"+src/tracing/trace-event-no-perfetto.h",
]
2 changes: 1 addition & 1 deletion src/libplatform/tracing/trace-object.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/trace_event/common/trace_event_common.h"
#include "include/libplatform/v8-tracing.h"
#include "include/v8-platform.h"
#include "src/base/platform/platform.h"
#include "src/base/platform/time.h"
#include "src/tracing/trace-event-no-perfetto.h"

namespace v8 {
namespace platform {
Expand Down
2 changes: 1 addition & 1 deletion src/libplatform/tracing/trace-writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

#include <cmath>

#include "base/trace_event/common/trace_event_common.h"
#include "include/v8-platform.h"
#include "src/base/platform/platform.h"
#include "src/tracing/trace-event-no-perfetto.h"

#if defined(V8_ENABLE_SYSTEM_INSTRUMENTATION)
#include "src/libplatform/tracing/recorder.h"
Expand Down
Loading

0 comments on commit f8fa220

Please sign in to comment.