Zhonghui Fu | 431d452 | 2015-03-18 15:54:27 +0100 | [diff] [blame] | 1 | #ifndef PM_TRACE_H |
| 2 | #define PM_TRACE_H |
Linus Torvalds | eb71c87 | 2006-06-24 14:27:42 -0700 | [diff] [blame] | 3 | |
| 4 | #ifdef CONFIG_PM_TRACE |
Zhonghui Fu | 431d452 | 2015-03-18 15:54:27 +0100 | [diff] [blame] | 5 | #include <asm/pm-trace.h> |
James Hogan | d33ac60 | 2010-10-12 00:00:25 +0200 | [diff] [blame] | 6 | #include <linux/types.h> |
Linus Torvalds | eb71c87 | 2006-06-24 14:27:42 -0700 | [diff] [blame] | 7 | |
Rafael J. Wysocki | c5c6ba4 | 2006-09-25 23:32:58 -0700 | [diff] [blame] | 8 | extern int pm_trace_enabled; |
| 9 | |
Rafael J. Wysocki | 5af84b8 | 2010-01-23 22:23:32 +0100 | [diff] [blame] | 10 | static inline int pm_trace_is_enabled(void) |
| 11 | { |
| 12 | return pm_trace_enabled; |
| 13 | } |
| 14 | |
Linus Torvalds | eb71c87 | 2006-06-24 14:27:42 -0700 | [diff] [blame] | 15 | struct device; |
| 16 | extern void set_trace_device(struct device *); |
Zhonghui Fu | 431d452 | 2015-03-18 15:54:27 +0100 | [diff] [blame] | 17 | extern void generate_pm_trace(const void *tracedata, unsigned int user); |
James Hogan | d33ac60 | 2010-10-12 00:00:25 +0200 | [diff] [blame] | 18 | extern int show_trace_dev_match(char *buf, size_t size); |
Linus Torvalds | eb71c87 | 2006-06-24 14:27:42 -0700 | [diff] [blame] | 19 | |
Nigel Cunningham | 44bf4ce | 2007-07-21 17:10:41 +0200 | [diff] [blame] | 20 | #define TRACE_DEVICE(dev) do { \ |
| 21 | if (pm_trace_enabled) \ |
| 22 | set_trace_device(dev); \ |
| 23 | } while(0) |
Linus Torvalds | eb71c87 | 2006-06-24 14:27:42 -0700 | [diff] [blame] | 24 | |
| 25 | #else |
| 26 | |
Rafael J. Wysocki | 5af84b8 | 2010-01-23 22:23:32 +0100 | [diff] [blame] | 27 | static inline int pm_trace_is_enabled(void) { return 0; } |
| 28 | |
Linus Torvalds | eb71c87 | 2006-06-24 14:27:42 -0700 | [diff] [blame] | 29 | #define TRACE_DEVICE(dev) do { } while (0) |
| 30 | #define TRACE_RESUME(dev) do { } while (0) |
Zhonghui Fu | 431d452 | 2015-03-18 15:54:27 +0100 | [diff] [blame] | 31 | #define TRACE_SUSPEND(dev) do { } while (0) |
Linus Torvalds | eb71c87 | 2006-06-24 14:27:42 -0700 | [diff] [blame] | 32 | |
| 33 | #endif |
| 34 | |
| 35 | #endif |