Skip to content

Commit adaf43f

Browse files
committed
fixup! fixup! build: enable Perfetto by default
1 parent 4c70154 commit adaf43f

4 files changed

Lines changed: 23 additions & 21 deletions

File tree

‎Makefile‎

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,23 @@ v8: ## Build deps/v8.
320320
export PATH="$(NO_BIN_OVERRIDE_PATH)" && \
321321
tools/make-v8.sh $(V8_ARCH).$(BUILDTYPE_LOWER) $(V8_BUILD_OPTIONS)
322322

323+
ifeq ($(V8_USE_PERFETTO),1)
324+
TRACE_PROCESSOR_SHELL_PATH ?= tools/perfetto/trace_processor_shell
325+
326+
# The downloaded copy has to match the vendored perfetto, so a version bump
327+
# re-downloads it. An overridden path is a build we do not manage and may not
328+
# be writable, so it gets no prerequisite and is left alone once it exists.
329+
ifeq ($(TRACE_PROCESSOR_SHELL_PATH),tools/perfetto/trace_processor_shell)
330+
TRACE_PROCESSOR_SHELL_DEPS = deps/perfetto/VERSION
331+
endif
332+
333+
$(TRACE_PROCESSOR_SHELL_PATH): $(TRACE_PROCESSOR_SHELL_DEPS)
334+
@tools/perfetto/get_trace_processor $@
335+
336+
endif # </V8_USE_PERFETTO == 1>
337+
323338
.PHONY: jstest
324-
## Run addon tests and JS tests.
325-
jstest: build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests build-ffi-tests $(TRACE_PROCESSOR_SHELL_PATH)
339+
jstest: build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests build-ffi-tests $(TRACE_PROCESSOR_SHELL_PATH) ## Run addon tests and JS tests.
326340
$(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) \
327341
$(TEST_CI_ARGS) \
328342
--skip-tests=$(CI_SKIP_TESTS) \
@@ -340,19 +354,6 @@ coverage-run-js: ## Run JavaScript tests with coverage.
340354
TEST_CI_ARGS="$(TEST_CI_ARGS) --type=coverage" $(MAKE) jstest
341355
$(MAKE) coverage-report-js
342356

343-
TRACE_PROCESSOR_SHELL_PATH ?= tools/perfetto/trace_processor_shell
344-
345-
# The downloaded copy has to match the vendored perfetto, so a version bump
346-
# re-downloads it. An overridden path is a build we do not manage and may not
347-
# be writable, so it gets no prerequisite and is left alone once it exists.
348-
ifeq ($(TRACE_PROCESSOR_SHELL_PATH),tools/perfetto/trace_processor_shell)
349-
TRACE_PROCESSOR_SHELL_DEPS = deps/perfetto/VERSION
350-
endif
351-
352-
# Set TRACE_PROCESSOR_SHELL_PATH=/dev/null to disable the download
353-
$(TRACE_PROCESSOR_SHELL_PATH): $(TRACE_PROCESSOR_SHELL_DEPS)
354-
@tools/perfetto/get_trace_processor $@
355-
356357
.PHONY: test
357358
# This does not run tests of third-party libraries inside deps.
358359
test: all ## Run default tests and build docs.

‎configure.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,7 @@
551551
action='store_true',
552552
dest='shared_perfetto',
553553
default=None,
554-
help='link to a shared perfetto SDK instead of the one in deps/perfetto '
555-
'(requires --with-perfetto)')
554+
help='link to a shared perfetto SDK instead of the one in deps/perfetto')
556555

557556
shared_optgroup.add_argument('--shared-perfetto-includes',
558557
action='store',
@@ -3067,6 +3066,7 @@ def make_bin_override():
30673066
config = {
30683067
'BUILDTYPE': 'Debug' if options.debug else 'Release',
30693068
'NODE_TARGET_TYPE': variables['node_target_type'],
3069+
'V8_USE_PERFETTO': str(variables['v8_use_perfetto']),
30703070
}
30713071

30723072
# Not needed for trivial case. Useless when it's a win32 path.

‎shell.nix‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ pkgs.mkShell {
144144
)
145145
)
146146
);
147-
TRACE_PROCESSOR_SHELL_PATH =
148-
if withPerfetto then "${pkgs.perfetto.tools}/bin/trace_processor_shell" else "/dev/null";
149147
}
150148
// (
151149
let
@@ -174,6 +172,9 @@ pkgs.mkShell {
174172
// pkgs.lib.optionalAttrs (!withSQLite) {
175173
NOSQLITE = "1";
176174
}
175+
// pkgs.lib.optionalAttrs (withPerfetto) {
176+
TRACE_PROCESSOR_SHELL_PATH = "${pkgs.perfetto.tools}/bin/trace_processor_shell";
177+
}
177178
// pkgs.lib.optionalAttrs (pkcs11 != false && pkcs11 != null) (
178179
let
179180
pkcs11' =

‎test/trace_events/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# `trace_events` Tests
22

3-
When the `node` binary is built with configure flag `--with-perfetto`,
3+
When the `node` binary is not built with configure flag `--without-perfetto`,
44
the tests in this folder depends on `tools/perfetto/trace_processor_shell`,
55
which is downloaded with `tools/perfetto/get_trace_processor` via
66
`make tools/perfetto/trace_processor_shell`, to convert Perfetto binary trace
77
files to JSON format. Set `TRACE_PROCESSOR_SHELL_PATH` to use an existing build
8-
of the tool instead of downloading a release.
8+
of the tool to disable downloading a release.
99

1010
Refer to <https://perfetto.dev/docs/reference/trace-processor-cli>
1111
for help of the `trace_processor_shell` CLI.

0 commit comments

Comments
 (0)