summaryrefslogtreecommitdiff
path: root/src/node.cc
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2019-04-29 18:50:51 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2019-05-02 19:48:45 +0800
commit30cceaeccbe6a8c6a58a44ea760188f96951c13e (patch)
tree56141c753a0874152685eb471446e7cf80d9900b /src/node.cc
parent6f02f159216f4791e1d397aaddcbdb4dbcfd29d1 (diff)
downloadandroid-node-v8-30cceaeccbe6a8c6a58a44ea760188f96951c13e.tar.gz
android-node-v8-30cceaeccbe6a8c6a58a44ea760188f96951c13e.tar.bz2
android-node-v8-30cceaeccbe6a8c6a58a44ea760188f96951c13e.zip
src: refactor profile initialization
- Process and store --cpu-prof-dir and --cpu-prof-name during Environment creation - Start profilers in one `profiler::StartProfilers()` PR-URL: https://github.com/nodejs/node/pull/27475 Refs: https://github.com/nodejs/node/issues/27421 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/node.cc')
-rw-r--r--src/node.cc15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/node.cc b/src/node.cc
index 636a92eab3..d611460f4f 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -227,21 +227,8 @@ MaybeLocal<Value> RunBootstrapping(Environment* env) {
Isolate* isolate = env->isolate();
Local<Context> context = env->context();
- Local<String> coverage_str = env->env_vars()->Get(
- isolate, FIXED_ONE_BYTE_STRING(isolate, "NODE_V8_COVERAGE"));
- if (!coverage_str.IsEmpty() && coverage_str->Length() > 0) {
#if HAVE_INSPECTOR
- profiler::StartCoverageCollection(env);
-#else
- fprintf(stderr, "NODE_V8_COVERAGE cannot be used without inspector\n");
-#endif // HAVE_INSPECTOR
- }
-
-#if HAVE_INSPECTOR
- if (env->options()->cpu_prof) {
- env->InitializeCPUProfDir(env->options()->cpu_prof_dir);
- profiler::StartCpuProfiling(env, env->options()->cpu_prof_name);
- }
+ profiler::StartProfilers(env);
#endif // HAVE_INSPECTOR
// Add a reference to the global object