qcacmn: Reduce logging while printing channel list

As part of logging optimization, reduce logging while
printing channel lists.

Change-Id: I0241dc4dbaa3879bbe354a0e4750a0d559d1ba40
CRs-Fixed: 2624517
Bu işleme şunda yer alıyor:
Ashish Kumar Dhanotiya
2020-02-18 20:37:18 +05:30
işlemeyi yapan: nshrivas
ebeveyn a3a9160cf8
işleme 07810f61ce
4 değiştirilmiş dosya ile 27 ekleme ve 26 silme

Dosyayı Görüntüle

@@ -1285,8 +1285,9 @@ static inline void scm_print_scan_req_info(struct scan_req_params *req)
uint32_t buff_len;
char *chan_buff;
uint32_t len = 0;
uint8_t idx;
uint8_t idx, count = 0;
struct chan_list *chan_lst;
#define MAX_SCAN_FREQ_TO_PRINT 60
scm_nofl_debug("Scan start: scan id %d vdev %d Dwell time: act %d pass %d act_2G %d act_6G %d pass_6G %d, probe time %d n_probes %d flags %x ext_flag %x events %x policy %d wide_bw %d pri %d",
req->scan_id, req->vdev_id, req->dwell_time_active,
@@ -1309,16 +1310,25 @@ static inline void scm_print_scan_req_info(struct scan_req_params *req)
* Buffer of (num channl * 5) + 1 to consider the 4 char freq and
* 1 space after it for each channel and 1 to end the string with NULL.
*/
buff_len = (chan_lst->num_chan * 5) + 1;
buff_len =
(QDF_MIN(MAX_SCAN_FREQ_TO_PRINT, chan_lst->num_chan) * 5) + 1;
chan_buff = qdf_mem_malloc(buff_len);
if (!chan_buff)
return;
for (idx = 0; idx < chan_lst->num_chan; idx++)
scm_nofl_debug("Total freq %d", chan_lst->num_chan);
for (idx = 0; idx < chan_lst->num_chan; idx++) {
len += qdf_scnprintf(chan_buff + len, buff_len - len, "%d ",
chan_lst->chan[idx].freq);
scm_nofl_debug("Freq list[%d]: %s", chan_lst->num_chan, chan_buff);
count++;
if (count >= MAX_SCAN_FREQ_TO_PRINT) {
/* Print the MAX_SCAN_FREQ_TO_PRINT channels */
scm_nofl_debug("Freq list: %s", chan_buff);
len = 0;
count = 0;
}
}
if (len)
scm_nofl_debug("Freq list: %s", chan_buff);
qdf_mem_free(chan_buff);
}

Dosyayı Görüntüle

@@ -1915,12 +1915,9 @@ static QDF_STATUS send_roam_scan_offload_chan_list_cmd_tlv(wmi_unified_t wmi_han
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_UINT32,
(chan_list_fp->num_chan * sizeof(uint32_t)));
roam_chan_list_array = (uint32_t *) (buf_ptr + WMI_TLV_HDR_SIZE);
WMI_LOGD("%s: %d channels = ", __func__, chan_list_fp->num_chan);
for (i = 0; ((i < chan_list_fp->num_chan) &&
(i < WMI_ROAM_MAX_CHANNELS)); i++) {
(i < WMI_ROAM_MAX_CHANNELS)); i++)
roam_chan_list_array[i] = chan_list[i];
WMI_LOGD("%d,", roam_chan_list_array[i]);
}
wmi_mtrace(WMI_ROAM_CHAN_LIST, NO_SESSION, 0);
status = wmi_unified_cmd_send(wmi_handle, buf,
@@ -1931,7 +1928,6 @@ static QDF_STATUS send_roam_scan_offload_chan_list_cmd_tlv(wmi_unified_t wmi_han
goto error;
}
WMI_LOGD("%s: WMI --> WMI_ROAM_SCAN_CHAN_LIST", __func__);
return QDF_STATUS_SUCCESS;
error:
wmi_buf_free(buf);

Dosyayı Görüntüle

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -1956,17 +1956,12 @@ static QDF_STATUS send_pdev_set_pcl_cmd_tlv(wmi_unified_t wmi_handle,
wmi_handle,
WMI_HOST_PDEV_ID_SOC);
cmd->num_chan = chan_len;
WMI_LOGD("%s: Total chan (PCL) len:%d", __func__, cmd->num_chan);
buf_ptr += sizeof(wmi_pdev_set_pcl_cmd_fixed_param);
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_UINT32,
(chan_len * sizeof(uint32_t)));
cmd_args = (uint32_t *) (buf_ptr + WMI_TLV_HDR_SIZE);
for (i = 0; i < chan_len ; i++) {
for (i = 0; i < chan_len ; i++)
cmd_args[i] = msg->weighed_valid_list[i];
WMI_LOGD("%s: freq:%d weight:%d", __func__,
msg->saved_chan_list[i], cmd_args[i]);
}
wmi_mtrace(WMI_PDEV_SET_PCL_CMDID, NO_SESSION, 0);
if (wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_PDEV_SET_PCL_CMDID)) {

Dosyayı Görüntüle

@@ -3171,26 +3171,26 @@ static void wmi_scan_chanlist_dump(struct scan_chan_list_params *scan_chan_list)
{
uint32_t i;
uint8_t info[WMI_MAX_CHAN_INFO_LOG];
int len = 0;
uint32_t len = 0;
struct channel_param *chan;
int ret;
WMI_LOGD(FL("start (freq MHz, tx power dBm):"));
wmi_debug("Total chan %d", scan_chan_list->nallchans);
for (i = 0; i < scan_chan_list->nallchans; i++) {
chan = &scan_chan_list->ch_param[i];
ret = scnprintf(info + len, sizeof(info) - len, "%d %d ",
chan->mhz, chan->maxregpower);
ret = qdf_scnprintf(info + len, sizeof(info) - len,
" %d[%d][%d]", chan->mhz, chan->maxregpower,
chan->dfs_set);
if (ret <= 0)
break;
len += ret;
if (len >= (sizeof(info) - 20)) {
WMI_LOGD(FL("%s"), info);
wmi_nofl_debug("Chan[TXPwr][DFS]:%s", info);
len = 0;
}
}
if (len > 0)
WMI_LOGD(FL("%s"), info);
WMI_LOGD(FL("end total_count %d"), scan_chan_list->nallchans);
if (len)
wmi_nofl_debug("Chan[TXPwr][DFS]:%s", info);
}
static QDF_STATUS send_scan_chan_list_cmd_tlv(wmi_unified_t wmi_handle,