Re: [RFC PATCH 1/3] Unified trace buffer
From: Martin Bligh
Date: Wed Sep 24 2008 - 13:55:14 EST
> Why "tsc_shifted"?
>
> I think 27 bits is probably fine, but not by removing precision. Instead
> of shifting it so it will fit (and dropping low bits as uninteresting), do
> it by encoding it as a delta against the previous thing. 27 bits would
> still be sufficient for any high-performance thing that has tons and tons
> of packets, and if you only have a few trace events you can afford to have
> the "TSC overflow" event type (and if you want it that dense, you could
> just make 'data' be the high bits, for a total of 59 bits rather than 64
> bits of TSC.
>
> 59 bits of cycle counters is perfectly fine unless you are talking trace
> events over a year or so (I didn't do the math, but let's assume a 4GHz
> TSC as a reasonable thing even going forward - even _if_ CPU's get faster
> than that, the TSC is unlikely to tick faster since it's just not worth it
> from a power standpoint).
>
> Ok, I did the math. 1<<27 seconds (assuming the low 32 bits are just
> fractions) is something like 4+ years. I _really_ don't think we need more
> than that (or even close to that) in TSC timestamps for tracing within one
> single buffer.
Mmm. Either I'm confused, or we're talking about different things.
If we just record the TSC unshifted, in 27 bits, at 4GHz, that gives us
about 1/30 of a second? So we either shift, use > 27 bits, or record
at least 30 events a second, none of which I like much ...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/