Use do_posix_clock_monotonic_gettime() as described by comment.
While this does incur slightly more overhead we should be using do_posix_clock_monotonic_gettime() for gethrtime() as described by the existing comment.
This commit is contained in:
parent
f752b46eb3
commit
6020190e8f
|
@ -60,9 +60,10 @@ __gethrtime(void) {
|
||||||
/* Deal with signed/unsigned mismatch */
|
/* Deal with signed/unsigned mismatch */
|
||||||
return (hrtime_t)(res & ~(1ULL << 63));
|
return (hrtime_t)(res & ~(1ULL << 63));
|
||||||
#else
|
#else
|
||||||
uint64_t j = get_jiffies_64();
|
struct timespec ts;
|
||||||
|
|
||||||
return (hrtime_t)(j * (NSEC_PER_SEC / HZ));
|
do_posix_clock_monotonic_gettime(&ts);
|
||||||
|
return (hrtime_t)((ts.tv_sec * NSEC_PER_SEC) + ts.tv_nsec);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(__gethrtime);
|
EXPORT_SYMBOL(__gethrtime);
|
||||||
|
|
Loading…
Reference in New Issue