qcacmn: Modify trace related APIs to support dynamic configuration in WIN

New iwpriv commands are implemented in WIN to support dynamic configuration
of verbose level for each of the module IDs.

Add following changes in trace module to support above requirement -

1. Make qdf_get_pidx and qdf_set_pidx common to WIN and MCL
2. Export g_qdf_category_name to be accessible in WIN driver
3. Add macros to derive upper and lower 16-bits from a 32-bit value
   combining module and trace level information used for dynamic trace
   level configuration per module
4. Address trace level NONE case during registration to set the correct
   mask

Change-Id: I97be5f26b0d611e96409837fb0c03d55ce5f6e07
CRs-Fixed: 2041247
This commit is contained in:
Sathish Kumar
2017-05-10 19:56:48 +05:30
committed by snandini
parent 9f07b47498
commit 470c620cf9
2 changed files with 37 additions and 25 deletions

View File

@@ -53,6 +53,9 @@
#define QDF_DEFAULT_TRACE_LEVEL (1 << QDF_TRACE_LEVEL_INFO) #define QDF_DEFAULT_TRACE_LEVEL (1 << QDF_TRACE_LEVEL_INFO)
#endif #endif
#define QDF_CATEGORY_INFO_U16(val) (((val >> 16) & 0x0000FFFF))
#define QDF_TRACE_LEVEL_INFO_L16(val) (val & 0x0000FFFF)
typedef int (qdf_abstract_print)(void *priv, const char *fmt, ...); typedef int (qdf_abstract_print)(void *priv, const char *fmt, ...);
/* /*
@@ -67,19 +70,6 @@ typedef int (qdf_abstract_print)(void *priv, const char *fmt, ...);
#define QDF_DEBUG_CFG 0x40 #define QDF_DEBUG_CFG 0x40
#ifdef CONFIG_MCL #ifdef CONFIG_MCL
/**
* qdf_set_pidx() - Sets the global qdf_pidx.
* @pidx : Index of print control object assigned to the module
*
*/
void qdf_set_pidx(int pidx);
/**
* qdf_get_pidx() - Returns the global qdf_pidx.
*
* Return : Current qdf print index.
*/
int qdf_get_pidx(void);
/* By default Data Path module will have all log levels enabled, except debug /* By default Data Path module will have all log levels enabled, except debug
* log level. Debug level will be left up to the framework or user space modules * log level. Debug level will be left up to the framework or user space modules
@@ -545,10 +535,24 @@ qdf_tso_seg_dbg_zero(struct qdf_tso_seg_elem_t *tsoseg)
#define MAX_SUPPORTED_CATEGORY QDF_MODULE_ID_MAX #define MAX_SUPPORTED_CATEGORY QDF_MODULE_ID_MAX
/**
* qdf_set_pidx() - Sets the global qdf_pidx.
* @pidx : Index of print control object assigned to the module
*
*/
void qdf_set_pidx(int pidx);
/**
* qdf_get_pidx() - Returns the global qdf_pidx.
*
* Return : Current qdf print index.
*/
int qdf_get_pidx(void);
/* /*
* Shared print control index * Shared print control index
* for converged debug framework * for converged debug framework
*/ */
#define QDF_PRINT_IDX_SHARED -1 #define QDF_PRINT_IDX_SHARED -1
/** /**

View File

@@ -129,18 +129,6 @@ static struct s_qdf_dp_trace_data g_qdf_dp_trace_data;
static tp_qdf_dp_trace_cb qdf_dp_trace_cb_table[QDF_DP_TRACE_MAX+1]; static tp_qdf_dp_trace_cb qdf_dp_trace_cb_table[QDF_DP_TRACE_MAX+1];
#endif #endif
void qdf_set_pidx(int pidx)
{
qdf_pidx = pidx;
}
EXPORT_SYMBOL(qdf_set_pidx);
int qdf_get_pidx(void)
{
return qdf_pidx;
}
EXPORT_SYMBOL(qdf_get_pidx);
/** /**
* qdf_trace_set_level() - Set the trace level for a particular module * qdf_trace_set_level() - Set the trace level for a particular module
* @module: Module id * @module: Module id
@@ -1814,6 +1802,7 @@ struct category_name_info g_qdf_category_name[MAX_SUPPORTED_CATEGORY] = {
[QDF_MODULE_ID_OFFCHAN_TXRX] = {"OFFCHAN"}, [QDF_MODULE_ID_OFFCHAN_TXRX] = {"OFFCHAN"},
[QDF_MODULE_ID_ANY] = {"ANY"}, [QDF_MODULE_ID_ANY] = {"ANY"},
}; };
EXPORT_SYMBOL(g_qdf_category_name);
#ifdef CONFIG_MCL #ifdef CONFIG_MCL
@@ -1989,6 +1978,13 @@ int qdf_print_ctrl_register(const struct category_info *cinfo,
QDF_TRACE_LEVEL_ALL) { QDF_TRACE_LEVEL_ALL) {
print_ctrl_obj[idx].cat_info[i] print_ctrl_obj[idx].cat_info[i]
.category_verbose_mask = 0xFFFF; .category_verbose_mask = 0xFFFF;
} else if ((cinfo[i].category_verbose_mask ==
QDF_TRACE_LEVEL_NONE) ||
(cinfo[i].category_verbose_mask ==
QDF_TRACE_LEVEL_TO_MODULE_BITMASK(
QDF_TRACE_LEVEL_NONE))) {
print_ctrl_obj[idx].cat_info[i]
.category_verbose_mask = 0;
} else { } else {
print_ctrl_obj[idx].cat_info[i] print_ctrl_obj[idx].cat_info[i]
.category_verbose_mask = .category_verbose_mask =
@@ -2499,3 +2495,15 @@ int qdf_sprint_symbol(char *buffer, void *addr)
} }
#endif #endif
EXPORT_SYMBOL(qdf_sprint_symbol); EXPORT_SYMBOL(qdf_sprint_symbol);
void qdf_set_pidx(int pidx)
{
qdf_pidx = pidx;
}
EXPORT_SYMBOL(qdf_set_pidx);
int qdf_get_pidx(void)
{
return qdf_pidx;
}
EXPORT_SYMBOL(qdf_get_pidx);