qcacld-3.0: Add driver command to dump function call mapping
Add driver command support to dump all the function call mapping which is cached in global buffer. Change-Id: I03b2162ccda171005e6fa8a7bb09cbf9c4819421 CRs-Fixed: 2677976
This commit is contained in:
parent
3c8f4c40b5
commit
0e86934fd2
3
Kbuild
3
Kbuild
@ -733,6 +733,7 @@ QDF_OBJS := \
|
||||
$(QDF_LINUX_OBJ_DIR)/qdf_delayed_work.o \
|
||||
$(QDF_LINUX_OBJ_DIR)/qdf_event.o \
|
||||
$(QDF_LINUX_OBJ_DIR)/qdf_file.o \
|
||||
$(QDF_LINUX_OBJ_DIR)/qdf_func_tracker.o \
|
||||
$(QDF_LINUX_OBJ_DIR)/qdf_idr.o \
|
||||
$(QDF_LINUX_OBJ_DIR)/qdf_list.o \
|
||||
$(QDF_LINUX_OBJ_DIR)/qdf_lock.o \
|
||||
@ -3197,6 +3198,8 @@ cppflags-$(CONFIG_ENABLE_SMMU_S1_TRANSLATION) += -DENABLE_SMMU_S1_TRANSLATION
|
||||
#Flag to enable/disable MTRACE feature
|
||||
cppflags-$(CONFIG_ENABLE_MTRACE_LOG) += -DENABLE_MTRACE_LOG
|
||||
|
||||
cppflags-$(CONFIG_FUNC_CALL_MAP) += -DFUNC_CALL_MAP
|
||||
|
||||
#Flag to enable/disable Adaptive 11r feature
|
||||
cppflags-$(CONFIG_ADAPTIVE_11R) += -DWLAN_ADAPTIVE_11R
|
||||
|
||||
|
@ -862,6 +862,9 @@ CONFIG_ENABLE_MTRACE_LOG := y
|
||||
#Flag to enable nud tracking feature
|
||||
CONFIG_WLAN_NUD_TRACKING := y
|
||||
|
||||
#Flag to enable/Disable Function call trace
|
||||
CONFIG_FUNC_CALL_MAP := n
|
||||
|
||||
#Flag to enable wbuff feature
|
||||
CONFIG_WLAN_WBUFF := y
|
||||
|
||||
|
@ -45,6 +45,7 @@
|
||||
#include "hif.h"
|
||||
#include "wlan_scan_ucfg_api.h"
|
||||
#include "wlan_reg_ucfg_api.h"
|
||||
#include "qdf_func_tracker.h"
|
||||
|
||||
#if defined(LINUX_QCMBR)
|
||||
#define SIOCIOCTLTX99 (SIOCDEVPRIVATE+13)
|
||||
@ -6798,6 +6799,69 @@ static int drv_cmd_get_ani_level(struct hdd_adapter *adapter,
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FUNC_CALL_MAP
|
||||
static int drv_cmd_get_function_call_map(struct hdd_adapter *adapter,
|
||||
struct hdd_context *hdd_ctx,
|
||||
uint8_t *command,
|
||||
uint8_t command_len,
|
||||
struct hdd_priv_data *priv_data)
|
||||
{
|
||||
char *cc_buf = qdf_mem_malloc(QDF_FUNCTION_CALL_MAP_BUF_LEN);
|
||||
uint8_t *param;
|
||||
int temp_int;
|
||||
|
||||
param = strnchr(command, strlen(command), ' ');
|
||||
/*no argument after the command*/
|
||||
if (NULL == param)
|
||||
return -EINVAL;
|
||||
|
||||
/*no space after the command*/
|
||||
else if (SPACE_ASCII_VALUE != *param)
|
||||
return -EINVAL;
|
||||
|
||||
param++;
|
||||
|
||||
/*removing empty spaces*/
|
||||
while ((SPACE_ASCII_VALUE == *param) && ('\0' != *param))
|
||||
param++;
|
||||
|
||||
/*no argument followed by spaces*/
|
||||
if ('\0' == *param)
|
||||
return -EINVAL;
|
||||
|
||||
/*getting the first argument */
|
||||
if (sscanf(param, "%d ", &temp_int) != 1) {
|
||||
hdd_err("No option given");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (temp_int < 0 || temp_int > 1) {
|
||||
hdd_err("Invalid option given");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Read the buffer */
|
||||
if (temp_int) {
|
||||
/*
|
||||
* These logs are required as these indicates the start and end of the
|
||||
* dump for the auto script to parse
|
||||
*/
|
||||
hdd_info("Function call map dump start");
|
||||
qdf_get_func_call_map(cc_buf);
|
||||
qdf_trace_hex_dump(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
|
||||
cc_buf, QDF_FUNCTION_CALL_MAP_BUF_LEN);
|
||||
hdd_info("Function call map dump end");
|
||||
} else {
|
||||
qdf_clear_func_call_map();
|
||||
hdd_info("Function call map clear");
|
||||
}
|
||||
qdf_mem_free(cc_buf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following table contains all supported WLAN HDD
|
||||
* IOCTL driver commands and the handler for each of them.
|
||||
@ -6907,6 +6971,9 @@ static const struct hdd_drv_cmd hdd_drv_cmds[] = {
|
||||
{"SET_DISABLE_CHANNEL_LIST", drv_cmd_set_disable_chan_list, true},
|
||||
{"GET_DISABLE_CHANNEL_LIST", drv_cmd_get_disable_chan_list, false},
|
||||
{"GET_ANI_LEVEL", drv_cmd_get_ani_level, false},
|
||||
#ifdef FUNC_CALL_MAP
|
||||
{"GET_FUNCTION_CALL_MAP", drv_cmd_get_function_call_map, true},
|
||||
#endif
|
||||
{"STOP", drv_cmd_dummy, false},
|
||||
/* Deprecated commands */
|
||||
{"RXFILTER-START", drv_cmd_dummy, false},
|
||||
|
@ -161,6 +161,8 @@
|
||||
#include "wlan_mlme_ucfg_api.h"
|
||||
#include "wlan_fwol_ucfg_api.h"
|
||||
#include "wlan_policy_mgr_ucfg.h"
|
||||
#include "qdf_func_tracker.h"
|
||||
|
||||
#ifdef CNSS_GENL
|
||||
#include <net/cnss_nl.h>
|
||||
#endif
|
||||
@ -6468,6 +6470,36 @@ hdd_peer_cleanup(struct hdd_context *hdd_ctx, struct hdd_adapter *adapter)
|
||||
hdd_debug("peer_cleanup_done wait fail");
|
||||
}
|
||||
|
||||
#ifdef FUNC_CALL_MAP
|
||||
|
||||
/**
|
||||
* hdd_dump_func_call_map() - Dump the function call map
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
|
||||
static void hdd_dump_func_call_map(void)
|
||||
{
|
||||
char *cc_buf;
|
||||
|
||||
cc_buf = qdf_mem_malloc(QDF_FUNCTION_CALL_MAP_BUF_LEN);
|
||||
/*
|
||||
* These logs are required as these indicates the start and end of the
|
||||
* dump for the auto script to parse
|
||||
*/
|
||||
hdd_info("Function call map dump start");
|
||||
qdf_get_func_call_map(cc_buf);
|
||||
qdf_trace_hex_dump(QDF_MODULE_ID_HDD,
|
||||
QDF_TRACE_LEVEL_INFO, cc_buf, QDF_FUNCTION_CALL_MAP_BUF_LEN);
|
||||
hdd_info("Function call map dump end");
|
||||
qdf_mem_free(cc_buf);
|
||||
}
|
||||
#else
|
||||
static inline void hdd_dump_func_call_map(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx,
|
||||
struct hdd_adapter *adapter)
|
||||
{
|
||||
@ -6784,6 +6816,8 @@ QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx,
|
||||
adapter->scan_info.default_scan_ies_len = 0;
|
||||
}
|
||||
|
||||
/* This function should be invoked at the end of this api*/
|
||||
hdd_dump_func_call_map();
|
||||
hdd_exit();
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
@ -8456,6 +8490,9 @@ void hdd_wlan_exit(struct hdd_context *hdd_ctx)
|
||||
#ifdef FEATURE_WLAN_CH_AVOID
|
||||
mutex_destroy(&hdd_ctx->avoid_freq_lock);
|
||||
#endif
|
||||
|
||||
/* This function should be invoked at the end of this api*/
|
||||
hdd_dump_func_call_map();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user