qcacmn: Prevent rate stats from printing in kmsg

Do not print rate statistics on the console or kernel logs. Excessive
logging in kernel messages can lead to kernel panic.

Change DP_PRINT_STATS to not print in kernel logs.

Note that this is an interim solution. Ideally these prints from DP
module should be QDF_TRACE_LEVEL_DEBUG and logged to QXDM. Currently
DEBUG trace level is disabled for DP module.

Change-Id: I54af98eda0dd4ea53ae20f25ced6b03287d8b4e4
CRs-Fixed: 2414635
This commit is contained in:
Mohit Khanna
2019-03-18 14:30:01 -07:00
committed by nshrivas
parent cba07b4883
commit 3d1e1b7602
3 changed files with 32 additions and 27 deletions

View File

@@ -68,10 +68,16 @@ while (0)
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_##LVL, \ QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_##LVL, \
fmt, ## args) fmt, ## args)
#define DP_PRINT_STATS(fmt, args ...) \ #ifdef CONFIG_MCL
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, \ /* Stat prints should not go to console or kernel logs.*/
fmt, ## args) #define DP_PRINT_STATS(fmt, args ...)\
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO_HIGH, \
fmt, ## args)
#else
#define DP_PRINT_STATS(fmt, args ...)\
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,\
fmt, ## args)
#endif
#define DP_STATS_INIT(_handle) \ #define DP_STATS_INIT(_handle) \
qdf_mem_zero(&((_handle)->stats), sizeof((_handle)->stats)) qdf_mem_zero(&((_handle)->stats), sizeof((_handle)->stats))

View File

