зеркало из https://github.com/mozilla/gecko-dev.git
db6fc91531
`GetProcessTimes` is based on QPC, while `GetSystemTime` is based on clock interruption whose accuracy is lower than QPC. This means in a process's early stage, `GetSystemTime` may return a timestamp earlier than creation timestamp. If this happens we'll keep a negative process uptime which causes overflow in telemetry processing. Win8+ has a handy API `GetSystemTimePreciseAsFileTime` that solves everything. On Win7, `GetSystemTimeAsFileTime` still solves this issue. In the worst case, it returns the exact same timestamp as process creation, but it's ok. Because the system time is stored as a `FILETIME` in `KUSER`, converting it to a `SYSTEMTIME` with `GetSystemTime` drops accuracy. We should avoid it unless needed. This patch also moves the call to `GetProcessTimes` before getting the current timestamp in case clock interruption happens in between those two function calls. Differential Revision: https://phabricator.services.mozilla.com/D56273 --HG-- extra : moz-landing-system : lando |
||
---|---|---|
.. | ||
android | ||
baseprofiler | ||
build | ||
dllservices | ||
linker | ||
misc | ||
static | ||
tests | ||
moz.build |