build: perfetto-sdk · nodejs/node@df608e0 · GitHub
Skip to content

Commit df608e0

Browse files
legendecasaduh95
authored andcommitted
build: perfetto-sdk
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net> PR-URL: #64565 Refs: nodejs/diagnostics#654 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ryuhei Shima <shimaryuhei@gmail.com>
1 parent 8eeae28 commit df608e0

5 files changed

Lines changed: 81 additions & 6 deletions

File tree

common.gypi

Lines changed: 1 addition & 1 deletion

configure.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,12 @@
11171117
default=None,
11181118
help='disable the V8 inspector protocol')
11191119

1120+
parser.add_argument('--with-perfetto',
1121+
action='store_true',
1122+
dest='with_perfetto',
1123+
default=None,
1124+
help='enable perfetto support')
1125+
11201126
parser.add_argument('--shared',
11211127
action='store_true',
11221128
dest='shared',
@@ -2217,6 +2223,7 @@ def configure_v8(o, configs):
22172223
options.v8_disable_temporal_support = True
22182224
o['variables']['v8_enable_temporal_support'] = 0 if options.v8_disable_temporal_support else 1
22192225
o['variables']['v8_trace_maps'] = 1 if options.trace_maps else 0
2226+
o['variables']['v8_use_perfetto'] = 1 if options.with_perfetto else 0
22202227
o['variables']['node_use_v8_platform'] = b(not options.without_v8_platform)
22212228
o['variables']['node_use_bundled_v8'] = b(not options.without_bundled_v8)
22222229
o['variables']['force_dynamic_crt'] = 1 if options.shared else 0

node.gyp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,14 @@
14431443
}, {
14441444
'sources!': [ '<@(node_cctest_quic_sources)' ],
14451445
}],
1446+
[ 'v8_use_perfetto==1', {
1447+
'defines': [
1448+
'PERFETTO_ENABLE_LEGACY_TRACE_EVENTS=1'
1449+
],
1450+
'dependencies': [
1451+
'deps/perfetto/perfetto.gyp:perfetto_sdk',
1452+
],
1453+
}],
14461454
['v8_enable_inspector==1', {
14471455
'defines': [
14481456
'HAVE_INSPECTOR=1',
@@ -1764,6 +1772,14 @@
17641772
'NODE_USE_NODE_CODE_CACHE=1',
17651773
],
17661774
}],
1775+
[ 'v8_use_perfetto==1', {
1776+
'defines': [
1777+
'PERFETTO_ENABLE_LEGACY_TRACE_EVENTS=1'
1778+
],
1779+
'dependencies': [
1780+
'deps/perfetto/perfetto.gyp:perfetto_sdk',
1781+
],
1782+
}],
17671783
['v8_enable_inspector==1', {
17681784
'defines': [
17691785
'HAVE_INSPECTOR=1',

tools/v8_gypfiles/features.gypi

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,7 @@
200200
# Enable seeded array index hash.
201201
'v8_enable_seeded_array_index_hash%': 1,
202202

203-
# Use Perfetto (https://perfetto.dev) as the default TracingController. Not
204-
# currently implemented.
203+
# Use Perfetto (https://perfetto.dev) as the default TracingController.
205204
'v8_use_perfetto%': 0,
206205

207206
# Enable map packing & unpacking (sets -dV8_MAP_PACKING).
@@ -463,7 +462,10 @@
463462
'defines': ['ENABLE_VERIFY_CSA',],
464463
}],
465464
['v8_use_perfetto==1', {
466-
'defines': ['V8_USE_PERFETTO',],
465+
'defines': [
466+
'V8_USE_PERFETTO',
467+
'V8_USE_PERFETTO_SDK',
468+
],
467469
}],
468470
['v8_enable_map_packing==1', {
469471
'defines': ['V8_MAP_PACKING',],

tools/v8_gypfiles/v8.gyp

Lines changed: 52 additions & 2 deletions

0 commit comments

Comments
 (0)