Prechádzať zdrojové kódy

qcacld-3.0: Use tracepoints to trace rx packets

Use tracepoints to trace receive packets.

Change-Id: I0124c3c4d577018497e940ced299960fc9a21d8c
CRs-Fixed: 3083361
Yeshwanth Sriram Guntuka 3 rokov pred
rodič
commit
5e38109641

+ 13 - 0
core/hdd/inc/wlan_hdd_tx_rx.h

@@ -31,6 +31,7 @@
 #include <cds_api.h>
 #include <linux/skbuff.h>
 #include "cdp_txrx_flow_ctrl_legacy.h"
+#include <qdf_tracepoint.h>
 
 struct hdd_netif_queue_history;
 struct hdd_context;
@@ -588,4 +589,16 @@ bool wlan_hdd_rx_rpm_mark_last_busy(struct hdd_context *hdd_ctx,
  * Return: None
  */
 void hdd_sta_notify_tx_comp_cb(qdf_nbuf_t skb, void *ctx, uint16_t flag);
+
+/**
+ * hdd_rx_pkt_tracepoints_enabled() - Get the state of rx pkt tracepoint
+ *
+ * Return: True if any rx pkt tracepoint is enabled else false
+ */
+static inline bool hdd_rx_pkt_tracepoints_enabled(void)
+{
+	return (qdf_trace_dp_rx_tcp_pkt_enabled() ||
+		qdf_trace_dp_rx_udp_pkt_enabled() ||
+		qdf_trace_dp_rx_pkt_enabled());
+}
 #endif /* end #if !defined(WLAN_HDD_TX_RX_H) */

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

@@ -1207,6 +1207,9 @@ QDF_STATUS hdd_softap_rx_packet_cbk(void *adapter_context, qdf_nbuf_t rx_buf)
 		DPTRACE(qdf_dp_trace_data_pkt(skb, QDF_TRACE_DEFAULT_PDEV_ID,
 				QDF_DP_TRACE_RX_PACKET_RECORD, 0, QDF_RX));
 
+		if (hdd_rx_pkt_tracepoints_enabled())
+			qdf_trace_dp_packet(skb, QDF_RX, NULL, 0);
+
 		skb->protocol = eth_type_trans(skb, skb->dev);
 
 		/* hold configurable wakelock for unicast traffic */

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

@@ -2696,6 +2696,9 @@ QDF_STATUS hdd_rx_packet_cbk(void *adapter_context,
 						    WLAN_OSIF_TDLS_ID);
 		}
 
+		if (hdd_rx_pkt_tracepoints_enabled())
+			qdf_trace_dp_packet(skb, QDF_RX, NULL, 0);
+
 		skb->dev = adapter->dev;
 		skb->protocol = eth_type_trans(skb, skb->dev);
 		++stats->per_cpu[cpu_index].rx_packets;