summaryrefslogtreecommitdiff
path: root/src/node_options.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/node_options.cc')
-rw-r--r--src/node_options.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/node_options.cc b/src/node_options.cc
index a6d7e41e8d..a36666c3e0 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -161,6 +161,11 @@ void EnvironmentOptions::CheckOptions(std::vector<std::string>* errors) {
if (!cpu_prof_dir.empty()) {
errors->push_back("--cpu-prof-dir must be used with --cpu-prof");
}
+ // We can't catch the case where the value passed is the default value,
+ // then the option just becomes a noop which is fine.
+ if (cpu_prof_interval != kDefaultCpuProfInterval) {
+ errors->push_back("--cpu-prof-interval must be used with --cpu-prof");
+ }
}
debug_options_.CheckOptions(errors);
@@ -356,6 +361,10 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
"specified file name of the V8 CPU profile generated with "
"--cpu-prof",
&EnvironmentOptions::cpu_prof_name);
+ AddOption("--cpu-prof-interval",
+ "specified sampling interval in microseconds for the V8 CPU "
+ "profile generated with --cpu-prof. (default: 1000)",
+ &EnvironmentOptions::cpu_prof_interval);
AddOption("--cpu-prof-dir",
"Directory where the V8 profiles generated by --cpu-prof will be "
"placed. Does not affect --prof.",