lkml.org 
[lkml]   [2008]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v1] change likeliness accounting
From
Date

On Fri, 2008-03-14 at 00:06 +0100, Roel Kluin wrote:

> #define __check_likely(exp, is_likely) \
> ({ \
> static struct likeliness likeliness = { \
> - .func = __func__, \
> - .file = __FILE__, \
> - .line = __LINE__, \
> - .type = is_likely | LP_UNSEEN, \
> + .label = __LINE__ << LP_LINE_SHIFT | \
> + LP_UNSEEN | is_likely, \
> }; \
> - do_check_likely(&likeliness, !!(exp)); \
> + \
> + if (likeliness.label & LP_UNSEEN) \
> + do_check_likely(&likeliness); \

On second look, your actually break even on size (if not a little worse)
cause you adding some addition code into the macro which effectively
inlines it at all the likely/unlikely locations .. I'm not sure that's
really necessary ..

Also by not including the file name you have situation like the
following,

+unlikely | 208324| 4010128| do_sys_open+0x2a/0xb2()@:34

Where do_sys_open is on line 1076 in file fs/open.c , but the likely
location is actual on like 34 in file include/linux/err.h ..

So I think saving of the EIP does help in finding the actually caller,
but I do think we loose something by removing the file name..

Daniel



\
 
 \ /
  Last update: 2008-03-14 21:29    [W:0.050 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site