aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Gilling <konkers@android.com>2012-03-15 14:59:33 -0700
committerErik Gilling <konkers@android.com>2012-04-18 14:08:13 -0700
commit2165ebdd429920bfbd915ed1c029fee8a4f17d2d (patch)
tree98e90951859dd726dedc1a102d9b1d3d8ce4c51c
parentd9259a27e3bc96a4f872777c9095ffa102ea1476 (diff)
downloadkernel_samsung_aries-2165ebdd429920bfbd915ed1c029fee8a4f17d2d.zip
kernel_samsung_aries-2165ebdd429920bfbd915ed1c029fee8a4f17d2d.tar.gz
kernel_samsung_aries-2165ebdd429920bfbd915ed1c029fee8a4f17d2d.tar.bz2
sync: add timestamps to sync_pts
Change-Id: I2ad855072b86873880769a09a3176e85aa1199d7 Signed-off-by: Erik Gilling <konkers@android.com>
-rw-r--r--drivers/base/sync.c5
-rw-r--r--include/linux/sync.h5
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/base/sync.c b/drivers/base/sync.c
index 4a8604b..ea0b664 100644
--- a/drivers/base/sync.c
+++ b/drivers/base/sync.c
@@ -155,12 +155,17 @@ void sync_pt_free(struct sync_pt *pt)
/* call with pt->parent->active_list_lock held */
static int _sync_pt_has_signaled(struct sync_pt *pt)
{
+ int old_status = pt->status;
+
if (!pt->status)
pt->status = pt->parent->ops->has_signaled(pt);
if (!pt->status && pt->parent->destroyed)
pt->status = -ENOENT;
+ if (pt->status != old_status)
+ pt->timestamp = ktime_get();
+
return pt->status;
}
diff --git a/include/linux/sync.h b/include/linux/sync.h
index 388acd1..a8e289d 100644
--- a/include/linux/sync.h
+++ b/include/linux/sync.h
@@ -16,6 +16,7 @@
#include <linux/types.h>
#ifdef __KERNEL__
+#include <linux/ktime.h>
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/wait.h>
@@ -90,6 +91,8 @@ struct sync_timeline {
* @fence: sync_fence to which the sync_pt belongs
* @pt_list: membership in sync_fence.pt_list_head
* @status: 1: signaled, 0:active, <0: error
+ * @timestamp: time which sync_pt status transitioned from active to
+ * singaled or error.
*/
struct sync_pt {
struct sync_timeline *parent;
@@ -102,6 +105,8 @@ struct sync_pt {
/* protected by parent->active_list_lock */
int status;
+
+ ktime_t timestamp;
};
/**