aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorTodd E Brandt <todd.e.brandt@linux.intel.com>2014-06-06 08:40:17 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-06-06 18:18:07 -0400
commitbb3632c6101b2fad07e6246721466b984b1e0e9d (patch)
tree1f5755a94c7dfe2b2051411e0f08620b398a9059 /include/trace
parent3eba148d75670f61463dd3c9ef8672da8f290f36 (diff)
PM / sleep: trace events for suspend/resume
Adds trace events that give finer resolution into suspend/resume. These events are graphed in the timelines generated by the analyze_suspend.py script. They represent large areas of time consumed that are typical to suspend and resume. The event is triggered by calling the function "trace_suspend_resume" with three arguments: a string (the name of the event to be displayed in the timeline), an integer (case specific number, such as the power state or cpu number), and a boolean (where true is used to denote the start of the timeline event, and false to denote the end). The suspend_resume trace event reproduces the data that the machine_suspend trace event did, so the latter has been removed. Signed-off-by: Todd Brandt <todd.e.brandt@intel.com> Acked-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/power.h42
1 files changed, 25 insertions, 17 deletions
diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index 9a7e08d61258..f88c8573e66c 100644
--- a/include/trace/events/power.h
+++ b/include/trace/events/power.h
@@ -7,6 +7,9 @@
7#include <linux/ktime.h> 7#include <linux/ktime.h>
8#include <linux/pm_qos.h> 8#include <linux/pm_qos.h>
9#include <linux/tracepoint.h> 9#include <linux/tracepoint.h>
10#include <linux/ftrace_event.h>
11
12#define TPS(x) tracepoint_string(x)
10 13
11DECLARE_EVENT_CLASS(cpu, 14DECLARE_EVENT_CLASS(cpu,
12 15
@@ -97,23 +100,6 @@ DEFINE_EVENT(cpu, cpu_frequency,
97 TP_ARGS(frequency, cpu_id) 100 TP_ARGS(frequency, cpu_id)
98); 101);
99 102
100TRACE_EVENT(machine_suspend,
101
102 TP_PROTO(unsigned int state),
103
104 TP_ARGS(state),
105
106 TP_STRUCT__entry(
107 __field( u32, state )
108 ),
109
110 TP_fast_assign(
111 __entry->state = state;
112 ),
113
114 TP_printk("state=%lu", (unsigned long)__entry->state)
115);
116
117TRACE_EVENT(device_pm_report_time, 103TRACE_EVENT(device_pm_report_time,
118 104
119 TP_PROTO(struct device *dev, const char *pm_ops, s64 ops_time, 105 TP_PROTO(struct device *dev, const char *pm_ops, s64 ops_time,
@@ -151,6 +137,28 @@ TRACE_EVENT(device_pm_report_time,
151 __entry->ops_time, __entry->error) 137 __entry->ops_time, __entry->error)
152); 138);
153 139
140TRACE_EVENT(suspend_resume,
141
142 TP_PROTO(const char *action, int val, bool start),
143
144 TP_ARGS(action, val, start),
145
146 TP_STRUCT__entry(
147 __field(const char *, action)
148 __field(int, val)
149 __field(bool, start)
150 ),
151
152 TP_fast_assign(
153 __entry->action = action;
154 __entry->val = val;
155 __entry->start = start;
156 ),
157
158 TP_printk("%s[%u] %s", __entry->action, (unsigned int)__entry->val,
159 (__entry->start)?"begin":"end")
160);
161
154DECLARE_EVENT_CLASS(wakeup_source, 162DECLARE_EVENT_CLASS(wakeup_source,
155 163
156 TP_PROTO(const char *name, unsigned int state), 164 TP_PROTO(const char *name, unsigned int state),