Parcourir la source

qcacld-3.0: Add ini support for DPTRACE

Add ini parameter and feature flag for
DPTRACE to enable/disable as per requirement.

Change-Id: I80db65adb7b8e82d5ea75cceac742fd229d7a2b5
CRs-Fixed: 1008087
Nirav Shah il y a 9 ans
Parent
commit
cc1f1ae340

+ 6 - 0
Kbuild

@@ -59,9 +59,11 @@ ifeq ($(KERNEL_BUILD), 0)
 	ifneq ($(TARGET_BUILD_VARIANT),user)
 		ifeq ($(CONFIG_SLUB_DEBUG_ON),y)
 			CONFIG_PKT_PROTO_TRACE := y
+			CONFIG_FEATURE_DP_TRACE := y
 		else
 			ifeq ($(findstring perf,$(KERNEL_DEFCONFIG)),)
 				CONFIG_PKT_PROTO_TRACE := y
+				CONFIG_FEATURE_DP_TRACE := y
 			endif
 		endif
 	endif
@@ -1016,6 +1018,10 @@ ifeq ($(CONFIG_WLAN_FASTPATH), y)
 CDEFINES +=	-DWLAN_FEATURE_FASTPATH
 endif
 
+ifeq ($(CONFIG_FEATURE_DP_TRACE), y)
+CDEFINES +=	-DFEATURE_DP_TRACE
+endif
+
 ifeq ($(CONFIG_WLAN_NAPI), y)
 CDEFINES += -DFEATURE_NAPI
 ifeq ($(CONFIG_WLAN_NAPI_DEBUG), y)

+ 4 - 0
Kconfig

@@ -127,4 +127,8 @@ config PKT_PROTO_TRACE
 	bool "Enable packet trace feature"
 	default n
 
+config FEATURE_DP_TRACE
+	bool "Enable data path trace feature"
+	default n
+
 endif # QCA_CLD_WLAN

+ 0 - 1
core/cds/src/cds_api.c

@@ -101,7 +101,6 @@ v_CONTEXT_t cds_init(void)
 #if defined(TRACE_RECORD)
 	qdf_trace_init();
 #endif
-	qdf_dp_trace_init();
 
 	cds_ssr_protect_init();
 

+ 10 - 0
core/hdd/inc/wlan_hdd_cfg.h

@@ -3107,6 +3107,15 @@ enum dot11p_mode {
 #define CFG_EDCA_BE_AIFS_VALUE_MAX        (15)
 #define CFG_EDCA_BE_AIFS_VALUE_DEFAULT    (3)
 
+/*
+ * Enable/disable DPTRACE
+ * Enabling this might have performace impact.
+ */
+#define CFG_ENABLE_DP_TRACE		"enable_dp_trace"
+#define CFG_ENABLE_DP_TRACE_MIN		(0)
+#define CFG_ENABLE_DP_TRACE_MAX		(1)
+#define CFG_ENABLE_DP_TRACE_DEFAULT	(0)
+
 /*---------------------------------------------------------------------------
    Type declarations
    -------------------------------------------------------------------------*/
@@ -3726,6 +3735,7 @@ struct hdd_config {
 	uint32_t edca_be_aifs;
 	bool enable_fatal_event;
 	bool bpf_enabled;
+	bool enable_dp_trace;
 };
 
 #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var))

+ 9 - 0
core/hdd/src/wlan_hdd_cfg.c

@@ -3898,6 +3898,12 @@ REG_TABLE_ENTRY g_registry_table[] = {
 			CFG_EDCA_BE_AIFS_VALUE_MIN,
 			CFG_EDCA_BE_AIFS_VALUE_MAX),
 
+	REG_VARIABLE(CFG_ENABLE_DP_TRACE, WLAN_PARAM_Integer,
+		struct hdd_config, enable_dp_trace,
+		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		CFG_ENABLE_DP_TRACE_DEFAULT,
+		CFG_ENABLE_DP_TRACE_MIN,
+		CFG_ENABLE_DP_TRACE_MAX),
 };
 
 
@@ -5544,6 +5550,9 @@ void hdd_cfg_print(hdd_context_t *pHddCtx)
 	hdd_info("Name = [%s] Value = [%u]",
 		CFG_EDCA_BE_AIFS_VALUE_NAME,
 		pHddCtx->config->edca_be_aifs);
+	hdd_info("Name = [%s] Value = [%u]",
+		CFG_ENABLE_DP_TRACE,
+		pHddCtx->config->enable_dp_trace);
 }
 
 

+ 3 - 0
core/hdd/src/wlan_hdd_main.c

@@ -6400,6 +6400,9 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc)
 	if (ret)
 		goto err_wiphy_unregister;
 
+	if (hdd_ctx->config->enable_dp_trace)
+		qdf_dp_trace_init();
+
 	if (hdd_ipa_init(hdd_ctx) == QDF_STATUS_E_FAILURE)
 		goto err_wiphy_unregister;
 

+ 3 - 0
core/hdd/src/wlan_hdd_power.c

@@ -1582,6 +1582,9 @@ QDF_STATUS hdd_wlan_re_init(void *hif_sc)
 		}
 	}
 
+	if (pHddCtx->config->enable_dp_trace)
+		qdf_dp_trace_init();
+
 	if (hdd_ipa_uc_ssr_reinit())
 		hddLog(LOGE, "%s: HDD IPA UC reinit failed", __func__);