blob: ecbde7a5548ec3008e0dfa0955540ffac245287f [file] [log] [blame]
Zhonghui Fu431d4522015-03-18 15:54:27 +01001#ifndef PM_TRACE_H
2#define PM_TRACE_H
Linus Torvaldseb71c872006-06-24 14:27:42 -07003
4#ifdef CONFIG_PM_TRACE
Zhonghui Fu431d4522015-03-18 15:54:27 +01005#include <asm/pm-trace.h>
James Hogand33ac602010-10-12 00:00:25 +02006#include <linux/types.h>
Linus Torvaldseb71c872006-06-24 14:27:42 -07007
Rafael J. Wysockic5c6ba42006-09-25 23:32:58 -07008extern int pm_trace_enabled;
9
Rafael J. Wysocki5af84b82010-01-23 22:23:32 +010010static inline int pm_trace_is_enabled(void)
11{
12 return pm_trace_enabled;
13}
14
Linus Torvaldseb71c872006-06-24 14:27:42 -070015struct device;
16extern void set_trace_device(struct device *);
Zhonghui Fu431d4522015-03-18 15:54:27 +010017extern void generate_pm_trace(const void *tracedata, unsigned int user);
James Hogand33ac602010-10-12 00:00:25 +020018extern int show_trace_dev_match(char *buf, size_t size);
Linus Torvaldseb71c872006-06-24 14:27:42 -070019
Nigel Cunningham44bf4ce2007-07-21 17:10:41 +020020#define TRACE_DEVICE(dev) do { \
21 if (pm_trace_enabled) \
22 set_trace_device(dev); \
23 } while(0)
Linus Torvaldseb71c872006-06-24 14:27:42 -070024
25#else
26
Rafael J. Wysocki5af84b82010-01-23 22:23:32 +010027static inline int pm_trace_is_enabled(void) { return 0; }
28
Linus Torvaldseb71c872006-06-24 14:27:42 -070029#define TRACE_DEVICE(dev) do { } while (0)
30#define TRACE_RESUME(dev) do { } while (0)
Zhonghui Fu431d4522015-03-18 15:54:27 +010031#define TRACE_SUSPEND(dev) do { } while (0)
Linus Torvaldseb71c872006-06-24 14:27:42 -070032
33#endif
34
35#endif