Skip to content

Commit 994c76a

Browse files
committed
cli: add --heap-proof flag available to NODE_OPTIONS
Fixes: nodejs#54257 Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
1 parent 20aff2b commit 994c76a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/node_options.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -604,19 +604,19 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
604604
"Start the V8 heap profiler on start up, and write the heap profile "
605605
"to disk before exit. If --heap-prof-dir is not specified, write "
606606
"the profile to the current working directory.",
607-
&EnvironmentOptions::heap_prof);
607+
&EnvironmentOptions::heap_prof, kAllowedInEnvvar);
608608
AddOption("--heap-prof-name",
609609
"specified file name of the V8 heap profile generated with "
610610
"--heap-prof",
611-
&EnvironmentOptions::heap_prof_name);
611+
&EnvironmentOptions::heap_prof_name, kAllowedInEnvvar);
612612
AddOption("--heap-prof-dir",
613613
"Directory where the V8 heap profiles generated by --heap-prof "
614614
"will be placed.",
615-
&EnvironmentOptions::heap_prof_dir);
615+
&EnvironmentOptions::heap_prof_dir, kAllowedInEnvvar);
616616
AddOption("--heap-prof-interval",
617617
"specified sampling interval in bytes for the V8 heap "
618618
"profile generated with --heap-prof. (default: 512 * 1024)",
619-
&EnvironmentOptions::heap_prof_interval);
619+
&EnvironmentOptions::heap_prof_interval, kAllowedInEnvvar);
620620
#endif // HAVE_INSPECTOR
621621
AddOption("--max-http-header-size",
622622
"set the maximum size of HTTP headers (default: 16384 (16KB))",

test/parallel/test-cli-node-options.js

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ expectNoWorker(`-r ${JSON.stringify(printSpaceA)}`, 'A\nB\n');
2222
expectNoWorker(`-r ${printA} -r ${printA}`, 'A\nB\n');
2323
expectNoWorker(` -r ${printA} -r ${printA}`, 'A\nB\n');
2424
expectNoWorker(` --require ${printA} --require ${printA}`, 'A\nB\n');
25+
expect('--heap-prof', 'B\n');
2526
expect('--no-deprecation', 'B\n');
2627
expect('--no-warnings', 'B\n');
2728
expect('--no_warnings', 'B\n');

0 commit comments

Comments
 (0)