cli: allow --cpu-prof* in NODE_OPTIONS
Fixes: https://github.com/nodejs/node/issues/56944 PR-URL: https://github.com/nodejs/node/pull/57018 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This commit is contained in:
parent
1dc882d6a0
commit
15fec136e8
@ -3176,6 +3176,10 @@ one is included in the list below.
|
|||||||
* `--allow-wasi`
|
* `--allow-wasi`
|
||||||
* `--allow-worker`
|
* `--allow-worker`
|
||||||
* `--conditions`, `-C`
|
* `--conditions`, `-C`
|
||||||
|
* `--cpu-prof-dir`
|
||||||
|
* `--cpu-prof-interval`
|
||||||
|
* `--cpu-prof-name`
|
||||||
|
* `--cpu-prof`
|
||||||
* `--diagnostic-dir`
|
* `--diagnostic-dir`
|
||||||
* `--disable-proto`
|
* `--disable-proto`
|
||||||
* `--disable-sigusr1`
|
* `--disable-sigusr1`
|
||||||
|
@ -614,19 +614,23 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
|
|||||||
"Start the V8 CPU profiler on start up, and write the CPU profile "
|
"Start the V8 CPU profiler on start up, and write the CPU profile "
|
||||||
"to disk before exit. If --cpu-prof-dir is not specified, write "
|
"to disk before exit. If --cpu-prof-dir is not specified, write "
|
||||||
"the profile to the current working directory.",
|
"the profile to the current working directory.",
|
||||||
&EnvironmentOptions::cpu_prof);
|
&EnvironmentOptions::cpu_prof,
|
||||||
|
kAllowedInEnvvar);
|
||||||
AddOption("--cpu-prof-name",
|
AddOption("--cpu-prof-name",
|
||||||
"specified file name of the V8 CPU profile generated with "
|
"specified file name of the V8 CPU profile generated with "
|
||||||
"--cpu-prof",
|
"--cpu-prof",
|
||||||
&EnvironmentOptions::cpu_prof_name);
|
&EnvironmentOptions::cpu_prof_name,
|
||||||
|
kAllowedInEnvvar);
|
||||||
AddOption("--cpu-prof-interval",
|
AddOption("--cpu-prof-interval",
|
||||||
"specified sampling interval in microseconds for the V8 CPU "
|
"specified sampling interval in microseconds for the V8 CPU "
|
||||||
"profile generated with --cpu-prof. (default: 1000)",
|
"profile generated with --cpu-prof. (default: 1000)",
|
||||||
&EnvironmentOptions::cpu_prof_interval);
|
&EnvironmentOptions::cpu_prof_interval,
|
||||||
|
kAllowedInEnvvar);
|
||||||
AddOption("--cpu-prof-dir",
|
AddOption("--cpu-prof-dir",
|
||||||
"Directory where the V8 profiles generated by --cpu-prof will be "
|
"Directory where the V8 profiles generated by --cpu-prof will be "
|
||||||
"placed. Does not affect --prof.",
|
"placed. Does not affect --prof.",
|
||||||
&EnvironmentOptions::cpu_prof_dir);
|
&EnvironmentOptions::cpu_prof_dir,
|
||||||
|
kAllowedInEnvvar);
|
||||||
AddOption("--experimental-network-inspection",
|
AddOption("--experimental-network-inspection",
|
||||||
"experimental network inspection support",
|
"experimental network inspection support",
|
||||||
&EnvironmentOptions::experimental_network_inspection);
|
&EnvironmentOptions::experimental_network_inspection);
|
||||||
|
@ -93,6 +93,10 @@ const difference = (setA, setB) => {
|
|||||||
// Refs: https://github.com/nodejs/node/pull/54259#issuecomment-2308256647
|
// Refs: https://github.com/nodejs/node/pull/54259#issuecomment-2308256647
|
||||||
if (!process.features.inspector) {
|
if (!process.features.inspector) {
|
||||||
[
|
[
|
||||||
|
'--cpu-prof-dir',
|
||||||
|
'--cpu-prof-interval',
|
||||||
|
'--cpu-prof-name',
|
||||||
|
'--cpu-prof',
|
||||||
'--heap-prof-dir',
|
'--heap-prof-dir',
|
||||||
'--heap-prof-interval',
|
'--heap-prof-interval',
|
||||||
'--heap-prof-name',
|
'--heap-prof-name',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user