From 8b7113bf3c61dc1df33cb74452b5a40acb25c07a Mon Sep 17 00:00:00 2001 From: Sigurd Schneider Date: Mon, 13 Jan 2020 13:16:18 +0100 Subject: [PATCH] [coverage] Change time format in recently added protocol messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The time was reported in milliseconds, but should be reported in seconds instead. TBR=ulan@chromium.org, szuend@chromium.org Change-Id: I171cdb0107cd522b0d62ac6ed4edfacf7599da0b Bug: chromium:1022031 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1997137 Reviewed-by: Sigurd Schneider Reviewed-by: Simon Zünd Commit-Queue: Sigurd Schneider Cr-Commit-Position: refs/heads/master@{#65727} --- include/js_protocol.pdl | 4 ++-- src/inspector/v8-profiler-agent-impl.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/js_protocol.pdl b/include/js_protocol.pdl index 19bd4dd488..4b560c769f 100644 --- a/include/js_protocol.pdl +++ b/include/js_protocol.pdl @@ -825,7 +825,7 @@ domain Profiler # Collect block-based coverage. optional boolean detailed returns - # The timestamp (in milliseconds) the coverage update was taken in the backend. + # Monotonically increasing time (in seconds) when the coverage update was taken in the backend. number timestamp # Enable type profile. @@ -849,7 +849,7 @@ domain Profiler returns # Coverage data for the current isolate. array of ScriptCoverage result - # The timestamp (in milliseconds) the coverage update was taken in the backend. + # Monotonically increasing time (in seconds) when the coverage update was taken in the backend. number timestamp # Collect type profile. diff --git a/src/inspector/v8-profiler-agent-impl.cc b/src/inspector/v8-profiler-agent-impl.cc index 97713839d3..e3fed1e11c 100644 --- a/src/inspector/v8-profiler-agent-impl.cc +++ b/src/inspector/v8-profiler-agent-impl.cc @@ -300,7 +300,7 @@ Response V8ProfilerAgentImpl::startPreciseCoverage(Maybe callCount, if (!m_enabled) return Response::Error("Profiler is not enabled"); *out_timestamp = (v8::base::TimeTicks::HighResolutionNow() - v8::base::TimeTicks()) - .InMilliseconds(); + .InSecondsF(); bool callCountValue = callCount.fromMaybe(false); bool detailedValue = detailed.fromMaybe(false); m_state->setBoolean(ProfilerAgentState::preciseCoverageStarted, true); @@ -412,7 +412,7 @@ Response V8ProfilerAgentImpl::takePreciseCoverage( v8::debug::Coverage coverage = v8::debug::Coverage::CollectPrecise(m_isolate); *out_timestamp = (v8::base::TimeTicks::HighResolutionNow() - v8::base::TimeTicks()) - .InMilliseconds(); + .InSecondsF(); return coverageToProtocol(m_session->inspector(), coverage, out_result); }