diff options
author | Stephen Belanger <stephen.belanger@datadoghq.com> | 2021-03-23 02:27:31 +0300 |
---|---|---|
committer | Stephen Belanger <stephen.belanger@datadoghq.com> | 2021-03-25 22:15:14 +0300 |
commit | aaf98062b0e73af3b9a9ce8d1a87959187ec521c (patch) | |
tree | 7d648905ddd15a34be07192f2c855e15a2e023e1 /src/env.h | |
parent | 0ee2cea98d47f91ff8a32d39e2b4d16eeedd3c1d (diff) |
src: report idle time correctly
With this change, the V8 profiler will attribute any time between
prepare and check cycles, except any entrances to InternalCallbackScope,
to be "idle" time. All callbacks, microtasks, and timers will be marked
as not idle. The one exception is native modules which don't use the
MakeCallback helper, but those are already broken anyway for async
context tracking so we should just encourage broken modules to be fixed.
PR-URL: https://github.com/nodejs/node/pull/37868
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Diffstat (limited to 'src/env.h')
-rw-r--r-- | src/env.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/env.h b/src/env.h index f2d3c34f9f5..f28ad400206 100644 --- a/src/env.h +++ b/src/env.h @@ -1064,6 +1064,8 @@ class Environment : public MemoryRetainer { inline void AssignToContext(v8::Local<v8::Context> context, const ContextInfo& info); + void StartProfilerIdleNotifier(); + inline v8::Isolate* isolate() const; inline uv_loop_t* event_loop() const; inline void TryLoadAddon( @@ -1414,6 +1416,8 @@ class Environment : public MemoryRetainer { uv_timer_t timer_handle_; uv_check_t immediate_check_handle_; uv_idle_t immediate_idle_handle_; + uv_prepare_t idle_prepare_handle_; + uv_check_t idle_check_handle_; uv_async_t task_queues_async_; int64_t task_queues_async_refs_ = 0; |