diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2019-04-23 11:47:28 +0800 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-05-26 22:18:00 +0200 |
commit | 4b74dae6b2601ee8be3b16fed48986f1be49f20a (patch) | |
tree | d9dde6a3876ade51a6857cf46b242ea59ce9e5ef /src/inspector_profiler.h | |
parent | e2c0c0c68074c539ae2ae30debdeafb9f94d989b (diff) | |
download | android-node-v8-4b74dae6b2601ee8be3b16fed48986f1be49f20a.tar.gz android-node-v8-4b74dae6b2601ee8be3b16fed48986f1be49f20a.tar.bz2 android-node-v8-4b74dae6b2601ee8be3b16fed48986f1be49f20a.zip |
inspector: implement --heap-prof
In addition implements --heap-prof-name, --heap-prof-dir and
--heap-prof-interval.
These flags are similar to --cpu-prof flags but they are meant
for the V8 sampling heap profiler instead of the CPU profiler.
PR-URL: https://github.com/nodejs/node/pull/27596
Fixes: https://github.com/nodejs/node/issues/27421
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src/inspector_profiler.h')
-rw-r--r-- | src/inspector_profiler.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/inspector_profiler.h b/src/inspector_profiler.h index 345ef90d4e..e7d45d7de3 100644 --- a/src/inspector_profiler.h +++ b/src/inspector_profiler.h @@ -107,6 +107,26 @@ class V8CpuProfilerConnection : public V8ProfilerConnection { bool ending_ = false; }; +class V8HeapProfilerConnection : public V8ProfilerConnection { + public: + explicit V8HeapProfilerConnection(Environment* env) + : V8ProfilerConnection(env) {} + + void Start() override; + void End() override; + + const char* type() const override { return "heap"; } + bool ending() const override { return ending_; } + + std::string GetDirectory() const override; + std::string GetFilename() const override; + v8::MaybeLocal<v8::Object> GetProfile(v8::Local<v8::Object> result) override; + + private: + std::unique_ptr<inspector::InspectorSession> session_; + bool ending_ = false; +}; + } // namespace profiler } // namespace node |