diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-10-07 17:16:55 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-10-07 17:16:55 -0400 |
commit | d727b60659a1173eb4142a5fc521ce67c28b34e1 (patch) | |
tree | 793d0fc86ecf98331024db5c86bc271cc72aa2d2 /include/trace | |
parent | 3ee72ca99288f1de95ec9c570e43f531c8799f06 (diff) | |
parent | 2a5306cc5f383b0e7414c75e458111afd4a563a4 (diff) |
Merge branch 'pm-runtime' into pm-for-linus
* pm-runtime:
PM / Tracing: build rpm-traces.c only if CONFIG_PM_RUNTIME is set
PM / Runtime: Replace dev_dbg() with trace_rpm_*()
PM / Runtime: Introduce trace points for tracing rpm_* functions
PM / Runtime: Don't run callbacks under lock for power.irq_safe set
USB: Add wakeup info to debugging messages
PM / Runtime: pm_runtime_idle() can be called in atomic context
PM / Runtime: Add macro to test for runtime PM events
PM / Runtime: Add might_sleep() to runtime PM functions
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/rpm.h | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/include/trace/events/rpm.h b/include/trace/events/rpm.h new file mode 100644 index 000000000000..d62c558bf64b --- /dev/null +++ b/include/trace/events/rpm.h | |||
@@ -0,0 +1,99 @@ | |||
1 | |||
2 | #undef TRACE_SYSTEM | ||
3 | #define TRACE_SYSTEM rpm | ||
4 | |||
5 | #if !defined(_TRACE_RUNTIME_POWER_H) || defined(TRACE_HEADER_MULTI_READ) | ||
6 | #define _TRACE_RUNTIME_POWER_H | ||
7 | |||
8 | #include <linux/ktime.h> | ||
9 | #include <linux/tracepoint.h> | ||
10 | #include <linux/device.h> | ||
11 | |||
12 | /* | ||
13 | * The rpm_internal events are used for tracing some important | ||
14 | * runtime pm internal functions. | ||
15 | */ | ||
16 | DECLARE_EVENT_CLASS(rpm_internal, | ||
17 | |||
18 | TP_PROTO(struct device *dev, int flags), | ||
19 | |||
20 | TP_ARGS(dev, flags), | ||
21 | |||
22 | TP_STRUCT__entry( | ||
23 | __string( name, dev_name(dev) ) | ||
24 | __field( int, flags ) | ||
25 | __field( int , usage_count ) | ||
26 | __field( int , disable_depth ) | ||
27 | __field( int , runtime_auto ) | ||
28 | __field( int , request_pending ) | ||
29 | __field( int , irq_safe ) | ||
30 | __field( int , child_count ) | ||
31 | ), | ||
32 | |||
33 | TP_fast_assign( | ||
34 | __assign_str(name, dev_name(dev)); | ||
35 | __entry->flags = flags; | ||
36 | __entry->usage_count = atomic_read( | ||
37 | &dev->power.usage_count); | ||
38 | __entry->disable_depth = dev->power.disable_depth; | ||
39 | __entry->runtime_auto = dev->power.runtime_auto; | ||
40 | __entry->request_pending = dev->power.request_pending; | ||
41 | __entry->irq_safe = dev->power.irq_safe; | ||
42 | __entry->child_count = atomic_read( | ||
43 | &dev->power.child_count); | ||
44 | ), | ||
45 | |||
46 | TP_printk("%s flags-%x cnt-%-2d dep-%-2d auto-%-1d p-%-1d" | ||
47 | " irq-%-1d child-%d", | ||
48 | __get_str(name), __entry->flags, | ||
49 | __entry->usage_count, | ||
50 | __entry->disable_depth, | ||
51 | __entry->runtime_auto, | ||
52 | __entry->request_pending, | ||
53 | __entry->irq_safe, | ||
54 | __entry->child_count | ||
55 | ) | ||
56 | ); | ||
57 | DEFINE_EVENT(rpm_internal, rpm_suspend, | ||
58 | |||
59 | TP_PROTO(struct device *dev, int flags), | ||
60 | |||
61 | TP_ARGS(dev, flags) | ||
62 | ); | ||
63 | DEFINE_EVENT(rpm_internal, rpm_resume, | ||
64 | |||
65 | TP_PROTO(struct device *dev, int flags), | ||
66 | |||
67 | TP_ARGS(dev, flags) | ||
68 | ); | ||
69 | DEFINE_EVENT(rpm_internal, rpm_idle, | ||
70 | |||
71 | TP_PROTO(struct device *dev, int flags), | ||
72 | |||
73 | TP_ARGS(dev, flags) | ||
74 | ); | ||
75 | |||
76 | TRACE_EVENT(rpm_return_int, | ||
77 | TP_PROTO(struct device *dev, unsigned long ip, int ret), | ||
78 | TP_ARGS(dev, ip, ret), | ||
79 | |||
80 | TP_STRUCT__entry( | ||
81 | __string( name, dev_name(dev)) | ||
82 | __field( unsigned long, ip ) | ||
83 | __field( int, ret ) | ||
84 | ), | ||
85 | |||
86 | TP_fast_assign( | ||
87 | __assign_str(name, dev_name(dev)); | ||
88 | __entry->ip = ip; | ||
89 | __entry->ret = ret; | ||
90 | ), | ||
91 | |||
92 | TP_printk("%pS:%s ret=%d", (void *)__entry->ip, __get_str(name), | ||
93 | __entry->ret) | ||
94 | ); | ||
95 | |||
96 | #endif /* _TRACE_RUNTIME_POWER_H */ | ||
97 | |||
98 | /* This part must be outside protection */ | ||
99 | #include <trace/define_trace.h> | ||