diff options
author | James M Snell <jasnell@gmail.com> | 2018-03-06 10:42:37 -0800 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2018-03-16 10:54:05 -0700 |
commit | 96cb4fb795808aa2774e842974aeb411c5d3dd94 (patch) | |
tree | da8a3965240c402f857e6267e0a278f486852c3a /src/node_perf_common.h | |
parent | 879f521c654fffd34360be432a6280936ba94071 (diff) | |
download | node-new-96cb4fb795808aa2774e842974aeb411c5d3dd94.tar.gz |
perf_hooks,trace_events: emit perf milestone trace events
Emit the perf_hooks node timing milestones as trace events.
PR-URL: https://github.com/nodejs/node/pull/19175
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src/node_perf_common.h')
-rw-r--r-- | src/node_perf_common.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/node_perf_common.h b/src/node_perf_common.h index 7ff57359ba..9754e1e66f 100644 --- a/src/node_perf_common.h +++ b/src/node_perf_common.h @@ -56,12 +56,6 @@ enum PerformanceEntryType { NODE_PERFORMANCE_ENTRY_TYPE_INVALID }; -#define PERFORMANCE_MARK(env, n) \ - do { \ - node::performance::MarkPerformanceMilestone(env, \ - node::performance::NODE_PERFORMANCE_MILESTONE_##n); \ - } while (0); - class performance_state { public: explicit performance_state(v8::Isolate* isolate) : @@ -86,6 +80,9 @@ class performance_state { AliasedBuffer<double, v8::Float64Array> milestones; AliasedBuffer<uint32_t, v8::Uint32Array> observers; + void Mark(enum PerformanceMilestone milestone, + uint64_t ts = PERFORMANCE_NOW()); + private: struct performance_state_internal { // doubles first so that they are always sizeof(double)-aligned |