[PATCH 5/6] sched: Limit the number of scheduler debug messages

Mike Travis
2009-11-16T21:08:47Z

[-- Attachment #1: limit_sched_debug_messages --]
[-- Type: text/plain, Size: 1296 bytes --]

Remove the verbose scheduler debug messages unless kernel parameter
"sched_debug" set. /proc/sched_debug unchanged.

Signed-off-by: Mike Travis <travis@sgi.com>
---
Documentation/kernel-parameters.txt | 2 ++
kernel/sched.c | 13 +++++++++++++
2 files changed, 15 insertions(+)

--- linux.orig/Documentation/kernel-parameters.txt
+++ linux/Documentation/kernel-parameters.txt
@@ -2182,6 +2182,8 @@

sbni= [NET] Granch SBNI12 leased line adapter

+ sched_debug [KNL] Enables verbose scheduler debug messages.
+
sc1200wdt= [HW,WDT] SC1200 WDT (watchdog) driver
Format: <io>[,<timeout>[,<isapnp>]]

--- linux.orig/kernel/sched.c
+++ linux/kernel/sched.c
@@ -7743,6 +7743,16 @@

#ifdef CONFIG_SCHED_DEBUG

+static __read_mostly int sched_domain_debug_enabled;
+
+static int __init sched_domain_debug_setup(char *str)
+{
+ sched_domain_debug_enabled = 1;
+
+ return 0;
+}
+early_param("sched_debug", sched_domain_debug_setup);
+
static int sched_domain_debug_one(struct sched_domain *sd, int cpu, int level,
struct cpumask *groupmask)
{
@@ -7829,6 +7839,9 @@
cpumask_var_t groupmask;
int level = 0;

+ if (!sched_domain_debug_enabled)
+ return;
+
if (!sd) {
printk(KERN_DEBUG "CPU%d attaching NULL sched-domain.\n", cpu);
return;

--