diff options
author | Erik Gilling <konkers@android.com> | 2011-10-09 02:30:10 +0100 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2011-10-09 02:30:10 +0100 |
commit | eb2df1b1e57a9b7394a42edeccf45b78b455758e (patch) | |
tree | 4f04b3d31d96a0f8cefa4a5086b3effb98f7b3c9 /kernel | |
parent | 8195c59eed87bdf417034bfe4ef5bb5b1a129696 (diff) |
earlysuspend: add verbose debug flag
when enabled, prints out the function of each handler as they are called
Change-Id: I5ed251867e0e3aa3cd05f030ff3579808cedd0c2
Signed-off-by: Erik Gilling <konkers@android.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/power/earlysuspend.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/kernel/power/earlysuspend.c b/kernel/power/earlysuspend.c index 84bed51dcdc..b15f02eba45 100644 --- a/kernel/power/earlysuspend.c +++ b/kernel/power/earlysuspend.c @@ -26,6 +26,7 @@ enum { DEBUG_USER_STATE = 1U << 0, DEBUG_SUSPEND = 1U << 2, + DEBUG_VERBOSE = 1U << 3, }; static int debug_mask = DEBUG_USER_STATE; module_param_named(debug_mask, debug_mask, int, S_IRUGO | S_IWUSR | S_IWGRP); @@ -94,8 +95,11 @@ static void early_suspend(struct work_struct *work) if (debug_mask & DEBUG_SUSPEND) pr_info("early_suspend: call handlers\n"); list_for_each_entry(pos, &early_suspend_handlers, link) { - if (pos->suspend != NULL) + if (pos->suspend != NULL) { + if (debug_mask & DEBUG_VERBOSE) + pr_info("early_suspend: calling %pf\n", pos->suspend); pos->suspend(pos); + } } mutex_unlock(&early_suspend_lock); @@ -131,9 +135,14 @@ static void late_resume(struct work_struct *work) } if (debug_mask & DEBUG_SUSPEND) pr_info("late_resume: call handlers\n"); - list_for_each_entry_reverse(pos, &early_suspend_handlers, link) - if (pos->resume != NULL) + list_for_each_entry_reverse(pos, &early_suspend_handlers, link) { + if (pos->resume != NULL) { + if (debug_mask & DEBUG_VERBOSE) + pr_info("late_resume: calling %pf\n", pos->resume); + pos->resume(pos); + } + } if (debug_mask & DEBUG_SUSPEND) pr_info("late_resume: done\n"); abort: |