Files
android_kernel_xiaomi_sm8450/fs/btrfs
Steven Rostedt 4cd8587ce8 btrfs: Use trace condition for get_extent tracepoint
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>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
2013-11-20 20:44:47 -05:00
..
2013-11-11 22:02:51 -05:00
2013-11-20 20:44:45 -05:00
2013-06-29 12:57:00 +04:00
2013-11-11 22:10:36 -05:00
2013-11-11 22:03:19 -05:00
2008-09-25 11:04:06 -04:00
2012-10-09 09:14:45 -04:00
2013-11-15 09:18:14 -05:00
2013-09-01 08:16:32 -04:00
2013-03-14 14:57:10 -04:00
2013-11-11 21:57:30 -05:00
2013-11-11 22:03:19 -05:00
2013-02-01 14:24:23 -05:00
2013-11-11 22:11:26 -05:00
2012-10-09 09:19:57 -04:00