diff options
| author | Dustin Brown <dustinb@codeaurora.org> | 2016-10-20 17:39:31 -0700 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2016-10-28 18:04:40 -0700 |
| commit | b2cef911eb46f01506bb4c27e1360d4d52a0d26d (patch) | |
| tree | f34ddabd53ba240e1bddd78d7496864b81d220b7 | |
| parent | 6ddb1c06fb451984feee77383c4be6accacab3e7 (diff) | |
qcacld-3.0: Improve CDS SSR Protecting Logging
Any time SSR protect/unprotect fails, log a count of the pending
functions. Also, periodically dump the protection log when it is
full to help with debugging.
Change-Id: I926b2f8198a14cf0fac4138400e84a6a8ffedc73
CRs-Fixed: 1082070
(cherry picked from commit dfef826bf4883bc59ea1e6bd7dfb227567b95d1d)
| -rw-r--r-- | core/cds/src/cds_sched.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/core/cds/src/cds_sched.c b/core/cds/src/cds_sched.c index bc5827993843..89397046e80b 100644 --- a/core/cds/src/cds_sched.c +++ b/core/cds/src/cds_sched.c @@ -1392,8 +1392,9 @@ static void cds_print_external_threads(void) while (i < MAX_SSR_PROTECT_LOG) { if (!ssr_protect_log[i].free) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, - "PID %d is stuck at %s", ssr_protect_log[i].pid, - ssr_protect_log[i].func); + "PID %d is executing %s", + ssr_protect_log[i].pid, + ssr_protect_log[i].func); } i++; } @@ -1433,10 +1434,22 @@ void cds_ssr_protect(const char *caller_func) spin_unlock_irqrestore(&ssr_protect_lock, irq_flags); + /* + * Dump the protect log at intervals if count is consistently growing. + * Long running functions should tend to dominate the protect log, so + * hopefully, dumping at multiples of log size will prevent spamming the + * logs while telling us which calls are taking a long time to finish. + */ + if (count >= MAX_SSR_PROTECT_LOG && count % MAX_SSR_PROTECT_LOG == 0) { + QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, + "Protect Log overflow; Dumping contents:"); + cds_print_external_threads(); + } + if (!status) QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, - "Could not track PID %d call %s: log is full", - current->pid, caller_func); + "%s can not be protected; PID:%d, entry_count:%d", + caller_func, current->pid, count); } /** @@ -1474,7 +1487,8 @@ void cds_ssr_unprotect(const char *caller_func) if (!status) QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, - "Untracked call %s", caller_func); + "%s was not protected; PID:%d, entry_count:%d", + caller_func, current->pid, count); } /** @@ -1503,6 +1517,8 @@ bool cds_wait_for_external_threads_completion(const char *caller_func) } /* at least one external thread is executing */ if (!count) { + QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, + "Timed-out waiting for active entry points:"); cds_print_external_threads(); return false; } |
