From 45ed4bbeaacf614c4a5769ecb197590d4269a471 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Mon, 18 Dec 2017 12:00:13 -0800 Subject: [PATCH] qcacld-3.0: Print drv ops inactive thread call stack As part of the wlan driver handlers for kernel ndo events, an inactivity timer (effectively a watchdog timer) is started. This allows us to catch instances where drvier operations take much longer than expected. In cases where this inactivity timer expires, print the stack trace of the inactive thread to expedite debugging efforts. Change-Id: I4427207a5cd7d232486ce453555765f7e0f4fe17 CRs-Fixed: 2160837 --- core/hdd/src/wlan_hdd_main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 305d51f9a164..77d0b306fdae 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -183,6 +183,7 @@ static struct attribute *attrs[] = { #define MAX_OPS_NAME_STRING_SIZE 20 static qdf_timer_t hdd_drv_ops_inactivity_timer; +static struct task_struct *hdd_drv_ops_task; static char drv_ops_string[MAX_OPS_NAME_STRING_SIZE]; /* the Android framework expects this param even though we don't use it */ @@ -13215,6 +13216,7 @@ void hdd_start_driver_ops_timer(int drv_op) break; } + hdd_drv_ops_task = current; qdf_timer_start(&hdd_drv_ops_inactivity_timer, HDD_OPS_INACTIVITY_TIMEOUT); } @@ -13240,6 +13242,13 @@ void hdd_drv_ops_inactivity_handler(void) hdd_err("%s: %d Sec timer expired while in .%s", __func__, HDD_OPS_INACTIVITY_TIMEOUT/1000, drv_ops_string); + if (hdd_drv_ops_task) { + printk("Call stack for \"%s\"\n", hdd_drv_ops_task->comm); + qdf_print_thread_trace(hdd_drv_ops_task); + } else { + hdd_err("hdd_drv_ops_task is null"); + } + /* Driver shutdown is stuck, no recovery possible at this point */ if (0 == qdf_mem_cmp(&drv_ops_string[0], "shutdown", sizeof("shutdown")))