diff options
| author | Vinay Krishna Eranna <c_veran@qti.qualcomm.com> | 2014-06-26 22:25:19 +0530 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2014-07-28 19:45:28 -0700 |
| commit | cb3def7cb3b102dd2a6b2b24da1d6c0907991a95 (patch) | |
| tree | a2ed966ba13bef89cf02d8db0a9d565a26474fee | |
| parent | 38253c59a467234eb7e20ee6aa2d31af43e6068c (diff) | |
wlan: Avoid excessive logging from logger svc
Rate limit the error logs during low memory scenarios.
Change-Id: I29173fb3d288c3e5728b46e167159b171071467b
CRs-Fixed: 699595
| -rw-r--r-- | CORE/SVC/src/logging/wlan_logging_sock_svc.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/CORE/SVC/src/logging/wlan_logging_sock_svc.c b/CORE/SVC/src/logging/wlan_logging_sock_svc.c index 5c95fedc46c3..fc4bbbd98359 100644 --- a/CORE/SVC/src/logging/wlan_logging_sock_svc.c +++ b/CORE/SVC/src/logging/wlan_logging_sock_svc.c @@ -209,9 +209,10 @@ static int wlan_queue_logmsg_for_app(void) */ gwlan_logging.pcur_node = (struct log_msg *)(gwlan_logging.filled_list.next); + ++gwlan_logging.drop_count; if (gapp_pid != INVALID_PID && !gwlan_logging.is_buffer_free) { pr_err("%s: drop_count = %u index = %d filled_length = %d\n", - __func__, ++gwlan_logging.drop_count, + __func__, gwlan_logging.drop_count, gwlan_logging.pcur_node->index, gwlan_logging.pcur_node->filled_length); /* print above logs only 1st time. */ @@ -327,17 +328,23 @@ static int send_filled_buffers_to_user(void) struct nlmsghdr *nlh; static int nlmsg_seq; unsigned long flags; + static int rate_limit; while (!list_empty(&gwlan_logging.filled_list) && !gwlan_logging.exit) { skb = dev_alloc_skb(MAX_LOGMSG_LENGTH); if (skb == NULL) { - pr_err("%s: dev_alloc_skb() failed for msg size[%d]\n", - __func__, MAX_LOGMSG_LENGTH); + if (!rate_limit) { + pr_err("%s: dev_alloc_skb() failed for msg size[%d] drop count = %u\n", + __func__, MAX_LOGMSG_LENGTH, + gwlan_logging.drop_count); + } + rate_limit = 1; ret = -ENOMEM; break; } + rate_limit = 0; spin_lock_irqsave(&gwlan_logging.spin_lock, flags); @@ -405,6 +412,7 @@ static int send_filled_buffers_to_user(void) static int wlan_logging_thread(void *Arg) { int ret_wait_status = 0; + int ret = 0; set_user_nice(current, -2); @@ -434,7 +442,10 @@ static int wlan_logging_thread(void *Arg) continue; } - send_filled_buffers_to_user(); + ret = send_filled_buffers_to_user(); + if (-ENOMEM == ret) { + msleep(200); + } } complete_and_exit(&gwlan_logging.shutdown_comp, 0); |
