lkml.org 
[lkml]   [2013]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ext4: Use trace condition for ext4_mballoc tracepoints

Ug,

Please ignore this for now. It wasn't suppose to go out yet, because we
didn't finish testing. I only wrote this up and put it in my claws-mail
"send-later" folder.

Well, what did I learn about claws mail today?

I learned that there's a "send" button next to the "compose" button
that when you hit it, it sends out all your "send later" messages :-p

Which I now have to look through and think about all the crap I wrote
about people just to feel good, and hit "send later" on, never
expecting it to ever go out.

Oh well, now everyone knows how much of an asshole I think they are ;-)

-- Steve


On Thu, 14 Nov 2013 23:08:11 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> Doing an if statement to test some condition to know if we should
> trigger a tracepoint is pointless when tracing is disabled. This just
> adds overhead and wastes a branch prediction. This is why the
> TRACE_EVENT_CONDITION() was created. It places the check inside the jump
> label so that the branch does not happen unless tracing is enabled.
>
> That is, instead of doing:
>
> if (em)
> trace_btrfs_get_extent(root, em);
>
> Which is basically this:
>
> if (em)
> if (static_key(trace_btrfs_get_extent)) {
>
>
> Using a TRACE_EVENT_CONDITION() we can just do:
>
> trace_btrfs_get_extent(root, em);
>
> And the condition trace event will do:
>
> if (static_key(trace_btrfs_get_extent)) {
> if (em) {
> ...
>
> The static key is a non conditional jump (or nop) that is faster than
> having to check if em is NULL or not.
>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>



\
 
 \ /
  Last update: 2013-11-18 22:21    [W:0.038 / U:0.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site