summaryrefslogtreecommitdiff
path: root/src/tracing
diff options
context:
space:
mode:
authorAli Ijaz Sheikh <ofrobots@google.com>2018-01-16 17:13:36 -0800
committerAli Ijaz Sheikh <ofrobots@google.com>2018-01-24 09:58:28 -0800
commit98d9540dd7a7aa2e612f16caeea6e57d56ed9f12 (patch)
treec6549e3b67faca9d1d87938f511e5054d73ff27b /src/tracing
parent51054dac541cdefabe54a076f009ebf4c3c5d144 (diff)
downloadandroid-node-v8-98d9540dd7a7aa2e612f16caeea6e57d56ed9f12.tar.gz
android-node-v8-98d9540dd7a7aa2e612f16caeea6e57d56ed9f12.tar.bz2
android-node-v8-98d9540dd7a7aa2e612f16caeea6e57d56ed9f12.zip
src: use uv_hrtime as tracing timestamp
Override the V8 TracingController to provide uv_hrtime based timestamps. This allows tracing timestamps to be comparable with process.hrtime timestamps. Fixes: https://github.com/nodejs/node/issues/17349 PR-URL: https://github.com/nodejs/node/pull/18196 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Diffstat (limited to 'src/tracing')
-rw-r--r--src/tracing/agent.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/tracing/agent.h b/src/tracing/agent.h
index bd8e90004b..203f53be7e 100644
--- a/src/tracing/agent.h
+++ b/src/tracing/agent.h
@@ -8,7 +8,14 @@
namespace node {
namespace tracing {
-using v8::platform::tracing::TracingController;
+class TracingController : public v8::platform::tracing::TracingController {
+ public:
+ TracingController() : v8::platform::tracing::TracingController() {}
+
+ int64_t CurrentTimestampMicroseconds() override {
+ return uv_hrtime() / 1000;
+ }
+};
class Agent {
public: