diff options
author | Ali Ijaz Sheikh <ofrobots@google.com> | 2018-05-16 15:22:56 -0700 |
---|---|---|
committer | Ali Ijaz Sheikh <ofrobots@google.com> | 2018-05-21 11:16:44 -0700 |
commit | 32873c5f9bc6e13b9cdff220b50bafeb3a1a2dec (patch) | |
tree | 21f9c34f010ff5b9d167b0b4c7653d3bce0ce358 /src/node_platform.cc | |
parent | 9c2e67ba97a4af0bb83c621b0c724f84198eac2d (diff) | |
download | node-new-32873c5f9bc6e13b9cdff220b50bafeb3a1a2dec.tar.gz |
src: trace_events: background thread events
V8 uses a thread pool provided by the host to schedule background tasks
for concurrent GC and compiation. Emit trace events to identify the
background threads. Ensure that the tracing infrastructure is started
before the thread pool is initialized.
PR-URL: https://github.com/nodejs/node/pull/20823
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'src/node_platform.cc')
-rw-r--r-- | src/node_platform.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/node_platform.cc b/src/node_platform.cc index b8f1344727..2885c72ed7 100644 --- a/src/node_platform.cc +++ b/src/node_platform.cc @@ -16,8 +16,10 @@ using v8::Platform; using v8::Task; using v8::TracingController; -static void BackgroundRunner(void* data) { - TaskQueue<Task>* background_tasks = static_cast<TaskQueue<Task>*>(data); +static void BackgroundRunner(void *data) { + TRACE_EVENT_METADATA1("__metadata", "thread_name", "name", + "BackgroundTaskRunner"); + TaskQueue<Task> *background_tasks = static_cast<TaskQueue<Task> *>(data); while (std::unique_ptr<Task> task = background_tasks->BlockingPop()) { task->Run(); background_tasks->NotifyOfCompletion(); |