Re: Unified tracing buffer

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Monday, September 22, 2008 - 9:19 pm

On Mon, 22 Sep 2008, Steven Rostedt wrote:

Each tracepoint will basically give a partial ordering (if you make it so, 
of course - and on x86 it's hard to avoid it).

And with many trace-points, you can narrow down ordering if you're lucky.

But say that you have code like

	CPU#1		CPU#2

	trace_a		trace_c
	..		..
	trace_b		trace_d

and since each CPU itself is obviously strictly ordered, you a priori know 
that a < b, and c < d. But your trace buffer can look many different ways:

 - a -> b -> c -> d
   c -> d -> a -> b

   Now you do know that what happened between c and d must all have 
   happened entirely after/before the things that happened between
   a and b, and there is no overlap.

   This is only assuming the x86 full memory barrier from a "lock xadd" of 
   course, but those are the semantics you'd get on x86. On others, the 
   ordering might not be that strong.

 - a -> c -> b -> d
   a -> c -> d -> b

   With these trace point orderings, you really don't know anything at all 
   about the order of any access that happened in between. CPU#1 might 
   have gone first. Or not. Or partially. You simply do not know.


Well, x86 defines a memory order. But what I'm trying to explain is that 
memory order still doesn't actually specify what happens to the code that 
actually does tracing! The trace is only going to show the order of the 
tracepoints, not the _other_ memory accesses. So you'll have *some* 
information, but it's very partial.

And the thing is, all those other memory accesses are the ones that do all 
the real work. You'll know they happened _somewhere_ between two 
tracepoints, but not much more than that.

This is why timestamps aren't really any worse than sequence numbers in 
all practical matters. They'll get you close enough that you can consider 
them equivalent to a cache-coherent counter, just one that you don't have 
to take a cache miss for, and that increments on its own!

Quite a lot of CPU's have nice, dependable, TSC's that run at constant 
frequency. 

And quite a lot of traces care a _lot_ about real time. When you do IO 
tracing, the problem is almost never about lock ordering or anything like 
that. You want to see how long a request took. You don't care AT ALL how 
many tracepoints were in between the beginning and end, you care about how 
many microseconds there were!

			Linus
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Unified tracing buffer, Martin Bligh, (Fri Sep 19, 2:33 pm)
Re: Unified tracing buffer, Randy Dunlap, (Fri Sep 19, 2:42 pm)
Re: Unified tracing buffer, Martin Bligh, (Fri Sep 19, 2:57 pm)
Re: Unified tracing buffer, Martin Bligh, (Fri Sep 19, 3:09 pm)
Re: Unified tracing buffer, Martin Bligh, (Fri Sep 19, 3:19 pm)
Re: Unified tracing buffer, Olaf Dabrunz, (Fri Sep 19, 3:28 pm)
Re: Unified tracing buffer, Olaf Dabrunz, (Fri Sep 19, 3:41 pm)
Re: Unified tracing buffer, Frank Ch. Eigler, (Fri Sep 19, 4:18 pm)
Re: Unified tracing buffer, Peter Zijlstra, (Fri Sep 19, 5:07 pm)
Re: Unified tracing buffer, Marcel Holtmann, (Fri Sep 19, 5:26 pm)
Re: Unified tracing buffer, Olaf Dabrunz, (Sat Sep 20, 1:10 am)
Re: Unified tracing buffer, Steven Rostedt, (Sat Sep 20, 1:26 am)
Re: Unified tracing buffer, Steven Rostedt, (Sat Sep 20, 1:29 am)
Re: Unified tracing buffer, Steven Rostedt, (Sat Sep 20, 1:50 am)
Re: Unified tracing buffer, Steven Rostedt, (Sat Sep 20, 2:03 am)
Re: Unified tracing buffer, Mathieu Desnoyers, (Sat Sep 20, 4:40 am)
Re: Unified tracing buffer, Mathieu Desnoyers, (Sat Sep 20, 4:44 am)
Re: Unified tracing buffer, Mathieu Desnoyers, (Sat Sep 20, 6:37 am)
Re: Unified tracing buffer, Steven Rostedt, (Sat Sep 20, 6:51 am)
Re: Unified tracing buffer, Mathieu Desnoyers, (Sat Sep 20, 6:55 am)
Re: Unified tracing buffer, Arjan van de Ven, (Sat Sep 20, 7:12 am)
Re: Unified tracing buffer, Steven Rostedt, (Sat Sep 20, 7:54 am)
Re: Unified tracing buffer, KOSAKI Motohiro, (Sun Sep 21, 8:09 pm)
Re: Unified tracing buffer, Peter Zijlstra, (Mon Sep 22, 2:57 am)
Re: Unified tracing buffer, K.Prasad, (Mon Sep 22, 6:57 am)
Re: Unified tracing buffer, K.Prasad, (Mon Sep 22, 7:07 am)
Re: Unified tracing buffer, Peter Zijlstra, (Mon Sep 22, 7:45 am)
Re: Unified tracing buffer, Martin Bligh, (Mon Sep 22, 9:29 am)
Re: Unified tracing buffer, Peter Zijlstra, (Mon Sep 22, 9:36 am)
Re: Unified tracing buffer, Mathieu Desnoyers, (Mon Sep 22, 11:45 am)
Re: Unified tracing buffer, Mathieu Desnoyers, (Mon Sep 22, 11:52 am)
Re: Unified tracing buffer, Masami Hiramatsu, (Mon Sep 22, 12:45 pm)
Re: Unified tracing buffer, Martin Bligh, (Mon Sep 22, 1:13 pm)
Re: Unified tracing buffer, Masami Hiramatsu, (Mon Sep 22, 1:50 pm)
Re: Unified tracing buffer, Steven Rostedt, (Mon Sep 22, 2:39 pm)
Re: Unified tracing buffer, Masami Hiramatsu, (Mon Sep 22, 3:25 pm)
Re: Unified tracing buffer, Darren Hart, (Mon Sep 22, 4:11 pm)
Re: Unified tracing buffer, Martin Bligh, (Mon Sep 22, 4:16 pm)
Re: Unified tracing buffer, Masami Hiramatsu, (Mon Sep 22, 5:04 pm)
Re: Unified tracing buffer, Masami Hiramatsu, (Mon Sep 22, 5:05 pm)
Re: Unified tracing buffer, Martin Bligh, (Mon Sep 22, 5:12 pm)
Re: Unified tracing buffer, Linus Torvalds, (Mon Sep 22, 5:39 pm)
Re: Unified tracing buffer, Roland Dreier, (Mon Sep 22, 6:26 pm)
Re: Unified tracing buffer, Steven Rostedt, (Mon Sep 22, 6:39 pm)
Re: Unified tracing buffer, Mathieu Desnoyers, (Mon Sep 22, 7:02 pm)
Re: Unified tracing buffer, Darren Hart, (Mon Sep 22, 7:26 pm)
Re: Unified tracing buffer, Mathieu Desnoyers, (Mon Sep 22, 7:30 pm)
Re: Unified tracing buffer, Mathieu Desnoyers, (Mon Sep 22, 7:31 pm)
Re: Unified tracing buffer, Mathieu Desnoyers, (Mon Sep 22, 7:36 pm)
Re: Unified tracing buffer, Mathieu Desnoyers, (Mon Sep 22, 7:49 pm)
Re: Unified tracing buffer, Mathieu Desnoyers, (Mon Sep 22, 8:05 pm)
Re: Unified tracing buffer, Masami Hiramatsu, (Mon Sep 22, 8:06 pm)
Re: Unified tracing buffer, Linus Torvalds, (Mon Sep 22, 8:26 pm)
Re: Unified tracing buffer, Mathieu Desnoyers, (Mon Sep 22, 8:27 pm)
Re: Unified tracing buffer, Andi Kleen, (Mon Sep 22, 8:33 pm)
Re: Unified tracing buffer, Mathieu Desnoyers, (Mon Sep 22, 8:36 pm)
Re: Unified tracing buffer, Steven Rostedt, (Mon Sep 22, 8:43 pm)
Re: Unified tracing buffer, Martin Bligh, (Mon Sep 22, 8:47 pm)
Re: Unified tracing buffer, Linus Torvalds, (Mon Sep 22, 9:05 pm)
Re: Unified tracing buffer, Masami Hiramatsu, (Mon Sep 22, 9:10 pm)
Re: Unified tracing buffer, Martin Bligh, (Mon Sep 22, 9:17 pm)
Re: Unified tracing buffer, Linus Torvalds, (Mon Sep 22, 9:19 pm)
Re: Unified tracing buffer, Andi Kleen, (Mon Sep 22, 10:04 pm)
Re: Unified tracing buffer, Tom Zanussi, (Mon Sep 22, 10:25 pm)
[PATCH 1/3] relay - clean up subbuf switch, Tom Zanussi, (Mon Sep 22, 10:27 pm)
[PATCH 2/3] relay - make subbuf switch replaceable, Tom Zanussi, (Mon Sep 22, 10:27 pm)
[PATCH 3/3] relay - add channel flags, Tom Zanussi, (Mon Sep 22, 10:27 pm)
Re: Unified tracing buffer, Peter Zijlstra, (Tue Sep 23, 2:31 am)
Re: Unified tracing buffer, Steven Rostedt, (Tue Sep 23, 3:53 am)
Re: Unified tracing buffer, Mathieu Desnoyers, (Tue Sep 23, 6:50 am)
Re: Unified tracing buffer, Martin Bligh, (Tue Sep 23, 7:00 am)
Re: Unified tracing buffer, Mathieu Desnoyers, (Tue Sep 23, 7:12 am)
Re: Unified tracing buffer, KOSAKI Motohiro, (Tue Sep 23, 7:36 am)
Re: Unified tracing buffer, Masami Hiramatsu, (Tue Sep 23, 7:49 am)
Re: Unified tracing buffer, Frank Ch. Eigler, (Tue Sep 23, 8:02 am)
Re: Unified tracing buffer, Mathieu Desnoyers, (Tue Sep 23, 8:04 am)
Re: Unified tracing buffer, Masami Hiramatsu, (Tue Sep 23, 8:21 am)
Re: Unified tracing buffer, Masami Hiramatsu, (Tue Sep 23, 8:23 am)
Re: Unified tracing buffer, Masami Hiramatsu, (Tue Sep 23, 8:30 am)
Re: Unified tracing buffer, Linus Torvalds, (Tue Sep 23, 8:46 am)
Re: Unified tracing buffer, Linus Torvalds, (Tue Sep 23, 9:01 am)
Re: Unified tracing buffer, Masami Hiramatsu, (Tue Sep 23, 10:04 am)
Re: Unified tracing buffer, Thomas Gleixner, (Tue Sep 23, 10:30 am)
Re: Unified tracing buffer, K.Prasad, (Tue Sep 23, 10:55 am)
Re: Unified tracing buffer, KOSAKI Motohiro, (Tue Sep 23, 10:59 am)
Re: Unified tracing buffer, Mathieu Desnoyers, (Tue Sep 23, 11:13 am)
Re: Unified tracing buffer, Martin Bligh, (Tue Sep 23, 11:27 am)
Re: Unified tracing buffer, Martin Bligh, (Tue Sep 23, 11:28 am)
Re: Unified tracing buffer, Christoph Lameter, (Tue Sep 23, 11:33 am)
Re: Unified tracing buffer, Linus Torvalds, (Tue Sep 23, 11:56 am)
Re: Unified tracing buffer, Masami Hiramatsu, (Tue Sep 23, 11:59 am)
Re: Unified tracing buffer, Thomas Gleixner, (Tue Sep 23, 12:36 pm)
Re: Unified tracing buffer, Martin Bligh, (Tue Sep 23, 12:38 pm)
Re: Unified tracing buffer, Thomas Gleixner, (Tue Sep 23, 12:41 pm)
Re: Unified tracing buffer, Martin Bligh, (Tue Sep 23, 12:50 pm)
Re: Unified tracing buffer, Thomas Gleixner, (Tue Sep 23, 1:03 pm)
Re: Unified tracing buffer, Masami Hiramatsu, (Tue Sep 23, 1:03 pm)
Re: Unified tracing buffer, Thomas Gleixner, (Tue Sep 23, 1:08 pm)
Re: [PATCH 1/3] relay - clean up subbuf switch, Andrew Morton, (Tue Sep 23, 1:15 pm)
Re: [PATCH 2/3] relay - make subbuf switch replaceable, Andrew Morton, (Tue Sep 23, 1:17 pm)
Re: [PATCH 3/3] relay - add channel flags, Andrew Morton, (Tue Sep 23, 1:20 pm)
Re: Unified tracing buffer, Martin Bligh, (Tue Sep 23, 2:02 pm)
Re: Unified tracing buffer, Tom Zanussi, (Tue Sep 23, 8:50 pm)
Re: [PATCH 3/3] relay - add channel flags, Tom Zanussi, (Tue Sep 23, 8:57 pm)
Re: Unified tracing buffer, K.Prasad, (Tue Sep 23, 10:42 pm)
[RFC PATCH 0/8] current relay cleanup patchset, Tom Zanussi, (Wed Sep 24, 11:07 pm)
Re: Unified tracing buffer, Jason Baron, (Thu Oct 2, 8:28 am)
Re: Unified tracing buffer, Mathieu Desnoyers, (Fri Oct 3, 9:11 am)
Re: Unified tracing buffer, Jason Baron, (Fri Oct 3, 11:37 am)
Re: Unified tracing buffer, Mathieu Desnoyers, (Fri Oct 3, 12:10 pm)
Re: Unified tracing buffer, Jason Baron, (Fri Oct 3, 12:25 pm)
Re: Unified tracing buffer, Mathieu Desnoyers, (Fri Oct 3, 12:56 pm)
Re: Unified tracing buffer, Jason Baron, (Fri Oct 3, 1:25 pm)
Re: Unified tracing buffer, Frank Ch. Eigler, (Fri Oct 3, 2:52 pm)