Re: [RFC][Patch 2/2] markers: example of irq regular kernel markers

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Steven Rostedt
Date: Saturday, June 21, 2008 - 7:36 am

On Sat, 21 Jun 2008, KOSAKI Motohiro wrote:

I don't understand why the compiler would do such a thing? The compiler
shouldn't be removing parameters.


Format strings only help for printf like operations. Not all tracers want
such a thing. The best example of this is the sched_switch code. LTTng and
friends just want a pid and comm to show. But there's tracers that want
more info from the task_struct. We also like to see the priority of the
task.

I also foresee these trace hooks be use for dynamic itegrity checks. On
switching out a process we might want to examine both the next and prev to
make sure the context switch should really occur.

There's other places in the core kernel that a tracer wants more than some
data in a structure. Recording all the data that might be needed in a
structure slows down those tracers that only want a little bit of data.
Passing in a pointer to the structure being traced should be enough for
all tracers.

If those that don't care about priority of a context switch, why should it
be parsing it out just for a single tracer that might need it. But all
tracers would need the prev and next pointers.

Now back to your question, why don't we like the printf format. Simply
because it does nothing for pointers. It might help you with a %d and
number of parameters, but a %p can not tell the difference between a
struct tasks_struct *, and a int *, which can have even more devastating
results. It also just looks like a debug session instead of a trace
marker.

Not to mention what Peter Zijlstra already stated, that a printf format
gives only run time checking, where we would like to see compile time
checking.

-- Steve

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

Messages in current thread:
[RFC][Patch 2/2] markers: example of irq regular kernel ma ..., Masami Hiramatsu, (Fri Jun 20, 10:03 am)
Re: [RFC][Patch 2/2] markers: example of irq regular kerne ..., Mathieu Desnoyers, (Fri Jun 20, 10:45 am)
Re: [RFC][Patch 2/2] markers: example of irq regular kerne ..., Masami Hiramatsu, (Fri Jun 20, 12:34 pm)
Re: [RFC][Patch 2/2] markers: example of irq regular kerne ..., Steven Rostedt, (Sat Jun 21, 7:36 am)
Re: [RFC][Patch 2/2] markers: example of irq regular kerne ..., Frank Ch. Eigler, (Sat Jun 21, 11:02 am)
Re: [RFC][Patch 2/2] markers: example of irq regular kerne ..., Frank Ch. Eigler, (Sat Jun 21, 12:39 pm)
[RFC] Tracepoint proposal, Mathieu Desnoyers, (Sun Jun 22, 10:11 am)
Re: [RFC] Tracepoint proposal, Alexey Dobriyan, (Sun Jun 22, 10:59 am)
Re: [RFC] Tracepoint proposal, Mathieu Desnoyers, (Sun Jun 22, 11:27 am)
Re: [RFC] Tracepoint proposal, Alexey Dobriyan, (Mon Jun 23, 5:20 pm)
Re: [RFC] Tracepoint proposal, Masami Hiramatsu, (Mon Jun 23, 8:09 pm)
Re: [RFC] Tracepoint proposal, Masami Hiramatsu, (Mon Jun 23, 9:01 pm)
RE: [RFC] Tracepoint proposal, Takashi Nishiie, (Tue Jun 24, 12:15 am)
Re: [RFC] Tracepoint proposal, Frank Ch. Eigler, (Tue Jun 24, 4:55 am)
Re: [RFC] Tracepoint proposal, Masami Hiramatsu, (Tue Jun 24, 9:04 am)
Re: [RFC] Tracepoint proposal, KOSAKI Motohiro, (Tue Jun 24, 9:21 am)
Re: [RFC] Tracepoint proposal, Masami Hiramatsu, (Tue Jun 24, 10:01 am)
Re: [RFC] Tracepoint proposal, Mathieu Desnoyers, (Tue Jun 24, 10:46 am)
[RFC PATCH] Kernel Tracepoints, Mathieu Desnoyers, (Wed Jun 25, 4:52 pm)
[RFC PATCH] Tracepoint sched probes, Mathieu Desnoyers, (Wed Jun 25, 4:55 pm)
Re: [RFC PATCH] Kernel Tracepoints, Masami Hiramatsu, (Thu Jun 26, 2:02 pm)
Re: [RFC PATCH] Kernel Tracepoints, Mathieu Desnoyers, (Fri Jun 27, 6:14 am)
Re: [RFC PATCH] Kernel Tracepoints, Mathieu Desnoyers, (Fri Jun 27, 6:15 am)
Re: [RFC PATCH] Kernel Tracepoints, Mathieu Desnoyers, (Fri Jun 27, 6:30 am)
Re: [RFC PATCH] Kernel Tracepoints (update), Mathieu Desnoyers, (Fri Jun 27, 6:36 am)
Re: [RFC PATCH] Kernel Tracepoints, Masami Hiramatsu, (Fri Jun 27, 1:58 pm)
Re: [RFC PATCH] Kernel Tracepoints, Masami Hiramatsu, (Fri Jun 27, 3:45 pm)
Re: [RFC PATCH] Kernel Tracepoints, Mathieu Desnoyers, (Mon Jun 30, 8:40 am)
Re: [RFC PATCH] Kernel Tracepoints, Mathieu Desnoyers, (Mon Jun 30, 8:43 am)
Re: [RFC PATCH] Kernel Tracepoints, Masami Hiramatsu, (Mon Jun 30, 12:38 pm)
Re: [RFC PATCH] Kernel Tracepoints, Masami Hiramatsu, (Mon Jun 30, 12:58 pm)
Re: [RFC PATCH] Kernel Tracepoints, Mathieu Desnoyers, (Thu Jul 3, 8:12 am)
Re: [RFC PATCH] Kernel Tracepoints (update), Masami Hiramatsu, (Thu Jul 3, 8:27 am)
Re: [RFC PATCH] Kernel Tracepoints (update), Mathieu Desnoyers, (Thu Jul 3, 8:47 am)
Re: [RFC PATCH] Kernel Tracepoints (update), Mathieu Desnoyers, (Thu Jul 3, 11:18 am)
Re: [RFC PATCH] Kernel Tracepoints (update), Masami Hiramatsu, (Thu Jul 3, 11:46 am)
Re: [RFC PATCH] Kernel Tracepoints, Masami Hiramatsu, (Thu Jul 3, 11:51 am)