Linus Torvalds | eb71c87 | 2006-06-24 14:27:42 -0700 | [diff] [blame] | 1 | #ifndef RESUME_TRACE_H |
| 2 | #define RESUME_TRACE_H |
| 3 | |
| 4 | #ifdef CONFIG_PM_TRACE |
Nigel Cunningham | 44bf4ce | 2007-07-21 17:10:41 +0200 | [diff] [blame] | 5 | #include <asm/resume-trace.h> |
Linus Torvalds | eb71c87 | 2006-06-24 14:27:42 -0700 | [diff] [blame] | 6 | |
Rafael J. Wysocki | c5c6ba4 | 2006-09-25 23:32:58 -0700 | [diff] [blame] | 7 | extern int pm_trace_enabled; |
| 8 | |
Rafael J. Wysocki | 5af84b8 | 2010-01-23 22:23:32 +0100 | [diff] [blame] | 9 | static inline int pm_trace_is_enabled(void) |
| 10 | { |
| 11 | return pm_trace_enabled; |
| 12 | } |
| 13 | |
Linus Torvalds | eb71c87 | 2006-06-24 14:27:42 -0700 | [diff] [blame] | 14 | struct device; |
| 15 | extern void set_trace_device(struct device *); |
Jan Beulich | 63687a5 | 2008-05-12 15:44:41 +0200 | [diff] [blame] | 16 | extern void generate_resume_trace(const void *tracedata, unsigned int user); |
Linus Torvalds | eb71c87 | 2006-06-24 14:27:42 -0700 | [diff] [blame] | 17 | |
Nigel Cunningham | 44bf4ce | 2007-07-21 17:10:41 +0200 | [diff] [blame] | 18 | #define TRACE_DEVICE(dev) do { \ |
| 19 | if (pm_trace_enabled) \ |
| 20 | set_trace_device(dev); \ |
| 21 | } while(0) |
Linus Torvalds | eb71c87 | 2006-06-24 14:27:42 -0700 | [diff] [blame] | 22 | |
| 23 | #else |
| 24 | |
Rafael J. Wysocki | 5af84b8 | 2010-01-23 22:23:32 +0100 | [diff] [blame] | 25 | static inline int pm_trace_is_enabled(void) { return 0; } |
| 26 | |
Linus Torvalds | eb71c87 | 2006-06-24 14:27:42 -0700 | [diff] [blame] | 27 | #define TRACE_DEVICE(dev) do { } while (0) |
| 28 | #define TRACE_RESUME(dev) do { } while (0) |
| 29 | |
| 30 | #endif |
| 31 | |
| 32 | #endif |