summaryrefslogtreecommitdiff
path: root/include/trace
diff options
context:
space:
mode:
authorTodd E Brandt <todd.e.brandt@linux.intel.com>2014-06-06 05:40:17 -0700
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-06-07 00:18:07 +0200
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 @@
#include <linux/ktime.h>
#include <linux/pm_qos.h>
#include <linux/tracepoint.h>
+#include <linux/ftrace_event.h>
+
+#define TPS(x) tracepoint_string(x)
DECLARE_EVENT_CLASS(cpu,
@@ -97,23 +100,6 @@ DEFINE_EVENT(cpu, cpu_frequency,
TP_ARGS(frequency, cpu_id)
);
-TRACE_EVENT(machine_suspend,
-
- TP_PROTO(unsigned int state),
-
- TP_ARGS(state),
-
- TP_STRUCT__entry(
- __field( u32, state )
- ),
-
- TP_fast_assign(
- __entry->state = state;
- ),
-
- TP_printk("state=%lu", (unsigned long)__entry->state)
-);
-
TRACE_EVENT(device_pm_report_time,
TP_PROTO(struct device *dev, const char *pm_ops, s64 ops_time,
@@ -151,6 +137,28 @@ TRACE_EVENT(device_pm_report_time,
__entry->ops_time, __entry->error)
);
+TRACE_EVENT(suspend_resume,
+
+ TP_PROTO(const char *action, int val, bool start),
+
+ TP_ARGS(action, val, start),
+
+ TP_STRUCT__entry(
+ __field(const char *, action)
+ __field(int, val)
+ __field(bool, start)
+ ),
+
+ TP_fast_assign(
+ __entry->action = action;
+ __entry->val = val;
+ __entry->start = start;
+ ),
+
+ TP_printk("%s[%u] %s", __entry->action, (unsigned int)__entry->val,
+ (__entry->start)?"begin":"end")
+);
+
DECLARE_EVENT_CLASS(wakeup_source,
TP_PROTO(const char *name, unsigned int state),