Skip to content

Commit b24eda3

Browse files
committed
fixup! fixup! build: enable Perfetto by default
1 parent 6783927 commit b24eda3

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+
ifneq ($(V8_USE_PERFETTO),0)
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 != 0>
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',
@@ -3080,6 +3079,7 @@ def make_bin_override():
30803079
config = {
30813080
'BUILDTYPE': 'Debug' if options.debug else 'Release',
30823081
'NODE_TARGET_TYPE': variables['node_target_type'],
3082+
'V8_USE_PERFETTO': str(variables['v8_use_perfetto']),
30833083
}
30843084

30853085
# 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
@@ -149,8 +149,6 @@ pkgs.mkShell {
149149
)
150150
)
151151
);
152-
TRACE_PROCESSOR_SHELL_PATH =
153-
if withPerfetto then "${pkgs.perfetto.tools}/bin/trace_processor_shell" else "/dev/null";
154152
}
155153
// (
156154
let
@@ -179,6 +177,9 @@ pkgs.mkShell {
179177
// pkgs.lib.optionalAttrs (!withSQLite) {
180178
NOSQLITE = "1";
181179
}
180+
// pkgs.lib.optionalAttrs (withPerfetto) {
181+
TRACE_PROCESSOR_SHELL_PATH = "${pkgs.perfetto.tools}/bin/trace_processor_shell";
182+
}
182183
// pkgs.lib.optionalAttrs (pkcs11 != false && pkcs11 != null) (
183184
let
184185
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)