qcacld-2.0: Dump stack only once

Add changes to dump stack only once. Also, change thread stuck
timer to 10 seconds from 5 seconds (THREAD_STUCK_TIMER_VAL) and
probe thread only when thread stuck counter is zero to avoid
out of wrapper messages. Remove unnecessary error logs also.

Change-Id: I6c2ab331256b190fd0ce67f8fb95ed4d7cb5e61a
CRs-Fixed: 1032098
This commit is contained in:
Padma, Santhosh Kumar 2016-06-21 14:26:44 +05:30 committed by syphyr
parent 5e02959d02
commit ef1abb3e96
2 changed files with 18 additions and 11 deletions

View File

@ -338,16 +338,16 @@ void vos_pkt_trace_buf_dump
v_U32_t slot, idx;
spin_lock_bh(&trace_buffer_lock);
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO,
"PACKET TRACE DUMP START Current Timestamp %u",
(unsigned int)vos_timer_get_system_time());
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO,
"ORDER : TIME : EVT");
if (VOS_PKT_TRAC_MAX_TRACE_BUF > trace_buffer_order)
{
for (slot = 0 ; slot < trace_buffer_order; slot++)
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO,
"%5d :%12u : %s",
trace_buffer[slot].order,
(unsigned int)trace_buffer[slot].event_time,
@ -359,7 +359,7 @@ void vos_pkt_trace_buf_dump
for (idx = 0 ; idx < VOS_PKT_TRAC_MAX_TRACE_BUF; idx++)
{
slot = (trace_buffer_order + idx) % VOS_PKT_TRAC_MAX_TRACE_BUF;
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO,
"%5d :%12u : %s",
trace_buffer[slot].order,
(unsigned int)trace_buffer[slot].event_time,
@ -367,7 +367,7 @@ void vos_pkt_trace_buf_dump
}
}
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO,
"PACKET TRACE DUMP END");
spin_unlock_bh(&trace_buffer_lock);

View File

@ -76,7 +76,8 @@
#define MAX_SSR_PROTECT_LOG (16)
/* Timer value for detecting thread stuck issues */
#define THREAD_STUCK_TIMER_VAL 5000 /* 5 seconds */
#define THREAD_STUCK_TIMER_VAL 10000 /* 10 seconds */
#define THREAD_STUCK_THRESHOLD 1
static atomic_t ssr_protect_entry_count;
static atomic_t load_unload_protect_count;
@ -988,12 +989,11 @@ static void vos_wd_detect_thread_stuck(void)
spin_lock_irqsave(&gpVosWatchdogContext->thread_stuck_lock, flags);
if (gpVosWatchdogContext->mc_thread_stuck_count) {
if (gpVosWatchdogContext->mc_thread_stuck_count ==
THREAD_STUCK_THRESHOLD) {
spin_unlock_irqrestore(&gpVosWatchdogContext->thread_stuck_lock,
flags);
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
"%s: Thread Stuck!!! MC Count %d", __func__,
gpVosWatchdogContext->mc_thread_stuck_count);
hddLog(LOGE, FL("MC Thread Stuck!!!"));
vos_dump_stack(gpVosSchedContext->McThread);
vos_flush_logs(WLAN_LOG_TYPE_FATAL,
@ -1004,11 +1004,18 @@ static void vos_wd_detect_thread_stuck(void)
flags);
}
if (!gpVosWatchdogContext->mc_thread_stuck_count) {
spin_unlock_irqrestore(&gpVosWatchdogContext->thread_stuck_lock,
flags);
vos_probe_threads();
spin_lock_irqsave(&gpVosWatchdogContext->thread_stuck_lock,
flags);
}
/* Increment the thread stuck count for all threads */
gpVosWatchdogContext->mc_thread_stuck_count++;
spin_unlock_irqrestore(&gpVosWatchdogContext->thread_stuck_lock, flags);
vos_probe_threads();
/* Restart the timer */
if (VOS_STATUS_SUCCESS !=