Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363275
b: refs/heads/master
c: f56388f
h: refs/heads/master
i:
  363273: 68fa963
  363271: 60e7405
v: v3
  • Loading branch information
Erik Gilling authored and Greg Kroah-Hartman committed Mar 4, 2013
1 parent 0195c73 commit e961e19
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3b640f5dd050f972439e5c67ba618a5377b61d34
refs/heads/master: f56388f3bd15a853d5718bf31c5d4dbc8f499cbe
34 changes: 32 additions & 2 deletions trunk/drivers/staging/android/sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,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_dump(void);

static LIST_HEAD(sync_timeline_list_head);
static DEFINE_SPINLOCK(sync_timeline_list_lock);
Expand Down Expand Up @@ -574,8 +575,10 @@ int sync_fence_wait(struct sync_fence *fence, long timeout)
if (fence->status < 0)
return fence->status;

if (fence->status == 0)
if (fence->status == 0) {
sync_dump();
return -ETIME;
}

return 0;
}
Expand Down Expand Up @@ -914,7 +917,34 @@ static __init int sync_debugfs_init(void)
debugfs_create_file("sync", S_IRUGO, NULL, NULL, &sync_debugfs_fops);
return 0;
}

late_initcall(sync_debugfs_init);

#define DUMP_CHUNK 256
static char sync_dump_buf[64 * 1024];
void sync_dump(void)
{
struct seq_file s = {
.buf = sync_dump_buf,
.size = sizeof(sync_dump_buf) - 1,
};
int i;

sync_debugfs_show(&s, NULL);

for (i = 0; i < s.count; i += DUMP_CHUNK) {
if ((s.count - i) > DUMP_CHUNK) {
char c = s.buf[i + DUMP_CHUNK];
s.buf[i + DUMP_CHUNK] = 0;
pr_cont("%s", s.buf + i);
s.buf[i + DUMP_CHUNK] = c;
} else {
s.buf[s.count] = 0;
pr_cont("%s", s.buf + i);
}
}
}
#else
static void sync_dump(void)
{
}
#endif

0 comments on commit e961e19

Please sign in to comment.