lkml.org 
[lkml]   [2010]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 1/2 v2] tracing: Add TRACE_EVENT_CONDITIONAL()
* Steven Rostedt (rostedt@goodmis.org) wrote:
[...]
> -#define __DO_TRACE(tp, proto, args) \
> +#define __DO_TRACE(tp, proto, args, cond) \
> do { \
> struct tracepoint_func *it_func_ptr; \
> void *it_func; \
> void *__data; \
> \
> + if (!(cond)) \

One small documentation-related detail: my guess is that you are leaving
"cond" without likely/unlikely builtin expect purposefully so that we
can write, in TP_CONDITION:

TP_CONDITION(unlikely(someparam)),

when we expect the condition to be usually false (and likely() for the
reverse). Maybe it could be worth documenting that expressions like the
following are valid :

TP_CONDITION((likely(param1) && unlikely(param2)) || likely(param3))

It's fair to assume that kernel developers know this already, but given
we plan to re-use TRACE_EVENT() for the user-space tracer soon enough,
documenting this kind of use-case now can save us the trouble in the
future.

Other than that,

Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>

Thanks!

Mathieu

--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com


\
 
 \ /
  Last update: 2010-12-03 05:57    [W:0.070 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site