lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 03 Dec 2010 09:09:04 -0500
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Mathieu Desnoyers <compudj@...stal.dyndns.org>
Cc:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Peter Zijlstra <peterz@...radead.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Theodore Tso <tytso@....edu>,
	Arjan van de Ven <arjan@...radead.org>,
	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Subject: Re: [RFC][PATCH 1/2 v2] tracing: Add TRACE_EVENT_CONDITIONAL()

On Thu, 2010-12-02 at 23:54 -0500, Mathieu Desnoyers wrote:
> * Steven Rostedt (rostedt@...dmis.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)),

I actually think this is an abuse of "unlikely".

> 
> 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.

I would frown on someone using unlikely here. But a TRACE_EVENT()
belongs to the maintainer, not me.

> 
> Other than that,
> 
> Acked-by: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>

Thanks!

-- Steve



--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