Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/threadpoolwork-inl.h')
-rw-r--r--src/threadpoolwork-inl.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/threadpoolwork-inl.h b/src/threadpoolwork-inl.h
index 8bba988b18d..729e3de8eea 100644
--- a/src/threadpoolwork-inl.h
+++ b/src/threadpoolwork-inl.h
@@ -24,23 +24,36 @@
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
-#include "util-inl.h"
#include "node_internals.h"
+#include "tracing/trace_event.h"
+#include "util-inl.h"
namespace node {
void ThreadPoolWork::ScheduleWork() {
env_->IncreaseWaitingRequestCounter();
+ TRACE_EVENT_NESTABLE_ASYNC_BEGIN0(
+ TRACING_CATEGORY_NODE2(threadpoolwork, async), type_, this);
int status = uv_queue_work(
env_->event_loop(),
&work_req_,
[](uv_work_t* req) {
ThreadPoolWork* self = ContainerOf(&ThreadPoolWork::work_req_, req);
+ TRACE_EVENT_BEGIN0(TRACING_CATEGORY_NODE2(threadpoolwork, sync),
+ self->type_);
self->DoThreadPoolWork();
+ TRACE_EVENT_END0(TRACING_CATEGORY_NODE2(threadpoolwork, sync),
+ self->type_);
},
[](uv_work_t* req, int status) {
ThreadPoolWork* self = ContainerOf(&ThreadPoolWork::work_req_, req);
self->env_->DecreaseWaitingRequestCounter();
+ TRACE_EVENT_NESTABLE_ASYNC_END1(
+ TRACING_CATEGORY_NODE2(threadpoolwork, async),
+ self->type_,
+ self,
+ "result",
+ status);
self->AfterThreadPoolWork(status);
});
CHECK_EQ(status, 0);