diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2019-03-23 02:39:52 +0300 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2019-04-19 10:38:23 +0300 |
commit | e0e308448240260c207958dfc3dd9245d903af85 (patch) | |
tree | 611f54d2aac113f735f7a3047f2857561192e969 /src/node_internals.h | |
parent | 57ab3b56fcba725e1af4ed7f8a05bbdbd0b8a4d9 (diff) |
inspector: implement --cpu-prof[-path]
This patch introduces a CLI flag --cpu-prof that starts the V8
CPU profiler on start up, and ends the profiler then writes the
CPU profile before the Node.js instance (on the main thread or
the worker thread) exits. By default the profile is written to
`${cwd}/CPU.${yyyymmdd}.${hhmmss}.${pid}.${tid}.${seq}.cpuprofile`.
The patch also introduces a --cpu-prof-path flag for the user
to specify the path the profile will be written to.
Refs: https://github.com/nodejs/node/issues/26878
PR-URL: https://github.com/nodejs/node/pull/27147
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src/node_internals.h')
-rw-r--r-- | src/node_internals.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/node_internals.h b/src/node_internals.h index 53f7d3cdbad..5e7bd18dcec 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -314,6 +314,7 @@ void MarkBootstrapComplete(const v8::FunctionCallbackInfo<v8::Value>& args); #if HAVE_INSPECTOR namespace profiler { void StartCoverageCollection(Environment* env); +void StartCpuProfiling(Environment* env, const std::string& profile_name); void EndStartedProfilers(Environment* env); } #endif // HAVE_INSPECTOR |