diff options
author | Bart Van Assche <bart.vanassche@gmail.com> | 2009-04-05 10:20:02 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-07 11:07:40 -0400 |
commit | d9ad8bc0ca823705413f75b50c442a88cc518b35 (patch) | |
tree | 183a754f2c4f6259cd13ccbb83747d11daf046f2 | |
parent | 1bbe2a83ab68e5cf8c66c372c7cb3b51910c2cfe (diff) |
branch tracer: Fix for enabling branch profiling makes sparse unusable
One of the changes between kernels 2.6.28 and 2.6.29 is that a branch profiler
has been added for if() statements. Unfortunately this patch makes the sparse
output unusable with CONFIG_TRACE_BRANCH_PROFILING=y: when branch profiling is
enabled, sparse prints so much false positives that the real issues are no
longer visible. This behavior can be reproduced as follows:
* enable CONFIG_TRACE_BRANCH_PROFILING, e.g. by running make allyesconfig or
make allmodconfig.
* run make C=2
Result: a huge number of the following sparse warnings.
...
include/linux/cpumask.h:547:2: warning: symbol '______r' shadows an earlier one
include/linux/cpumask.h:547:2: originally declared here
...
The patch below fixes this by disabling branch profiling while analyzing the
kernel code with sparse.
See also:
* http://lkml.org/lkml/2008/11/21/18
* http://bugzilla.kernel.org/show_bug.cgi?id=12925
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Steven Rostedt <srostedt@redhat.com>
LKML-Reference: <200904051620.02311.bart.vanassche@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | include/linux/compiler.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 6faa7e549de4..8872ad6dd89b 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -76,7 +76,8 @@ struct ftrace_branch_data { | |||
76 | * Note: DISABLE_BRANCH_PROFILING can be used by special lowlevel code | 76 | * Note: DISABLE_BRANCH_PROFILING can be used by special lowlevel code |
77 | * to disable branch tracing on a per file basis. | 77 | * to disable branch tracing on a per file basis. |
78 | */ | 78 | */ |
79 | #if defined(CONFIG_TRACE_BRANCH_PROFILING) && !defined(DISABLE_BRANCH_PROFILING) | 79 | #if defined(CONFIG_TRACE_BRANCH_PROFILING) \ |
80 | && !defined(DISABLE_BRANCH_PROFILING) && !defined(__CHECKER__) | ||
80 | void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | 81 | void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); |
81 | 82 | ||
82 | #define likely_notrace(x) __builtin_expect(!!(x), 1) | 83 | #define likely_notrace(x) __builtin_expect(!!(x), 1) |