qcacld-3.0: Update log to console INI to support per log level

Currently, the INI param wlanLoggingToConsole is used to enable
or disable WLAN logging to console. It will enable/disable console
logs for all log levels i.e. FATAL/ERROR/WARN/INFO. There is no
provision to enable/disable console logs for specific log level.

To address this, change wlanLoggingToConsole INI as bitmap with each
bit representing a log level. Enable/disable console logs based on
this bitmap.

Change-Id: I139ed15e37eb27fcfedcae70d78344e9f978f837
CRs-Fixed: 2734699
This commit is contained in:
Bapiraju Alla 2020-07-16 23:54:04 +05:30 • committed by snandini
commit f9b7e0875c
3 changed files with 27 additions and 11 deletions

View file

@ -339,16 +339,33 @@ enum hdd_dot11_mode {
/*
* <ini>
* wlanLoggingToConsole - Wlan logging to console
* @Min: 0
* @Max: 1
* @Default: 1
* wlanConsoleLogLevelsBitmap - Bitmap to enable/disable console log levels
* @Min: 0x00000000
* @Max: 0x000003ff
* @Default: 0x0000001e
*
* This INI is used to enable/disable console logs for specific log level.
*
* bit-0: Reserved
* bit-1: QDF_TRACE_LEVEL_FATAL
* bit-2: QDF_TRACE_LEVEL_ERROR
* bit-3: QDF_TRACE_LEVEL_WARN
* bit-4: QDF_TRACE_LEVEL_INFO
* bit-5: QDF_TRACE_LEVEL_INFO_HIGH
* bit-6: QDF_TRACE_LEVEL_INFO_MED
* bit-7: QDF_TRACE_LEVEL_INFO_LOW
* bit-8: QDF_TRACE_LEVEL_DEBUG
* bit-9: QDF_TRACE_LEVEL_TRACE
* bit-10 to bit-31: Reserved
*
* </ini>
*/
#define CFG_WLAN_LOGGING_CONSOLE_SUPPORT CFG_INI_BOOL( \
"wlanLoggingToConsole", \
1, \
#define CFG_WLAN_LOGGING_CONSOLE_SUPPORT CFG_INI_UINT( \
"wlanConsoleLogLevelsBitmap", \
0x00000000, \
0x000003ff, \
0x0000001e, \
CFG_VALUE_OR_DEFAULT, \
"Wlan logging to console")
#define CFG_WLAN_LOGGING_SUPPORT_ALL \

View file

@ -137,7 +137,7 @@ struct hdd_config {
#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE
/* WLAN Logging */
bool wlan_logging_enable;
bool wlan_logging_to_console;
uint32_t wlan_console_log_levels;
uint8_t host_log_custom_nl_proto;
#endif /* WLAN_LOGGING_SOCK_SVC_ENABLE */

View file

@ -11268,8 +11268,7 @@ static void hdd_psoc_idle_timeout_callback(void *priv)
#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE
static void hdd_set_wlan_logging(struct hdd_context *hdd_ctx)
{
wlan_logging_set_log_to_console(hdd_ctx->config->
wlan_logging_to_console);
wlan_set_console_log_levels(hdd_ctx->config->wlan_console_log_levels);
wlan_logging_set_active(hdd_ctx->config->wlan_logging_enable);
}
#else
@ -11283,7 +11282,7 @@ static void hdd_init_wlan_logging_params(struct hdd_config *config,
{
config->wlan_logging_enable = cfg_get(psoc, CFG_WLAN_LOGGING_SUPPORT);
config->wlan_logging_to_console =
config->wlan_console_log_levels =
cfg_get(psoc, CFG_WLAN_LOGGING_CONSOLE_SUPPORT);
config->host_log_custom_nl_proto =
cfg_get(psoc, CFG_HOST_LOG_CUSTOM_NETLINK_PROTO);