From 864860e9f3d4eed0b0b81af55197d7e525ea6306 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sat, 23 Mar 2019 07:39:52 +0800 Subject: src: port coverage serialization to C++ This patch moves the serialization of coverage profiles into C++. With this we no longer need to patch `process.reallyExit` and hook into the exit events, but instead hook into relevant places in C++ which are safe from user manipulation. This also makes the code easier to reuse for other types of profiles. PR-URL: https://github.com/nodejs/node/pull/26874 Reviewed-By: Ben Coe --- src/node_worker.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/node_worker.cc') diff --git a/src/node_worker.cc b/src/node_worker.cc index c93584c68c..7de9c355f6 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -329,6 +329,9 @@ void Worker::Run() { if (exit_code_ == 0 && !stopped) exit_code_ = exit_code; +#if HAVE_INSPECTOR + profiler::EndStartedProfilers(env_.get()); +#endif Debug(this, "Exiting thread for worker %llu with exit code %d", thread_id_, exit_code_); } -- cgit v1.2.3