intel/perf: take into account that reports read can be fairly old
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 3 Dec 2019 14:19:24 +0000 (16:19 +0200)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 4 Dec 2019 09:21:15 +0000 (09:21 +0000)
commitb364e920bf8c6805bcc3ff1cedf6b77dbb61b1e0
treee6e4e1ec72c84c9d3d08839b74313db32bd31772
parent9d0a5c817ce21adabeda5153035b30609e2862b2
intel/perf: take into account that reports read can be fairly old

If we read the OA reports late enough after the query happens, we can
get a timestamp in the report that is significantly in the past
compared to the start timestamp of the query. The current code must
deal with the wraparound of the timestamp value (every ~6 minute). So
consider that if the difference is greater than half that wraparound
period, we're probably dealing with an old report and make the caller
aware it should read more reports when they're available.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/intel/perf/gen_perf.c