inspector: split --cpu-prof-path to --cpu-prof-dir and --cpu-prof-name · nodejs/node@49d3d11 (original) (raw)

`@@ -149,6 +149,15 @@ void EnvironmentOptions::CheckOptions(std::vectorstd::string* errors) {

`

149

149

` }

`

150

150

``

151

151

`#if HAVE_INSPECTOR

`

``

152

`+

if (!cpu_prof) {

`

``

153

`+

if (!cpu_prof_name.empty()) {

`

``

154

`+

errors->push_back("--cpu-prof-name must be used with --cpu-prof");

`

``

155

`+

}

`

``

156

`+

if (!cpu_prof_dir.empty()) {

`

``

157

`+

errors->push_back("--cpu-prof-dir must be used with --cpu-prof");

`

``

158

`+

}

`

``

159

`+

}

`

``

160

+

152

161

` debug_options_.CheckOptions(errors);

`

153

162

`#endif // HAVE_INSPECTOR

`

154

163

`}

`

`@@ -335,14 +344,17 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {

`

335

344

`#if HAVE_INSPECTOR

`

336

345

`AddOption("--cpu-prof",

`

337

346

`"Start the V8 CPU profiler on start up, and write the CPU profile "

`

338

``

`-

"to disk before exit. If --cpu-prof-path is not specified, write "

`

``

347

`+

"to disk before exit. If --cpu-prof-dir is not specified, write "

`

339

348

`"the profile to the current working directory.",

`

340

349

` &EnvironmentOptions::cpu_prof);

`

341

``

`-

AddOption("--cpu-prof-path",

`

342

``

`-

"Path the V8 CPU profile generated with --cpu-prof will be "

`

343

``

`-

"written to.",

`

344

``

`-

&EnvironmentOptions::cpu_prof_path);

`

345

``

`-

Implies("--cpu-prof-path", "--cpu-prof");

`

``

350

`+

AddOption("--cpu-prof-name",

`

``

351

`+

"specified file name of the V8 CPU profile generated with "

`

``

352

`+

"--cpu-prof",

`

``

353

`+

&EnvironmentOptions::cpu_prof_name);

`

``

354

`+

AddOption("--cpu-prof-dir",

`

``

355

`+

"Directory where the V8 profiles generated by --cpu-prof will be "

`

``

356

`+

"placed. Does not affect --prof.",

`

``

357

`+

&EnvironmentOptions::cpu_prof_dir);

`

346

358

`#endif // HAVE_INSPECTOR

`

347

359

`AddOption("--redirect-warnings",

`

348

360

`"write warnings to file instead of stderr",

`