Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=44bf4cea43816d43deab73c1c16361e899996eaa
Commit:     44bf4cea43816d43deab73c1c16361e899996eaa
Parent:     9ef231a436fddb34d806f599c97b479691b3c38b
Author:     Nigel Cunningham <[EMAIL PROTECTED]>
AuthorDate: Sat Jul 21 17:10:41 2007 +0200
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Sat Jul 21 18:37:10 2007 -0700

    x86: PM_TRACE support
    
    Signed-off-by: Nigel Cunningham <[EMAIL PROTECTED]>
    Cc: Randy Dunlap <[EMAIL PROTECTED]>
    Cc: "Rafael J. Wysocki" <[EMAIL PROTECTED]>
    Cc: Pavel Machek <[EMAIL PROTECTED]>
    Acked-by: Linus Torvalds <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 arch/x86_64/kernel/vmlinux.lds.S  |    7 +++++++
 drivers/base/power/trace.c        |    5 ++++-
 include/asm-i386/resume-trace.h   |   13 +++++++++++++
 include/asm-x86_64/resume-trace.h |   13 +++++++++++++
 include/linux/resume-trace.h      |   19 +++++--------------
 kernel/power/Kconfig              |    2 +-
 6 files changed, 43 insertions(+), 16 deletions(-)

diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S
index c2d5a84..8778848 100644
--- a/arch/x86_64/kernel/vmlinux.lds.S
+++ b/arch/x86_64/kernel/vmlinux.lds.S
@@ -54,6 +54,13 @@ SECTIONS
 
   RODATA
 
+  . = ALIGN(4);
+  .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {
+       __tracedata_start = .;
+       *(.tracedata)
+       __tracedata_end = .;
+  }
+
   . = ALIGN(PAGE_SIZE);        /* Align data segment to page size boundary */
                                /* Data */
   .data : AT(ADDR(.data) - LOAD_OFFSET) {
diff --git a/drivers/base/power/trace.c b/drivers/base/power/trace.c
index a9ab30f..2b0c601 100644
--- a/drivers/base/power/trace.c
+++ b/drivers/base/power/trace.c
@@ -142,6 +142,7 @@ void set_trace_device(struct device *dev)
 {
        dev_hash_value = hash_string(DEVSEED, dev->bus_id, DEVHASH);
 }
+EXPORT_SYMBOL(set_trace_device);
 
 /*
  * We could just take the "tracedata" index into the .tracedata
@@ -162,6 +163,7 @@ void generate_resume_trace(void *tracedata, unsigned int 
user)
        file_hash_value = hash_string(lineno, file, FILEHASH);
        set_magic_time(user_hash_value, file_hash_value, dev_hash_value);
 }
+EXPORT_SYMBOL(generate_resume_trace);
 
 extern char __tracedata_start, __tracedata_end;
 static int show_file_hash(unsigned int value)
@@ -170,7 +172,8 @@ static int show_file_hash(unsigned int value)
        char *tracedata;
 
        match = 0;
-       for (tracedata = &__tracedata_start ; tracedata < &__tracedata_end ; 
tracedata += 6) {
+       for (tracedata = &__tracedata_start ; tracedata < &__tracedata_end ;
+                       tracedata += 2 + sizeof(unsigned long)) {
                unsigned short lineno = *(unsigned short *)tracedata;
                const char *file = *(const char **)(tracedata + 2);
                unsigned int hash = hash_string(lineno, file, FILEHASH);
diff --git a/include/asm-i386/resume-trace.h b/include/asm-i386/resume-trace.h
new file mode 100644
index 0000000..ec9cfd6
--- /dev/null
+++ b/include/asm-i386/resume-trace.h
@@ -0,0 +1,13 @@
+#define TRACE_RESUME(user) do {                                        \
+       if (pm_trace_enabled) {                                 \
+               void *tracedata;                                \
+               asm volatile("movl $1f,%0\n"                    \
+                       ".section .tracedata,\"a\"\n"           \
+                       "1:\t.word %c1\n"                       \
+                       "\t.long %c2\n"                         \
+                       ".previous"                             \
+                       :"=r" (tracedata)                       \
+                       : "i" (__LINE__), "i" (__FILE__));      \
+               generate_resume_trace(tracedata, user);         \
+       }                                                       \
+} while (0)
diff --git a/include/asm-x86_64/resume-trace.h 
b/include/asm-x86_64/resume-trace.h
new file mode 100644
index 0000000..34bf998
--- /dev/null
+++ b/include/asm-x86_64/resume-trace.h
@@ -0,0 +1,13 @@
+#define TRACE_RESUME(user) do {                                        \
+       if (pm_trace_enabled) {                                 \
+               void *tracedata;                                \
+               asm volatile("movq $1f,%0\n"                    \
+                       ".section .tracedata,\"a\"\n"           \
+                       "1:\t.word %c1\n"                       \
+                       "\t.quad %c2\n"                         \
+                       ".previous"                             \
+                       :"=r" (tracedata)                       \
+                       : "i" (__LINE__), "i" (__FILE__));      \
+               generate_resume_trace(tracedata, user);         \
+       }                                                       \
+} while (0)
diff --git a/include/linux/resume-trace.h b/include/linux/resume-trace.h
index 81e9299..f3f4f28 100644
--- a/include/linux/resume-trace.h
+++ b/include/linux/resume-trace.h
@@ -2,6 +2,7 @@
 #define RESUME_TRACE_H
 
 #ifdef CONFIG_PM_TRACE
+#include <asm/resume-trace.h>
 
 extern int pm_trace_enabled;
 
@@ -9,20 +10,10 @@ struct device;
 extern void set_trace_device(struct device *);
 extern void generate_resume_trace(void *tracedata, unsigned int user);
 
-#define TRACE_DEVICE(dev) set_trace_device(dev)
-#define TRACE_RESUME(user) do {                                        \
-       if (pm_trace_enabled) {                                 \
-               void *tracedata;                                \
-               asm volatile("movl $1f,%0\n"                    \
-                       ".section .tracedata,\"a\"\n"           \
-                       "1:\t.word %c1\n"                       \
-                       "\t.long %c2\n"                         \
-                       ".previous"                             \
-                       :"=r" (tracedata)                       \
-                       : "i" (__LINE__), "i" (__FILE__));      \
-               generate_resume_trace(tracedata, user);         \
-       }                                                       \
-} while (0)
+#define TRACE_DEVICE(dev) do { \
+       if (pm_trace_enabled) \
+               set_trace_device(dev); \
+       } while(0)
 
 #else
 
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
index 7358609..c1a106d 100644
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -57,7 +57,7 @@ config DISABLE_CONSOLE_SUSPEND
 
 config PM_TRACE
        bool "Suspend/resume event tracing"
-       depends on PM_DEBUG && X86_32 && EXPERIMENTAL
+       depends on PM_DEBUG && X86 && EXPERIMENTAL
        default n
        ---help---
        This enables some cheesy code to save the last PM event point in the
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to