[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20080925182517.GA6263@Krystal>
Date: Thu, 25 Sep 2008 14:25:17 -0400
From: Mathieu Desnoyers <compudj@...stal.dyndns.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
prasad@...ux.vnet.ibm.com, "Frank Ch. Eigler" <fche@...hat.com>,
David Wilder <dwilder@...ibm.com>, hch@....de,
Martin Bligh <mbligh@...gle.com>,
Christoph Hellwig <hch@...radead.org>,
Steven Rostedt <srostedt@...hat.com>
Subject: Re: [RFC PATCH 1/2 v2] Unified trace buffer
* Steven Rostedt (rostedt@...dmis.org) wrote:
>
> On Thu, 25 Sep 2008, Mathieu Desnoyers wrote:
> >
> > Is there a reason to use delta between events rather than simply write
> > the 27 LSBs that I would have missed ?
>
> One answer is that your counter wrap problem is extended.
>
> That is, you have 27 bits of time between each event to not worry about
> wraps. But if you go against the page itself, the last event on that page
> is more likely to suffer.
>
You can do the exact same thing and manage to keep the absolute time.
You just have to adapt the reader like this : (this would be for
per-event cycle count in the 32 LSBs, slight bitmask adaptation needed
for 27 bits only).
keep a 64 bits TSC value in a per-buffer variable. The previous value is
always re-used for the next read.
let's call it :
tf->buffer.tsc (u64)
read_event() would look like :
u32 timetamp = read_event_timetamp();
if(timestamp < (0xFFFFFFFFULL & tf->buffer.tsc)) {
/* overflow */
tf->buffer.tsc = ((tf->buffer.tsc & 0xFFFFFFFF00000000ULL)
+ 0x100000000ULL) | (u64)timestamp;
} else {
/* no overflow */
tf->buffer.tsc = (tf->buffer.tsc & 0xFFFFFFFF00000000ULL)
| (u64)timestamp;
}
This will detect 32 bits overflow and keep the tf->buffer.tsc in sync
with the TSC representation on the traced machine as long as events are
less then 27 bits apart. A "full tsc" header can also be easily managed
with this by updating the tf->buffer.tsc value completely when such
event is met.
Mathieu
> -- Steve
>
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists