On Fri, Feb 25, 2011 at 10:21 AM, Nathaniel Smith <njs@xxxxxxxxx> wrote: > static u64 _ktime_diff_to_now_and_unstash(ktime_t then, int * enqueued) { > > Â Â Â Âtimespec ts_then = ktime_to_timespec(then); > Â Â Â Âtimespec ts_now = ktime_to_timespec(ktime_get()); > Â Â Â Â*enqueued = ts_then.tv_sec >> LATENCY_BITS; > Â Â Â Âts_then.tv_sec &= (1 << LATENCY_BITS) - 1; > Â Â Â Âts_now.tv_sec &= (1 << LATENCY_BITS) - 1; > Â Â Â Âif (ts_now.tv_sec < ts_then.tv_sec) > Â Â Â Â Â Â Â Âts_now.tv_sec += (1 << LATENCY_BITS); > Â Â Â Â timespec_sub(ts_now, ts_then); > } Err, plus the 'return timespec_to_ns(...)' on the last line, that I was trying to add when my computer suddenly decided I wanted to send the message. How embarrassing. Anyway, not sure this is a *good* idea, but it should work. Hopefully we don't actually need to measure latencies > 256 seconds in this context... -- Nathaniel -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html