• Eric Rannaud's avatar
    [cpu-profile] Timestamps in tracing events args stay in monotonic time · 668aafb5
    Eric Rannaud authored
    On Linux, Perfetto translates the builtin "ts" timestamp in trace event
    from CLOCK_MONOTONIC to CLOCK_BOOTTIME, before passing them to devtools.
    Devtools therefore implicitly operates on timestamps that are in
    CLOCK_BOOTTIME.
    
    However, additional timestamps sent in trace event payload arguments
    will not be converted to CLOCK_BOOTTIME by Perfetto, raising the
    possibility of devtools using timestamps from multiple clock domains
    incorrectly.
    
    Since trace events sent by CpuProfile also include the builtin "ts"
    trace timestamp (sampled from CLOCK_MONOTONIC nearly at the same time by
    the tracing framework), sending "data.startTime" and "data.endTime" is
    essentially redundant. devtools-frontend:2113957 stops the use of the
    value of these timestamps in the payload of Profile and ProfileChunk
    events. Devtools continue to use the presence of these arguments to
    indentify start and end profile events.
    
    ProfileChunk events also include "timeDeltas" which are relative
    timestamps. They are also in CLOCK_MONOTONIC and are not translated by
    Perfetto. devtools-frontend:2113957 computes absolute CLOCK_BOOTTIME
    timestamps from timeDeltas by adding them to "ts" in the "Profile" event
    (previously, "data.startTime" was used). This is only valid if the
    system is not suspended/resumed during profiling. Providing support for
    suspend/resume in the middle of profiling will likely involve having
    Perfetto convert "timeDeltas" directly to CLOCK_BOOTTIME.
    
    This CL introduces no code changes and only adds comments to explain
    the above.
    
    BUG=chromium:1055871
    
    Change-Id: I649dfcce8ea1a100c0ecfe03f843c7cb1fdd6f33
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2114001
    Commit-Queue: Peter Marshall <petermarshall@chromium.org>
    Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#66820}
    668aafb5
Name
Last commit
Last update
..
OWNERS Loading commit data...
allocation-tracker.cc Loading commit data...
allocation-tracker.h Loading commit data...
circular-queue-inl.h Loading commit data...
circular-queue.h Loading commit data...
cpu-profiler-inl.h Loading commit data...
cpu-profiler.cc Loading commit data...
cpu-profiler.h Loading commit data...
heap-profiler.cc Loading commit data...
heap-profiler.h Loading commit data...
heap-snapshot-generator-inl.h Loading commit data...
heap-snapshot-generator.cc Loading commit data...
heap-snapshot-generator.h Loading commit data...
profile-generator-inl.h Loading commit data...
profile-generator.cc Loading commit data...
profile-generator.h Loading commit data...
profiler-listener.cc Loading commit data...
profiler-listener.h Loading commit data...
sampling-heap-profiler.cc Loading commit data...
sampling-heap-profiler.h Loading commit data...
strings-storage.cc Loading commit data...
strings-storage.h Loading commit data...
tick-sample.cc Loading commit data...
tick-sample.h Loading commit data...
tracing-cpu-profiler.cc Loading commit data...
tracing-cpu-profiler.h Loading commit data...