blob: 7b78793f07d7df692aea26feae8b756185016ab8 [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
Chen Yuba58d102016-11-28 14:35:19 -08004#include <linux/types.h>
Linus Torvaldseb71c872006-06-24 14:27:42 -07005#ifdef CONFIG_PM_TRACE
Zhonghui Fu431d4522015-03-18 15:54:27 +01006#include <asm/pm-trace.h>
Linus Torvaldseb71c872006-06-24 14:27:42 -07007
Rafael J. Wysockic5c6ba42006-09-25 23:32:58 -07008extern int pm_trace_enabled;
Chen Yuba58d102016-11-28 14:35:19 -08009extern bool pm_trace_rtc_abused;
10
11static inline bool pm_trace_rtc_valid(void)
12{
13 return !pm_trace_rtc_abused;
14}
Rafael J. Wysockic5c6ba42006-09-25 23:32:58 -070015
Rafael J. Wysocki5af84b82010-01-23 22:23:32 +010016static inline int pm_trace_is_enabled(void)
17{
18 return pm_trace_enabled;
19}
20
Linus Torvaldseb71c872006-06-24 14:27:42 -070021struct device;
22extern void set_trace_device(struct device *);
Zhonghui Fu431d4522015-03-18 15:54:27 +010023extern void generate_pm_trace(const void *tracedata, unsigned int user);
James Hogand33ac602010-10-12 00:00:25 +020024extern int show_trace_dev_match(char *buf, size_t size);
Linus Torvaldseb71c872006-06-24 14:27:42 -070025
Nigel Cunningham44bf4ce2007-07-21 17:10:41 +020026#define TRACE_DEVICE(dev) do { \
27 if (pm_trace_enabled) \
28 set_trace_device(dev); \
29 } while(0)
Linus Torvaldseb71c872006-06-24 14:27:42 -070030
31#else
32
Chen Yuba58d102016-11-28 14:35:19 -080033static inline bool pm_trace_rtc_valid(void) { return true; }
Rafael J. Wysocki5af84b82010-01-23 22:23:32 +010034static inline int pm_trace_is_enabled(void) { return 0; }
35
Linus Torvaldseb71c872006-06-24 14:27:42 -070036#define TRACE_DEVICE(dev) do { } while (0)
37#define TRACE_RESUME(dev) do { } while (0)
Zhonghui Fu431d4522015-03-18 15:54:27 +010038#define TRACE_SUSPEND(dev) do { } while (0)
Linus Torvaldseb71c872006-06-24 14:27:42 -070039
40#endif
41
42#endif