pm-trace.h 901 Bytes
Newer Older
1 2
#ifndef PM_TRACE_H
#define PM_TRACE_H
3

4
#include <linux/types.h>
5
#ifdef CONFIG_PM_TRACE
6
#include <asm/pm-trace.h>
7

8
extern int pm_trace_enabled;
9 10 11 12 13 14
extern bool pm_trace_rtc_abused;

static inline bool pm_trace_rtc_valid(void)
{
	return !pm_trace_rtc_abused;
}
15

16 17 18 19 20
static inline int pm_trace_is_enabled(void)
{
       return pm_trace_enabled;
}

21 22
struct device;
extern void set_trace_device(struct device *);
23
extern void generate_pm_trace(const void *tracedata, unsigned int user);
24
extern int show_trace_dev_match(char *buf, size_t size);
25

Nigel Cunningham's avatar
Nigel Cunningham committed
26 27 28 29
#define TRACE_DEVICE(dev) do { \
	if (pm_trace_enabled) \
		set_trace_device(dev); \
	} while(0)
30 31 32

#else

33
static inline bool pm_trace_rtc_valid(void) { return true; }
34 35
static inline int pm_trace_is_enabled(void) { return 0; }

36 37
#define TRACE_DEVICE(dev) do { } while (0)
#define TRACE_RESUME(dev) do { } while (0)
38
#define TRACE_SUSPEND(dev) do { } while (0)
39 40 41 42

#endif

#endif