diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2007-11-19 17:46:16 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-02-01 18:30:54 -0500 |
commit | 90dda1cb6ace6abd777f84bf051c4f86fa58986a (patch) | |
tree | b53a566118e5e130a55707bea6d01e112508c8df | |
parent | ce2b7147bb83b7d729b17c1638f092a1bcba4981 (diff) |
PM: Make PM_TRACE more architecture independent
When trying to debug a suspend failure I started implementing
PM_TRACE for powerpc. I then noticed that I'm debugging a suspend
failure and so PM_TRACE isn't useful at all, but thought that
nonetheless this could be useful in the future.
Basically, to support PM_TRACE, you add a Kconfig option that
selects PM_TRACE and provides the infrastructure as per the
help text of PM_TRACE.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r-- | drivers/base/power/Makefile | 2 | ||||
-rw-r--r-- | kernel/power/Kconfig | 23 |
2 files changed, 23 insertions, 2 deletions
diff --git a/drivers/base/power/Makefile b/drivers/base/power/Makefile index de28dfd3b96c..911208b89259 100644 --- a/drivers/base/power/Makefile +++ b/drivers/base/power/Makefile | |||
@@ -1,6 +1,6 @@ | |||
1 | obj-$(CONFIG_PM) += sysfs.o | 1 | obj-$(CONFIG_PM) += sysfs.o |
2 | obj-$(CONFIG_PM_SLEEP) += main.o | 2 | obj-$(CONFIG_PM_SLEEP) += main.o |
3 | obj-$(CONFIG_PM_TRACE) += trace.o | 3 | obj-$(CONFIG_PM_TRACE_RTC) += trace.o |
4 | 4 | ||
5 | ccflags-$(CONFIG_DEBUG_DRIVER) := -DDEBUG | 5 | ccflags-$(CONFIG_DEBUG_DRIVER) := -DDEBUG |
6 | ccflags-$(CONFIG_PM_VERBOSE) += -DDEBUG | 6 | ccflags-$(CONFIG_PM_VERBOSE) += -DDEBUG |
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig index 8e186c678149..06a08f7cebda 100644 --- a/kernel/power/Kconfig +++ b/kernel/power/Kconfig | |||
@@ -44,9 +44,30 @@ config PM_VERBOSE | |||
44 | ---help--- | 44 | ---help--- |
45 | This option enables verbose messages from the Power Management code. | 45 | This option enables verbose messages from the Power Management code. |
46 | 46 | ||
47 | config CAN_PM_TRACE | ||
48 | def_bool y | ||
49 | depends on PM_DEBUG && PM_SLEEP && EXPERIMENTAL | ||
50 | |||
47 | config PM_TRACE | 51 | config PM_TRACE |
52 | bool | ||
53 | help | ||
54 | This enables code to save the last PM event point across | ||
55 | reboot. The architecture needs to support this, x86 for | ||
56 | example does by saving things in the RTC, see below. | ||
57 | |||
58 | The architecture specific code must provide the extern | ||
59 | functions from <linux/resume-trace.h> as well as the | ||
60 | <asm/resume-trace.h> header with a TRACE_RESUME() macro. | ||
61 | |||
62 | The way the information is presented is architecture- | ||
63 | dependent, x86 will print the information during a | ||
64 | late_initcall. | ||
65 | |||
66 | config PM_TRACE_RTC | ||
48 | bool "Suspend/resume event tracing" | 67 | bool "Suspend/resume event tracing" |
49 | depends on PM_DEBUG && X86 && PM_SLEEP && EXPERIMENTAL | 68 | depends on CAN_PM_TRACE |
69 | depends on X86 | ||
70 | select PM_TRACE | ||
50 | default n | 71 | default n |
51 | ---help--- | 72 | ---help--- |
52 | This enables some cheesy code to save the last PM event point in the | 73 | This enables some cheesy code to save the last PM event point in the |