]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
sync: Dump fence information on timeout
authorArto Merilainen <amerilainen@nvidia.com>
Thu, 22 May 2014 09:00:04 +0000 (12:00 +0300)
committerRiham Haidar <rhaidar@nvidia.com>
Fri, 23 May 2014 19:47:00 +0000 (12:47 -0700)
Currently we print only the fence memory address if the fence
times out. This is not enough for debugging *why* the fence timed
out.

This patch modifies timeout routine so that we print the syncpoints
that relate to the current fence.

Bug 200006324

Change-Id: Iae103d4a4ba65584333e46de72240190699a0cef
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/413172
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/staging/android/sync.c

index 6a839fc6896e5ce014dce13344cc0c537bf782aa..f0df89ec9b35c08e32b450f7723ec19663c39ee5 100644 (file)
@@ -34,6 +34,7 @@
 static void sync_fence_signal_pt(struct sync_pt *pt);
 static int _sync_pt_has_signaled(struct sync_pt *pt);
 static void sync_fence_free(struct kref *kref);
+static void sync_fence_dump(struct sync_fence *fence);
 static void sync_dump(void);
 
 static LIST_HEAD(sync_timeline_list_head);
@@ -613,6 +614,7 @@ int sync_fence_wait(struct sync_fence *fence, long timeout)
 
        if (fence->status < 0) {
                pr_info("fence error %d on [%p]\n", fence->status, fence);
+               sync_fence_dump(fence);
                sync_dump();
                return fence->status;
        }
@@ -621,6 +623,7 @@ int sync_fence_wait(struct sync_fence *fence, long timeout)
                if (timeout > 0) {
                        pr_info("fence timeout on [%p] after %dms\n", fence,
                                jiffies_to_msecs(timeout));
+                       sync_fence_dump(fence);
                        sync_dump();
                }
                return -ETIME;
@@ -842,6 +845,21 @@ static long sync_fence_ioctl(struct file *file, unsigned int cmd,
        }
 }
 
+static void sync_fence_dump(struct sync_fence *fence)
+{
+       struct sync_pt *pt;
+       char val[32];
+
+       list_for_each_entry(pt, &fence->pt_list_head, pt_list) {
+               val[0] = '\0';
+               if (pt->parent->ops->pt_value_str)
+                       pt->parent->ops->pt_value_str(pt, val, sizeof(val));
+
+               pr_info("name=%s, value=%s\n", pt->parent->name, val);
+       }
+
+}
+
 #ifdef CONFIG_DEBUG_FS
 static const char *sync_status_str(int status)
 {