android_kernel_samsung_msm8976/include/linux/rq_stats.h
Stephen Boyd eca2fd25fc soc: qcom: rq_stats: Always show idle time left
The def_timer_ms file indicates how much time has passed since we
wrote to the file to start the timer, but the time is only
updated when the work runs, instead of on demand when the file is
read. If we're poll(3)ing this file and another file and the
other file wakes our process up from sleep we won't know without
measuring time ourselves. Make this easier on userspace by always
showing the amount of time since we wrote the file so that we can
figure out how long we were asleep for.

Change-Id: I06135a94a41a5cd13454a92f2de7e63683ede4a5
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2014-12-09 18:01:58 -08:00

31 lines
1,022 B
C

/* Copyright (c) 2011,2013-2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
struct rq_data {
unsigned int rq_avg;
unsigned long rq_poll_jiffies;
unsigned long def_timer_jiffies;
unsigned long rq_poll_last_jiffy;
unsigned long rq_poll_total_jiffies;
unsigned long def_timer_last_jiffy;
unsigned int hotplug_disabled;
int64_t def_start_time;
struct attribute_group *attr_group;
struct kobject *kobj;
struct work_struct def_timer_work;
int init;
};
extern spinlock_t rq_lock;
extern struct rq_data rq_info;
extern struct workqueue_struct *rq_wq;