Use high-precision vblank timings, if available #33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This (work-in-progress) PR implements the use of more accurate vblank timestamps, as suggested in #30 :
It requires a small kernel patch (submitted to the mailing list here), that extends the
drm_vblank_event
with two fields:time
holding a monotonic clock timestamp, andhigh_prec
, a boolean indicating whether or not the timestamp came from a DRM driver that is able to generate HW-corrected high-precision vblank timestamps, or not.GPUVis is fully backwards-compatible to how it worked before. High-precision vblank timestamps are only used in GPUVis if the following is true:
OPT_VBlankHighPrecTimestamps
, default is OFF) (bound to Ctrl-Shift-K, or right-click to toggle in option pop-up)time
field is set in thedrm_vblank_event
data, andhigh_prec
is trueOpening an enriched trace, you can now toggle back and forth using Ctrl-Shift-K and see how the purple lines jump back and forth (on my laptop, diff is ~ 200ms).
As described above, you need to configure ftrace to use monotonic clock as the source for timestamps:
echo mono > /sys/kernel/tracing/trace_clock
Without that, we can't easily align the timestamps of the vblank event along the ftrace/GPUVis timeline.