• B
    branch tracer: Fix for enabling branch profiling makes sparse unusable · d9ad8bc0
    Bart Van Assche 提交于
    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=12925Signed-off-by: NBart 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: NIngo Molnar <mingo@elte.hu>
    d9ad8bc0
compiler.h 7.5 KB