/* The function calculates the monotonic clock from the realtime clock and the wall_to_monotonic offset and stores the result in normalized timespec format in the variable pointed to by @ts.  */
void ktime_get_ts(struct timespec *ts)
/* The function calculates the monotonic clock from the realtime clock and the wall_to_monotonic offset and stores the result in normalized timespec format in the variable pointed to by @ts.  */
void ktime_get_ts(struct timespec *ts)
{
	struct timespec tomono;
	unsigned long seq;
	do {
		seq = read_seqbegin(&xtime_lock);
		getnstimeofday(ts);
		tomono = wall_to_monotonic;
	} while (read_seqretry(&xtime_lock, seq));
	set_normalized_timespec(ts, ts->tv_sec + tomono.tv_sec,
				ts->tv_nsec + tomono.tv_nsec);
}