Browse Source

qcacld-3.0: Support for DPTRACE

1. Add an extra parameter pdev id to
   qdf_trace signatures to avoid compilation break.
2. This variable allows to collect records per pdev
   for Lithium based chipsets.
3. Set this variable to a default value QDF_TRACE_DEFAULT_PDEV_ID
   for older chipsets.

Change-Id: I2f4c2e3525ac0d1d53f1af3db7e43acadf6ab835
CRs-Fixed: 2049412
Venkata Sharath Chandra Manchala 8 years ago
parent
commit
0b9fc63dd1

+ 2 - 1
Kbuild

@@ -1609,7 +1609,7 @@ ifeq ($(CONFIG_FEATURE_PKTLOG), y)
 CDEFINES +=     -DFEATURE_PKTLOG
 endif
 
-CDEFINES +=	-DFEATURE_DP_TRACE
+CDEFINES +=	-DCONFIG_DP_TRACE
 
 ifeq ($(CONFIG_WLAN_NAPI), y)
 CDEFINES += -DFEATURE_NAPI
@@ -2093,6 +2093,7 @@ CDEFINES += -DQCA_WIFI_QCA8074_VP
 CDEFINES += -DDP_INTR_POLL_BASED
 CDEFINES += -DTX_PER_PDEV_DESC_POOL
 CDEFINES += -DWLAN_RX_HASH
+CDEFINES += -DCONFIG_DP_TRACE
 CDEFINES += -DDP_LFR
 endif
 

+ 1 - 0
core/dp/htt/htt_rx.c

@@ -2136,6 +2136,7 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev,
 		ol_rx_log_packet(pdev, peer_id, msdu);
 		DPTRACE(qdf_dp_trace(msdu,
 			QDF_DP_TRACE_RX_HTT_PACKET_PTR_RECORD,
+			QDF_TRACE_DEFAULT_PDEV_ID,
 			qdf_nbuf_data_addr(msdu),
 			sizeof(qdf_nbuf_data(msdu)), QDF_RX));
 

+ 2 - 0
core/dp/htt/htt_tx.c

