Bug 12925

Summary: __branch_check__ definition in compiler.h makes sparse output unusable
Product: Other Reporter: Bart Van Assche (bvanassche)
Component: OtherAssignee: other_other
Status: CLOSED CODE_FIX    
Severity: normal CC: rjw
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.29 Subsystem:
Regression: Yes Bisected commit-id:
Bug Depends on:    
Bug Blocks: 12398    
Attachments: Disable branch profiling for sparse.
Disable branch profiling for sparse.

Description Bart Van Assche 2009-03-24 05:12:16 UTC
Latest working kernel version: 2.6.28.8
Earliest failing kernel version: 2.6.29
Distribution: any
Hardware Environment: any
Software Environment:
Problem Description: enabling TRACE_BRANCH_PROFILING in .config triggers so much sparse warnings that the sparse output becomes unusable.

Steps to reproduce:
* enable CONFIG_TRACE_BRANCH_PROFILING (I enabled this through make allyesconfig)
* run make C=2

Result: a huge number of sparse warnings, e.g.
...
include/linux/cpumask.h:547:2: warning: symbol '______r' shadows an earlier one
include/linux/cpumask.h:547:2: originally declared here
...
/tmp/bva/linux-2.6.29/arch/x86/include/asm/paravirt.h:902:2: warning: symbol '______r' shadows an earlier one
/tmp/bva/linux-2.6.29/arch/x86/include/asm/paravirt.h:902:2: originally declared
here
/tmp/bva/linux-2.6.29/arch/x86/include/asm/paravirt.h:902:2: warning: too many warnings
...

Proposed fix: in include/compiler.h, change

#if defined(CONFIG_TRACE_BRANCH_PROFILING) && !defined(DISABLE_BRANCH_PROFILING)

into

#if defined(CONFIG_TRACE_BRANCH_PROFILING) && !defined(DISABLE_BRANCH_PROFILING) && ! defined(__CHECKER__)
Comment 1 Bart Van Assche 2009-03-24 05:44:17 UTC
Created attachment 20657 [details]
Disable branch profiling for sparse.
Comment 2 Bart Van Assche 2009-03-24 05:48:14 UTC
Created attachment 20658 [details]
Disable branch profiling for sparse.
Comment 3 Bart Van Assche 2009-04-07 06:16:07 UTC
See also http://lkml.org/lkml/2009/4/5/120.
Comment 4 Rafael J. Wysocki 2009-04-26 11:25:09 UTC
Fixed by commit d9ad8bc0ca823705413f75b50c442a88cc518b35 .