lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <B8EFE96D1287C24090BAD9D858E15E6173C1B6@sisaex02sj>
Date:	Tue, 16 Jul 2013 22:04:03 +0000
From:	Shuah Khan <shuah.kh@...sung.com>
To:	Joe Perches <joe@...ches.com>
Cc:	"len.brown@...el.com" <len.brown@...el.com>,
	"pavel@....cz" <pavel@....cz>, "rjw@...k.pl" <rjw@...k.pl>,
	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	"rostedt@...dmis.org" <rostedt@...dmis.org>,
	"fweisbec@...il.com" <fweisbec@...il.com>,
	"mingo@...hat.com" <mingo@...hat.com>,
	"paul.gortmaker@...driver.com" <paul.gortmaker@...driver.com>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"shuahkhan@...il.com" <shuahkhan@...il.com>,
	Shuah Khan <shuah.kh@...sung.com>
Subject: Re: [PATCH] power: new trace event to print device suspend and resume
 time

On 07/16/2013 03:39 PM, Joe Perches wrote:
> On Tue, 2013-07-16 at 15:23 -0600, Shuah Khan wrote:
>> A new trace event is added to pm events to print time it takes to suspend and
>> resume a device. It generates trace message that includes device, driver,
>> parent information in addition to the type of pm ops invoked as well as the
>> pm event and error status from the pm ops. Example trace below:
>
>> diff --git a/include/trace/events/power.h b/include/trace/events/power.h
> []
>> @@ -66,6 +66,41 @@ TRACE_EVENT(machine_suspend,
>>   	TP_printk("state=%lu", (unsigned long)__entry->state)
>>   );
>>
>> +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(unsigned long long, ops_time)
>
> s64

Followed the ktime_t example in include/trace/events/timer.h - thinking 
it would be the correct way to cast ktime_t :)  I can change it to s64.


>
>> +		__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 = (unsigned long long)
>> +					ktime_to_ns(ops_time) >> 10;

Followed the ktime_t example in include/trace/events/timer.h - figured 
it would be the right one. I can change it.

>
> so no need for cast.
>
>> +		__entry->error = error;
>> +	),
>> +
>> +	TP_printk("%s driver(%s) parent(%s) %s %s (%llu usecs) err(%d)\n",
>
> %lld and no newline
>
>> +		__get_str(device), __get_str(driver), __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),
>
>
>

-- Shuah

Shuah Khan, Linux Kernel Developer - Open Source Group Samsung Research 
America (Silicon Valley) shuah.kh@...sung.com | (970) 672-0658
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