diff options
| author | Deepak Kumar <dkumar@codeaurora.org> | 2017-04-20 18:30:19 +0530 |
|---|---|---|
| committer | Deepak Kumar <dkumar@codeaurora.org> | 2017-04-21 10:55:52 +0530 |
| commit | 5ef49cfc5b0eb987598bf615d85da7e48d498934 (patch) | |
| tree | 36f09189ee62cb2389f584d0353eed9c855db015 | |
| parent | 6ee87610acf2927de5365f456ca0e6529f5c0d1a (diff) | |
staging: android: sync: Limit sync log dumping
Dump sync logs only when a fence is not signalled
for SYNC_DUMP_TIME_LIMIT or more. This is necessary
to reduce CPU hogging because of excessive sync logs
dumped due to fence timeouts which are less than
SYNC_DUMP_TIME_LIMIT and are harmless.
Change-Id: Id21a02925dd45a01361d096048a25d1879ebde9e
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
| -rw-r--r-- | drivers/staging/android/sync.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index 9b8d17ce3a5e..5238d67490ce 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -29,6 +29,7 @@ #include "sync.h" #define CREATE_TRACE_POINTS +#define SYNC_DUMP_TIME_LIMIT 7000 #include "trace/sync.h" static const struct fence_ops android_fence_ops; @@ -392,7 +393,9 @@ int sync_fence_wait(struct sync_fence *fence, long timeout) if (timeout) { pr_info("fence timeout on [%pK] after %dms\n", fence, jiffies_to_msecs(timeout)); - sync_dump(); + if (jiffies_to_msecs(timeout) >= + SYNC_DUMP_TIME_LIMIT) + sync_dump(); } return -ETIME; } |
