Quieten the freezer by replacing printks with a local #define
that can be enabled if and when debugging is needed.
Signed-off-by: Nigel Cunningham <[email protected]>
kernel/power/process.c | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/kernel/power/process.c b/kernel/power/process.c
index 6da0445..09fc9ca 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -33,6 +33,13 @@
#include <linux/suspend.h>
#include <linux/module.h>
+#if 0
+//#ifdef CONFIG_PM_DEBUG
+#define freezer_message(msg, a...) do { printk(msg, ##a); } while(0)
+#else
+#define freezer_message(msg, a...) do { } while(0)
+#endif
+
/*
* Timeout for stopping processes
*/
@@ -67,7 +74,7 @@ static int freeze_process(struct notifie
current->flags |= PF_FROZEN;
notifier_chain_unregister(¤t->todo, nl);
kfree(nl);
- printk("=");
+ freezer_message("=");
spin_lock_irq(¤t->sighand->siglock);
recalc_sigpending(); /* We sent fake signal, clean it up */
@@ -84,11 +91,11 @@ static int freeze_process(struct notifie
void thaw_processes(void)
{
- printk("Restarting tasks..");
+ freezer_message("Restarting tasks..");
complete_all(&thaw);
while (atomic_read(&nr_frozen) > 0)
schedule();
- printk("done\n");
+ freezer_message("done\n");
}
static inline void freeze(struct task_struct *p)
@@ -127,7 +134,7 @@ int freeze_processes(void)
atomic_set(&nr_frozen, 0);
INIT_COMPLETION(thaw);
- printk("Stopping tasks: ");
+ freezer_message("Stopping tasks: ");
start_time = jiffies;
do {
todo = 0;
@@ -142,7 +149,7 @@ int freeze_processes(void)
read_unlock(&tasklist_lock);
yield(); /* Yield is okay here */
if (todo && time_after(jiffies, start_time + TIMEOUT)) {
- printk("\n");
+ freezer_message("\n");
printk(KERN_ERR " stopping tasks failed"
"(%d tasks remaining)\n",
todo - atomic_read(&nr_frozen));
@@ -151,7 +158,7 @@ int freeze_processes(void)
}
} while (atomic_read(&nr_frozen) < todo);
- printk("|\n");
+ freezer_message("|\n");
BUG_ON(in_atomic());
return 0;
}
--
Nigel Cunningham nigel at suspend2 dot net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]