build: perfetto-sdk

Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/64565
Refs: https://github.com/nodejs/diagnostics/issues/654
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ryuhei Shima <shimaryuhei@gmail.com>
This commit is contained in:
Chengzhong Wu authored and Node.js GitHub Bot committed 2026-07-24 14:00:16 +00:00
1 parent c558c8e81a
commit 6d173727e4
5 files changed
+81 -6

No files matched your search

+1 -1
View File
@@ -87,7 +87,7 @@
'v8_enable_external_code_space%': 0,
'v8_enable_sandbox%': 0,
'v8_enable_v8_checks%': 0,
'v8_use_perfetto': 0,
'v8_use_perfetto%': 0,
'tsan%': 0,
##### end V8 defaults #####
+7
View File
@@ -1123,6 +1123,12 @@ parser.add_argument('--without-inspector',
default=None,
help='disable the V8 inspector protocol')
parser.add_argument('--with-perfetto',
action='store_true',
dest='with_perfetto',
default=None,
help='enable perfetto support')
parser.add_argument('--shared',
action='store_true',
dest='shared',
@@ -2223,6 +2229,7 @@ def configure_v8(o, configs):
options.v8_disable_temporal_support = True
o['variables']['v8_enable_temporal_support'] = 0 if options.v8_disable_temporal_support else 1
o['variables']['v8_trace_maps'] = 1 if options.trace_maps else 0
o['variables']['v8_use_perfetto'] = 1 if options.with_perfetto else 0
o['variables']['node_use_v8_platform'] = b(not options.without_v8_platform)
o['variables']['node_use_bundled_v8'] = b(not options.without_bundled_v8)
o['variables']['force_dynamic_crt'] = 1 if options.shared else 0
+16
View File
@@ -1462,6 +1462,14 @@
}, {
'sources!': [ '<@(node_cctest_quic_sources)' ],
}],
[ 'v8_use_perfetto==1', {
'defines': [
'PERFETTO_ENABLE_LEGACY_TRACE_EVENTS=1'
],
'dependencies': [
'deps/perfetto/perfetto.gyp:perfetto_sdk',
],
}],
['v8_enable_inspector==1', {
'defines': [
'HAVE_INSPECTOR=1',
@@ -1783,6 +1791,14 @@
'NODE_USE_NODE_CODE_CACHE=1',
],
}],
[ 'v8_use_perfetto==1', {
'defines': [
'PERFETTO_ENABLE_LEGACY_TRACE_EVENTS=1'
],
'dependencies': [
'deps/perfetto/perfetto.gyp:perfetto_sdk',
],
}],
['v8_enable_inspector==1', {
'defines': [
'HAVE_INSPECTOR=1',
+5 -3
View File
@@ -200,8 +200,7 @@
# Enable seeded array index hash.
'v8_enable_seeded_array_index_hash%': 1,
# Use Perfetto (https://perfetto.dev) as the default TracingController. Not
# currently implemented.
# Use Perfetto (https://perfetto.dev) as the default TracingController.
'v8_use_perfetto%': 0,
# Enable map packing & unpacking (sets -dV8_MAP_PACKING).
@@ -463,7 +462,10 @@
'defines': ['ENABLE_VERIFY_CSA',],
}],
['v8_use_perfetto==1', {
'defines': ['V8_USE_PERFETTO',],
'defines': [
'V8_USE_PERFETTO',
'V8_USE_PERFETTO_SDK',
],
}],
['v8_enable_map_packing==1', {
'defines': ['V8_MAP_PACKING',],
+52 -2
View File
@@ -38,6 +38,7 @@
],
}],
],
'perfetto_gyp_file': '../../deps/perfetto/perfetto.gyp',
},
'includes': ['toolchain.gypi', 'features.gypi'],
'target_defaults': {
@@ -292,6 +293,13 @@
'sources': [
'<(V8_ROOT)/src/init/setup-isolate-full.cc',
],
'conditions': [
['v8_use_perfetto==1', {
'dependencies': [
'<(perfetto_gyp_file):perfetto_sdk',
],
}],
],
}, # v8_init
{
'target_name': 'v8_initializers',
@@ -312,6 +320,11 @@
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_initializers.*?sources = ")',
],
'conditions': [
['v8_use_perfetto==1', {
'dependencies': [
'<(perfetto_gyp_file):perfetto_sdk',
],
}],
['v8_enable_webassembly==1', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_initializers.*?v8_enable_webassembly.*?sources \\+= ")',
@@ -479,6 +492,11 @@
},
],
'conditions': [
['v8_use_perfetto==1', {
'dependencies': [
'<(perfetto_gyp_file):perfetto_sdk',
],
}],
['want_separate_host_toolset', {
'dependencies': [
'generate_bytecode_builtins_list',
@@ -678,6 +696,14 @@
}],
],
}],
['v8_use_perfetto==1', {
'sources!': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_use_perfetto.*?sources \\-= ")',
],
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_use_perfetto.*?sources \\+= ")',
],
}],
['v8_enable_webassembly==1', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_enable_webassembly.*?sources \\+= ")',
@@ -960,6 +986,11 @@
'abseil.gyp:abseil',
],
'conditions': [
['v8_use_perfetto==1', {
'dependencies': [
'<(perfetto_gyp_file):perfetto_sdk',
],
}],
['v8_enable_maglev==0', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?!v8_enable_maglev.*?sources \\+= ")',
@@ -1090,6 +1121,14 @@
'<@(inspector_all_sources)',
],
'conditions': [
['v8_use_perfetto==1', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_use_perfetto.*?sources \\+= ")',
],
'dependencies': [
'<(perfetto_gyp_file):perfetto_sdk',
],
}],
['v8_enable_snapshot_compression==1', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_enable_snapshot_compression.*?sources \\+= ")',
@@ -1707,8 +1746,7 @@
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_libplatform.*?v8_use_perfetto.*?sources += ")',
],
'dependencies': [
'<(V8_ROOT)/third_party/perfetto:libperfetto',
'<(V8_ROOT)/third_party/perfetto/protos/perfetto/trace:lite',
'<(perfetto_gyp_file):perfetto_sdk',
],
}],
['v8_enable_system_instrumentation==1 and is_win', {
@@ -1818,6 +1856,11 @@
},
},
'conditions': [
['v8_use_perfetto==1', {
'dependencies': [
'<(perfetto_gyp_file):perfetto_sdk',
],
}],
['want_separate_host_toolset', {
'toolsets': ['host'],
}],
@@ -2028,6 +2071,13 @@
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_source_set.\\"cppgc_base.*?sources = ")',
],
'conditions': [
['v8_use_perfetto==1', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_source_set.\\"cppgc_base.*?if .v8_use_perfetto.*?sources \\+= ")',
],
}],
],
},
}, # cppgc_base
{