@@ -8660,9 +8660,8 @@ QDF_STATUS dp_txrx_stats_request(struct cdp_vdev *vdev,
fw_stats = dp_stats_mapping_table[stats][STATS_FW]; fw_stats = dp_stats_mapping_table[stats][STATS_FW];
host_stats = dp_stats_mapping_table[stats][STATS_HOST]; host_stats = dp_stats_mapping_table[stats][STATS_HOST];
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO, dp_info("stats: %u fw_stats_type: %d host_stats: %d",
"stats: %u fw_stats_type: %d host_stats: %d", stats, fw_stats, host_stats);
stats, fw_stats, host_stats);
if (fw_stats != TXRX_FW_STATS_INVALID) { if (fw_stats != TXRX_FW_STATS_INVALID) {
/* update request with FW stats type */ /* update request with FW stats type */

View File

@@ -2464,18 +2464,18 @@ static inline void dp_print_tx_pdev_rate_stats_tlv(uint32_t *tag_buf)
tx_gi[i] = (char *)qdf_mem_malloc(DP_MAX_STRING_LEN); tx_gi[i] = (char *)qdf_mem_malloc(DP_MAX_STRING_LEN);
} }
DP_TRACE_STATS(FATAL, "HTT_TX_PDEV_RATE_STATS_TLV:"); DP_PRINT_STATS("HTT_TX_PDEV_RATE_STATS_TLV:");
DP_TRACE_STATS(FATAL, "mac_id__word = %u", DP_PRINT_STATS("mac_id__word = %u",
dp_stats_buf->mac_id__word); dp_stats_buf->mac_id__word);
DP_TRACE_STATS(FATAL, "tx_ldpc = %u", DP_PRINT_STATS("tx_ldpc = %u",
dp_stats_buf->tx_ldpc); dp_stats_buf->tx_ldpc);
DP_TRACE_STATS(FATAL, "rts_cnt = %u", DP_PRINT_STATS("rts_cnt = %u",
dp_stats_buf->rts_cnt); dp_stats_buf->rts_cnt);
DP_TRACE_STATS(FATAL, "rts_success = %u", DP_PRINT_STATS("rts_success = %u",
dp_stats_buf->rts_success); dp_stats_buf->rts_success);
DP_TRACE_STATS(FATAL, "ack_rssi = %u", DP_PRINT_STATS("ack_rssi = %u",
dp_stats_buf->ack_rssi); dp_stats_buf->ack_rssi);
qdf_mem_zero(str_buf, DP_MAX_STRING_LEN); qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
for (i = 0; i < DP_HTT_TX_MCS_LEN; i++) { for (i = 0; i < DP_HTT_TX_MCS_LEN; i++) {
@@ -2483,7 +2483,7 @@ static inline void dp_print_tx_pdev_rate_stats_tlv(uint32_t *tag_buf)
DP_MAX_STRING_LEN - index, DP_MAX_STRING_LEN - index,
" %u:%u,", i, dp_stats_buf->tx_mcs[i]); " %u:%u,", i, dp_stats_buf->tx_mcs[i]);
} }
DP_TRACE_STATS(FATAL, "tx_mcs = %s ", str_buf); DP_PRINT_STATS("tx_mcs = %s ", str_buf);
index = 0; index = 0;
qdf_mem_zero(str_buf, DP_MAX_STRING_LEN); qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
@@ -2492,7 +2492,7 @@ static inline void dp_print_tx_pdev_rate_stats_tlv(uint32_t *tag_buf)
DP_MAX_STRING_LEN - index, DP_MAX_STRING_LEN - index,
" %u:%u,", i, dp_stats_buf->tx_su_mcs[i]); " %u:%u,", i, dp_stats_buf->tx_su_mcs[i]);
} }
DP_TRACE_STATS(FATAL, "tx_su_mcs = %s ", str_buf); DP_PRINT_STATS("tx_su_mcs = %s ", str_buf);
index = 0; index = 0;
qdf_mem_zero(str_buf, DP_MAX_STRING_LEN); qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
@@ -2501,7 +2501,7 @@ static inline void dp_print_tx_pdev_rate_stats_tlv(uint32_t *tag_buf)
DP_MAX_STRING_LEN - index, DP_MAX_STRING_LEN - index,
" %u:%u,", i, dp_stats_buf->tx_mu_mcs[i]); " %u:%u,", i, dp_stats_buf->tx_mu_mcs[i]);
} }
DP_TRACE_STATS(FATAL, "tx_mu_mcs = %s ", str_buf); DP_PRINT_STATS("tx_mu_mcs = %s ", str_buf);
index = 0; index = 0;
qdf_mem_zero(str_buf, DP_MAX_STRING_LEN); qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
@@ -2512,7 +2512,7 @@ static inline void dp_print_tx_pdev_rate_stats_tlv(uint32_t *tag_buf)
" %u:%u,", (i + 1), " %u:%u,", (i + 1),
dp_stats_buf->tx_nss[i]); dp_stats_buf->tx_nss[i]);
} }
DP_TRACE_STATS(FATAL, "tx_nss = %s ", str_buf); DP_PRINT_STATS("tx_nss = %s ", str_buf);
index = 0; index = 0;
qdf_mem_zero(str_buf, DP_MAX_STRING_LEN); qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
@@ -2521,7 +2521,7 @@ static inline void dp_print_tx_pdev_rate_stats_tlv(uint32_t *tag_buf)
DP_MAX_STRING_LEN - index, DP_MAX_STRING_LEN - index,
" %u:%u,", i, dp_stats_buf->tx_bw[i]); " %u:%u,", i, dp_stats_buf->tx_bw[i]);
} }
DP_TRACE_STATS(FATAL, "tx_bw = %s ", str_buf); DP_PRINT_STATS("tx_bw = %s ", str_buf);
index = 0; index = 0;
qdf_mem_zero(str_buf, DP_MAX_STRING_LEN); qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
@@ -2530,7 +2530,7 @@ static inline void dp_print_tx_pdev_rate_stats_tlv(uint32_t *tag_buf)
DP_MAX_STRING_LEN - index, DP_MAX_STRING_LEN - index,
" %u:%u,", i, dp_stats_buf->tx_stbc[i]); " %u:%u,", i, dp_stats_buf->tx_stbc[i]);
} }
DP_TRACE_STATS(FATAL, "tx_stbc = %s ", str_buf); DP_PRINT_STATS("tx_stbc = %s ", str_buf);
index = 0; index = 0;
qdf_mem_zero(str_buf, DP_MAX_STRING_LEN); qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
@@ -2539,7 +2539,7 @@ static inline void dp_print_tx_pdev_rate_stats_tlv(uint32_t *tag_buf)
DP_MAX_STRING_LEN - index, DP_MAX_STRING_LEN - index,
" %u:%u,", i, dp_stats_buf->tx_pream[i]); " %u:%u,", i, dp_stats_buf->tx_pream[i]);
} }
DP_TRACE_STATS(FATAL, "tx_pream = %s ", str_buf); DP_PRINT_STATS("tx_pream = %s ", str_buf);
for (j = 0; j < DP_HTT_PDEV_TX_GI_LEN; j++) { for (j = 0; j < DP_HTT_PDEV_TX_GI_LEN; j++) {
index = 0; index = 0;
@@ -2549,7 +2549,7 @@ static inline void dp_print_tx_pdev_rate_stats_tlv(uint32_t *tag_buf)
" %u:%u,", i, " %u:%u,", i,
dp_stats_buf->tx_gi[j][i]); dp_stats_buf->tx_gi[j][i]);
} }
DP_TRACE_STATS(FATAL, "tx_gi[%u] = %s ", j, tx_gi[j]); DP_PRINT_STATS("tx_gi[%u] = %s ", j, tx_gi[j]);
} }
index = 0; index = 0;
@@ -2559,7 +2559,7 @@ static inline void dp_print_tx_pdev_rate_stats_tlv(uint32_t *tag_buf)
DP_MAX_STRING_LEN - index, DP_MAX_STRING_LEN - index,
" %u:%u,", i, dp_stats_buf->tx_dcm[i]); " %u:%u,", i, dp_stats_buf->tx_dcm[i]);
} }
DP_TRACE_STATS(FATAL, "tx_dcm = %s\n", str_buf); DP_PRINT_STATS("tx_dcm = %s\n", str_buf);
for (i = 0; i < HTT_TX_PEER_STATS_NUM_GI_COUNTERS; i++) for (i = 0; i < HTT_TX_PEER_STATS_NUM_GI_COUNTERS; i++)
qdf_mem_free(tx_gi[i]); qdf_mem_free(tx_gi[i]);