This patch refines scheduler statistics collection and display to three levels,tasks, runqueue and scheddomains. CONFIG_SCHEDSTATS now requires a boot timeoption in the form of schedstats or schedstats= to display scheduler statistics

They can all be enabled together to get complete statistics by passing "all" as a boot time option. schedstat_inc has been split into schedstat_rq_inc andschedstat_sd_inc, each of which checks if rq and sd statistics gathering isenabled or not. schedstat_add has been changed to schedstat_sd_add, it checks if sd statistics gathering is on prior to gathering the statistics.Similar changes have been made for task schedstats gathering.

The output of /proc/schedstat and /proc/<pid>/schedstat and /proc/<pid>/task/*/schedstat has been modified to print a gentle message suggesting thatstatistics gathering is off. Also a header "statistics for cpuXXX" has beenadded (for each cpu) to the /proc/schedstat output.

This patch is motivated by comments for sharing code with CONFIG_SCHEDSTATS but not incurring the complete overhead of the entireCONFIG_SCHEDSTATS code.

Alternatives considered=======================The other alternative that was considered was that instead of changing theformat of /proc/schedstat and /proc/<pid>*/schedstat, we could print zeros forall levels for which statistics is not collected. But zeros could be treatedas valid values, so this solution was not implemented.

Limitations===========The effectiveness of this patch is limited to run-time statistics collection.The run-time overhead is proportional to the level of statistics enabled.The space consumed is the same as before.

+ schedstats [KNL]+ Enable all schedstats if CONFIG_SCHEDSTATS is defined+ same as the schedstats=all++ schedstats= [KNL]+ Format: {"all", "tasks", "sd", "rq"}+ all -- turns on the complete schedstats+ rq -- turns on schedstats only for runqueue+ sd -- turns on schedstats only for scheddomains+ tasks -- turns on schedstats only for tasks+ scsi_debug_*= [SCSI] See drivers/scsi/scsi_debug.c.