@@ -801,6 +801,7 @@ int htt_tx_send_std(htt_pdev_handle pdev, qdf_nbuf_t msdu, uint16_t msdu_id)
 
 	QDF_NBUF_UPDATE_TX_PKT_COUNT(msdu, QDF_NBUF_TX_PKT_HTT);
 	DPTRACE(qdf_dp_trace(msdu, QDF_DP_TRACE_HTT_PACKET_PTR_RECORD,
+				QDF_TRACE_DEFAULT_PDEV_ID,
 				qdf_nbuf_data_addr(msdu),
 				sizeof(qdf_nbuf_data(msdu)), QDF_TX));
 	if (qdf_nbuf_queue_len(&pdev->txnbufq) > 0) {
@@ -943,6 +944,7 @@ htt_tx_send_base(htt_pdev_handle pdev,
 
 	QDF_NBUF_UPDATE_TX_PKT_COUNT(msdu, QDF_NBUF_TX_PKT_HTT);
 	DPTRACE(qdf_dp_trace(msdu, QDF_DP_TRACE_HTT_PACKET_PTR_RECORD,
+				QDF_TRACE_DEFAULT_PDEV_ID,
 				qdf_nbuf_data_addr(msdu),
 				sizeof(qdf_nbuf_data(msdu)), QDF_TX));
 	htc_send_data_pkt(pdev->htc_pdev, &pkt->htc_pkt, more_data);

+ 6 - 2
core/dp/txrx/ol_rx.c

@@ -1555,6 +1555,7 @@ ol_rx_in_order_deliver(struct ol_txrx_vdev_t *vdev,
 
 		DPTRACE(qdf_dp_trace(msdu,
 			QDF_DP_TRACE_RX_TXRX_PACKET_PTR_RECORD,
+			QDF_TRACE_DEFAULT_PDEV_ID,
 			qdf_nbuf_data_addr(msdu),
 			sizeof(qdf_nbuf_data(msdu)), QDF_RX));
 
@@ -1581,7 +1582,8 @@ void ol_rx_log_packet(htt_pdev_handle htt_pdev,
 
 	peer = ol_txrx_peer_find_by_id(htt_pdev->txrx_pdev, peer_id);
 	if (peer)
-		qdf_dp_trace_log_pkt(peer->vdev->vdev_id, msdu, QDF_RX);
+		qdf_dp_trace_log_pkt(peer->vdev->vdev_id, msdu, QDF_RX,
+				QDF_TRACE_DEFAULT_PDEV_ID);
 }
 
 void
@@ -1608,9 +1610,11 @@ ol_rx_offload_paddr_deliver_ind_handler(htt_pdev_handle htt_pdev,
 			QDF_NBUF_CB_TX_PACKET_TRACK(head_buf) =
 						QDF_NBUF_TX_PKT_DATA_TRACK;
 			qdf_dp_trace_log_pkt(peer->vdev->vdev_id,
-				head_buf, QDF_RX);
+				head_buf, QDF_RX,
+				QDF_TRACE_DEFAULT_PDEV_ID);
 			DPTRACE(qdf_dp_trace(head_buf,
 				QDF_DP_TRACE_RX_OFFLOAD_HTT_PACKET_PTR_RECORD,
+				QDF_TRACE_DEFAULT_PDEV_ID,
 				qdf_nbuf_data_addr(head_buf),
 				sizeof(qdf_nbuf_data(head_buf)), QDF_RX));
 			ol_rx_data_process(peer, head_buf);

+ 3 - 0
core/dp/txrx/ol_tx.c

@@ -763,6 +763,7 @@ ol_tx_ll_fast(ol_txrx_vdev_handle vdev, qdf_nbuf_t msdu_list)
 
 				DPTRACE(qdf_dp_trace_ptr(msdu,
 				    QDF_DP_TRACE_TXRX_FAST_PACKET_PTR_RECORD,
+				    QDF_TRACE_DEFAULT_PDEV_ID,
 				    qdf_nbuf_data_addr(msdu),
 				    sizeof(qdf_nbuf_data(msdu)),
 				     tx_desc->id, vdev->vdev_id));
@@ -891,6 +892,7 @@ ol_tx_ll_fast(ol_txrx_vdev_handle vdev, qdf_nbuf_t msdu_list)
 		if (qdf_likely(tx_desc)) {
 			DPTRACE(qdf_dp_trace_ptr(msdu,
 				QDF_DP_TRACE_TXRX_FAST_PACKET_PTR_RECORD,
+				QDF_TRACE_DEFAULT_PDEV_ID,
 				qdf_nbuf_data_addr(msdu),
 				sizeof(qdf_nbuf_data(msdu)), tx_desc->id,
 				vdev->vdev_id));
@@ -1036,6 +1038,7 @@ ol_tx_vdev_pause_queue_append(struct ol_txrx_vdev_t *vdev,
 					     QDF_NBUF_TX_PKT_TXRX_ENQUEUE);
 		DPTRACE(qdf_dp_trace(msdu_list,
 				QDF_DP_TRACE_TXRX_QUEUE_PACKET_PTR_RECORD,
+				QDF_TRACE_DEFAULT_PDEV_ID,
 				qdf_nbuf_data_addr(msdu_list),
 				sizeof(qdf_nbuf_data(msdu_list)), QDF_TX));
 

+ 2 - 0
core/dp/txrx/ol_tx_send.c

@@ -238,6 +238,7 @@ ol_tx_send(struct ol_txrx_pdev_t *pdev,
 	id = ol_tx_desc_id(pdev, tx_desc);
 	QDF_NBUF_UPDATE_TX_PKT_COUNT(msdu, QDF_NBUF_TX_PKT_TXRX);
 	DPTRACE(qdf_dp_trace_ptr(msdu, QDF_DP_TRACE_TXRX_PACKET_PTR_RECORD,
+				QDF_TRACE_DEFAULT_PDEV_ID,
 				qdf_nbuf_data_addr(msdu),
 				sizeof(qdf_nbuf_data(msdu)), tx_desc->id,
 				vdev_id));
@@ -596,6 +597,7 @@ ol_tx_completion_handler(ol_txrx_pdev_handle pdev,
 
 		DPTRACE(qdf_dp_trace_ptr(netbuf,
 			QDF_DP_TRACE_FREE_PACKET_PTR_RECORD,
+			QDF_TRACE_DEFAULT_PDEV_ID,
 			qdf_nbuf_data_addr(netbuf),
 			sizeof(qdf_nbuf_data(netbuf)), tx_desc->id, status));
 		htc_pm_runtime_put(pdev->htt_pdev->htc_pdev);

+ 2 - 0
core/hdd/src/wlan_hdd_assoc.c

@@ -1591,6 +1591,7 @@ static QDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter,
 
 	DPTRACE(qdf_dp_trace_mgmt_pkt(QDF_DP_TRACE_MGMT_PACKET_RECORD,
 				pAdapter->sessionId,
+				QDF_TRACE_DEFAULT_PDEV_ID,
 				QDF_PROTO_TYPE_MGMT, QDF_PROTO_MGMT_DISASSOC));
 
 	/* HDD has initiated disconnect, do not send disconnect indication
@@ -2612,6 +2613,7 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter,
 
 		DPTRACE(qdf_dp_trace_mgmt_pkt(QDF_DP_TRACE_MGMT_PACKET_RECORD,
 			pAdapter->sessionId,
+			QDF_TRACE_DEFAULT_PDEV_ID,
 			QDF_PROTO_TYPE_MGMT, QDF_PROTO_MGMT_ASSOC));
 
 		/*

+ 4 - 1
core/hdd/src/wlan_hdd_hostapd.c

@@ -1599,6 +1599,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
 
 		DPTRACE(qdf_dp_trace_mgmt_pkt(QDF_DP_TRACE_MGMT_PACKET_RECORD,
 			pHostapdAdapter->sessionId,
+			QDF_TRACE_DEFAULT_PDEV_ID,
 			QDF_PROTO_TYPE_MGMT, QDF_PROTO_MGMT_ASSOC));
 
 #ifdef MSM_PLATFORM
@@ -1753,6 +1754,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
 #endif
 		DPTRACE(qdf_dp_trace_mgmt_pkt(QDF_DP_TRACE_MGMT_PACKET_RECORD,
 			pHostapdAdapter->sessionId,
+			QDF_TRACE_DEFAULT_PDEV_ID,
 			QDF_PROTO_TYPE_MGMT, QDF_PROTO_MGMT_DISASSOC));
 
 		hdd_softap_deregister_sta(pHostapdAdapter, staId);
@@ -2603,7 +2605,8 @@ static int __iw_softap_set_two_ints_getnone(struct net_device *dev,
 		hdd_debug("WE_DUMP_DP_TRACE: %d %d",
 		       value[1], value[2]);
 		if (value[1] == DUMP_DP_TRACE)
-			qdf_dp_trace_dump_all(value[2]);
+			qdf_dp_trace_dump_all(value[2],
+				QDF_TRACE_DEFAULT_PDEV_ID);
 		else if (value[1] == ENABLE_DP_TRACE_LIVE_MODE)
 			qdf_dp_trace_enable_live_mode();
 		else if (value[1] == CLEAR_DP_TRACE_BUFFER)

+ 17 - 6
core/hdd/src/wlan_hdd_softap_tx_rx.c

@@ -401,18 +401,22 @@ static int __hdd_softap_hard_start_xmit(struct sk_buff *skb,
 		++pAdapter->stats.tx_packets;
 
 	hdd_event_eapol_log(skb, QDF_TX);
-	qdf_dp_trace_log_pkt(pAdapter->sessionId, skb, QDF_TX);
+	qdf_dp_trace_log_pkt(pAdapter->sessionId, skb, QDF_TX,
+			QDF_TRACE_DEFAULT_PDEV_ID);
 	QDF_NBUF_CB_TX_PACKET_TRACK(skb) = QDF_NBUF_TX_PKT_DATA_TRACK;
 	QDF_NBUF_UPDATE_TX_PKT_COUNT(skb, QDF_NBUF_TX_PKT_HDD);
 
 	qdf_dp_trace_set_track(skb, QDF_TX);
 	DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_TX_PACKET_PTR_RECORD,
-			qdf_nbuf_data_addr(skb), sizeof(qdf_nbuf_data(skb)),
+			QDF_TRACE_DEFAULT_PDEV_ID, qdf_nbuf_data_addr(skb),
+			sizeof(qdf_nbuf_data(skb)),
 			QDF_TX));
 	DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_TX_PACKET_RECORD,
-			(uint8_t *)skb->data, qdf_nbuf_len(skb), QDF_TX));
+			QDF_TRACE_DEFAULT_PDEV_ID, (uint8_t *)skb->data,
+			qdf_nbuf_len(skb), QDF_TX));
 	if (qdf_nbuf_len(skb) > QDF_DP_TRACE_RECORD_SIZE)
 		DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_TX_PACKET_RECORD,
+			QDF_TRACE_DEFAULT_PDEV_ID,
 			(uint8_t *)&skb->data[QDF_DP_TRACE_RECORD_SIZE],
 			(qdf_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE), QDF_TX));
 
@@ -433,9 +437,11 @@ drop_pkt_and_release_skb:
 drop_pkt:
 
 	DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_DROP_PACKET_RECORD,
-			(uint8_t *)skb->data, qdf_nbuf_len(skb), QDF_TX));
+			QDF_TRACE_DEFAULT_PDEV_ID, (uint8_t *)skb->data,
+			qdf_nbuf_len(skb), QDF_TX));
 	if (qdf_nbuf_len(skb) > QDF_DP_TRACE_RECORD_SIZE)
 		DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_DROP_PACKET_RECORD,
+			QDF_TRACE_DEFAULT_PDEV_ID,
 			(uint8_t *)&skb->data[QDF_DP_TRACE_RECORD_SIZE],
 			(qdf_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE), QDF_TX));
 	kfree_skb(skb);
@@ -510,7 +516,8 @@ static void __hdd_softap_tx_timeout(struct net_device *dev)
 	int i;
 
 	DPTRACE(qdf_dp_trace(NULL, QDF_DP_TRACE_HDD_SOFTAP_TX_TIMEOUT,
-				NULL, 0, QDF_TX));
+			QDF_TRACE_DEFAULT_PDEV_ID,
+			NULL, 0, QDF_TX));
 	/* Getting here implies we disabled the TX queues for too
 	 * long. Queues are disabled either because of disassociation
 	 * or low resource scenarios. In case of disassociation it is
@@ -732,13 +739,17 @@ QDF_STATUS hdd_softap_rx_packet_cbk(void *context, qdf_nbuf_t rxBuf)
 		hdd_event_eapol_log(skb, QDF_RX);
 		DPTRACE(qdf_dp_trace(skb,
 			QDF_DP_TRACE_RX_HDD_PACKET_PTR_RECORD,
+			QDF_TRACE_DEFAULT_PDEV_ID,
 			qdf_nbuf_data_addr(skb),
 			sizeof(qdf_nbuf_data(skb)), QDF_RX));
 		DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_RX_PACKET_RECORD,
-			(uint8_t *)skb->data, qdf_nbuf_len(skb), QDF_RX));
+				QDF_TRACE_DEFAULT_PDEV_ID,
+				(uint8_t *)skb->data, qdf_nbuf_len(skb),
+				QDF_RX));
 		if (qdf_nbuf_len(skb) > QDF_DP_TRACE_RECORD_SIZE)
 			DPTRACE(qdf_dp_trace(skb,
 				QDF_DP_TRACE_HDD_RX_PACKET_RECORD,
+				QDF_TRACE_DEFAULT_PDEV_ID,
 				(uint8_t *)&skb->data[QDF_DP_TRACE_RECORD_SIZE],
 				(qdf_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE),
 				QDF_RX));

+ 14 - 4
core/hdd/src/wlan_hdd_tx_rx.c

@@ -659,18 +659,22 @@ static int __hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
 		++pAdapter->stats.tx_packets;
 
 	hdd_event_eapol_log(skb, QDF_TX);
-	qdf_dp_trace_log_pkt(pAdapter->sessionId, skb, QDF_TX);
+	qdf_dp_trace_log_pkt(pAdapter->sessionId, skb, QDF_TX,
+			QDF_TRACE_DEFAULT_PDEV_ID);
 	QDF_NBUF_CB_TX_PACKET_TRACK(skb) = QDF_NBUF_TX_PKT_DATA_TRACK;
 	QDF_NBUF_UPDATE_TX_PKT_COUNT(skb, QDF_NBUF_TX_PKT_HDD);
 
 	qdf_dp_trace_set_track(skb, QDF_TX);
 	DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_TX_PACKET_PTR_RECORD,
-			qdf_nbuf_data_addr(skb), sizeof(qdf_nbuf_data(skb)),
+			QDF_TRACE_DEFAULT_PDEV_ID, qdf_nbuf_data_addr(skb),
+			sizeof(qdf_nbuf_data(skb)),
 			QDF_TX));
 	DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_TX_PACKET_RECORD,
-			(uint8_t *)skb->data, qdf_nbuf_len(skb), QDF_TX));
+			QDF_TRACE_DEFAULT_PDEV_ID, (uint8_t *)skb->data,
+			qdf_nbuf_len(skb), QDF_TX));
 	if (qdf_nbuf_len(skb) > QDF_DP_TRACE_RECORD_SIZE) {
 		DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_TX_PACKET_RECORD,
+			QDF_TRACE_DEFAULT_PDEV_ID,
 			(uint8_t *)&skb->data[QDF_DP_TRACE_RECORD_SIZE],
 			(qdf_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE), QDF_TX));
 	}
@@ -711,10 +715,12 @@ drop_pkt:
 
 	if (skb) {
 		DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_DROP_PACKET_RECORD,
-			(uint8_t *)skb->data, qdf_nbuf_len(skb), QDF_TX));
+			QDF_TRACE_DEFAULT_PDEV_ID, (uint8_t *)skb->data,
+			qdf_nbuf_len(skb), QDF_TX));
 		if (qdf_nbuf_len(skb) > QDF_DP_TRACE_RECORD_SIZE)
 			DPTRACE(qdf_dp_trace(skb,
 				 QDF_DP_TRACE_DROP_PACKET_RECORD,
+				 QDF_TRACE_DEFAULT_PDEV_ID,
 				(uint8_t *)&skb->data[QDF_DP_TRACE_RECORD_SIZE],
 				(qdf_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE),
 				 QDF_TX));
@@ -817,6 +823,7 @@ static void __hdd_tx_timeout(struct net_device *dev)
 
 	TX_TIMEOUT_TRACE(dev, QDF_MODULE_ID_HDD_DATA);
 	DPTRACE(qdf_dp_trace(NULL, QDF_DP_TRACE_HDD_TX_TIMEOUT,
+				QDF_TRACE_DEFAULT_PDEV_ID,
 				NULL, 0, QDF_TX));
 
 	/* Getting here implies we disabled the TX queues for too
@@ -1151,13 +1158,16 @@ QDF_STATUS hdd_rx_packet_cbk(void *context, qdf_nbuf_t rxBuf)
 		hdd_event_eapol_log(skb, QDF_RX);
 		DPTRACE(qdf_dp_trace(skb,
 			QDF_DP_TRACE_RX_HDD_PACKET_PTR_RECORD,
+			QDF_TRACE_DEFAULT_PDEV_ID,
 			qdf_nbuf_data_addr(skb),
 			sizeof(qdf_nbuf_data(skb)), QDF_RX));
 		DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_RX_PACKET_RECORD,
+			QDF_TRACE_DEFAULT_PDEV_ID,
 			(uint8_t *)skb->data, qdf_nbuf_len(skb), QDF_RX));
 		if (qdf_nbuf_len(skb) > QDF_DP_TRACE_RECORD_SIZE)
 			DPTRACE(qdf_dp_trace(skb,
 				QDF_DP_TRACE_HDD_RX_PACKET_RECORD,
+				QDF_TRACE_DEFAULT_PDEV_ID,
 				(uint8_t *)&skb->data[QDF_DP_TRACE_RECORD_SIZE],
 				(qdf_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE),
 				QDF_RX));

+ 2 - 1
core/hdd/src/wlan_hdd_wext.c

@@ -12696,7 +12696,8 @@ static int __iw_set_two_ints_getnone(struct net_device *dev,
 		hdd_debug("WE_DUMP_DP_TRACE_LEVEL: %d %d",
 		       value[1], value[2]);
 		if (value[1] == DUMP_DP_TRACE)
-			qdf_dp_trace_dump_all(value[2]);
+			qdf_dp_trace_dump_all(value[2],
+					QDF_TRACE_DEFAULT_PDEV_ID);
 		else if (value[1] == ENABLE_DP_TRACE_LIVE_MODE)
 			qdf_dp_trace_enable_live_mode();
 		else if (value[1] == CLEAR_DP_TRACE_BUFFER)

+ 6 - 3
core/wma/src/wma_scan_roam.c

@@ -2325,7 +2325,8 @@ int wma_roam_synch_event_handler(void *handle, uint8_t *event,
 	}
 
 	DPTRACE(qdf_dp_trace_record_event(QDF_DP_TRACE_EVENT_RECORD,
-		synch_event->vdev_id, QDF_PROTO_TYPE_EVENT, QDF_ROAM_SYNCH));
+		synch_event->vdev_id, QDF_TRACE_DEFAULT_PDEV_ID,
+		QDF_PROTO_TYPE_EVENT, QDF_ROAM_SYNCH));
 
 	if (wma_is_roam_synch_in_progress(wma, synch_event->vdev_id)) {
 		WMA_LOGE("%s: Ignoring RSI since one is already in progress",
@@ -2765,7 +2766,8 @@ void wma_process_roam_synch_complete(WMA_HANDLE handle, uint8_t vdev_id)
 	}
 
 	DPTRACE(qdf_dp_trace_record_event(QDF_DP_TRACE_EVENT_RECORD,
-		vdev_id, QDF_PROTO_TYPE_EVENT, QDF_ROAM_COMPLETE));
+		vdev_id, QDF_TRACE_DEFAULT_PDEV_ID,
+		QDF_PROTO_TYPE_EVENT, QDF_ROAM_COMPLETE));
 
 	WMA_LOGE("LFR3: Posting WMA_ROAM_OFFLOAD_SYNCH_CNF");
 }
@@ -5377,7 +5379,8 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
 		 wmi_event->vdev_id, wmi_event->rssi);
 
 	DPTRACE(qdf_dp_trace_record_event(QDF_DP_TRACE_EVENT_RECORD,
-		wmi_event->vdev_id, QDF_PROTO_TYPE_EVENT, QDF_ROAM_EVENTID));
+		wmi_event->vdev_id, QDF_TRACE_DEFAULT_PDEV_ID,
+		QDF_PROTO_TYPE_EVENT, QDF_ROAM_EVENTID));
 
 	switch (wmi_event->reason) {
 	case WMI_ROAM_REASON_BMISS: