lkml.org 
[lkml]   [2013]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] power: new trace event to print device suspend and resume time
From
Date
On Wed, 2013-07-17 at 09:57 -0600, Shuah Khan wrote:

> +TRACE_EVENT(device_pm_report_time,
> +
> + TP_PROTO(const char *device, const char *driver, const char *parent,
> + const char *pm_ops, ktime_t ops_time, char *pm_event_str,
> + int error),
> +
> + TP_ARGS(device, driver, parent, pm_ops, ops_time, pm_event_str, error),
> +
> + TP_STRUCT__entry(
> + __string(device, device)
> + __string(driver, driver)
> + __string(parent, parent)
> + __string(pm_ops, pm_ops)
> + __string(pm_event_str, pm_event_str)
> + __field(s64, ops_time)
> + __field(int, error)
> + ),
> +
> + TP_fast_assign(
> + __assign_str(device, device);
> + __assign_str(driver, driver);
> + __assign_str(parent, parent);
> + __assign_str(pm_ops, pm_ops);
> + __assign_str(pm_event_str, pm_event_str);
> + __entry->ops_time = ktime_to_ns(ops_time) >> 10;

You may want to just record the ops_time, and do the conversion in the
TP_printk(). This is the fast path, and any calculations done here just
increases the overhead of the trace point.

-- Steve

> + __entry->error = error;
> + ),
> +
> + TP_printk("%s %s parent=%s state=%s ops=%s usecs=%lld err=%d\n",
> + __get_str(driver), __get_str(device), __get_str(parent),
> + __get_str(pm_event_str), __get_str(pm_ops),
> + __entry->ops_time, __entry->error)
> +);
> +
> DECLARE_EVENT_CLASS(wakeup_source,
>
> TP_PROTO(const char *name, unsigned int state),




\
 
 \ /
  Last update: 2013-07-17 19:21    [W:0.054 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site