]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
sync: add API to get syncpt name
authorShridhar Rasal <srasal@nvidia.com>
Wed, 4 Jun 2014 12:12:18 +0000 (17:42 +0530)
committerRiham Haidar <rhaidar@nvidia.com>
Tue, 24 Jun 2014 05:50:44 +0000 (22:50 -0700)
Currently, we print only syncpoint id and on sync timeout.
Also print syncpoint name in dump.

Bug 200007874

Change-Id: Ia28a5b12b037a0b718bd4e5727f20c19d8badd87
Reviewed-on: http://git-master/r/418926
(cherry picked from commit e79d93d205ca2daba2974745113088222fa90297)
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/426604
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/staging/android/sync.c
drivers/staging/android/sync.h

index 60af5a157a18d45fc45d44a27e91ac042db5bbc4..eb8a5f58f9eee3a6d95eefc7aec993403c647907 100644 (file)
@@ -849,11 +849,16 @@ static void sync_fence_dump(struct sync_fence *fence)
 {
        struct sync_pt *pt;
        char val[32];
-       char current_val[64];
+       char current_val[32];
+       char name[32];
 
        list_for_each_entry(pt, &fence->pt_list_head, pt_list) {
                val[0] = '\0';
                current_val[0] = '\0';
+               name[0] = '\0';
+               if (pt->parent->ops->get_pt_name)
+                       pt->parent->ops->get_pt_name(pt, name, sizeof(name));
+
                if (pt->parent->ops->pt_value_str)
                        pt->parent->ops->pt_value_str(pt, val, sizeof(val));
 
@@ -862,8 +867,8 @@ static void sync_fence_dump(struct sync_fence *fence)
                                current_val,
                                sizeof(current_val));
 
-               pr_info("name=%s, current value=%s waiting value=%s\n",
-                       pt->parent->name, current_val, val);
+               pr_info("name=[%s:%s], current value=%s waiting value=%s\n",
+                       pt->parent->name, name, current_val, val);
        }
 
 }
index 75da9e85ac69762779200c10bdf3d766fdebd712..862662c0abc680cbf4640ae7fff78ee19b49219d 100644 (file)
@@ -48,6 +48,7 @@ struct sync_fence;
  *                       to userspace by SYNC_IOC_FENCE_INFO.
  * @timeline_value_str: fill str with the value of the sync_timeline's counter
  * @pt_value_str:      fill str with the value of the sync_pt
+ * @get_pt_name:       fill str with the name of the sync_pt
  */
 struct sync_timeline_ops {
        const char *driver_name;
@@ -83,6 +84,9 @@ struct sync_timeline_ops {
 
        /* optional */
        void (*pt_value_str)(struct sync_pt *pt, char *str, int size);
+
+       /* optional */
+       void (*get_pt_name)(struct sync_pt *pt, char *str, int size);
 };
 
 /**