Forráskód Böngészése

msm: ipa: Add additional trace points for rx/tx

Make changes to add additional trace points for rx
and tx path. Also enhance existing traces to capture more
information.

Change-Id: I40d5bfc4080a47d986e16ac157524c341949e51e
Signed-off-by: Chaitanya Pratapa <[email protected]>
Chaitanya Pratapa 4 éve
szülő
commit
e38ac9778b

+ 9 - 3
drivers/platform/msm/ipa/ipa_v3/ipa_dp.c

@@ -1764,6 +1764,7 @@ int ipa3_tx_dp(enum ipa_client_type dst, struct sk_buff *skb,
 		goto fail_pipe_not_valid;
 	}
 
+	trace_ipa3_tx_dp(skb,sys->ep->client);
 	num_frags = skb_shinfo(skb)->nr_frags;
 	/*
 	 * make sure TLV FIFO supports the needed frags.
@@ -1916,6 +1917,7 @@ int ipa3_tx_dp(enum ipa_client_type dst, struct sk_buff *skb,
 		IPA_STATS_INC_CNT(ipa3_ctx->stats.tx_hw_pkts);
 	}
 
+	trace_ipa3_tx_done(sys->ep->client);
 	if (num_frags) {
 		kfree(desc);
 		IPA_STATS_INC_CNT(ipa3_ctx->stats.tx_non_linear);
@@ -4595,9 +4597,10 @@ void __ipa_gsi_irq_rx_scedule_poll(struct ipa3_sys_context *sys)
 	 * or after NAPI poll
 	 */
 	clk_off = ipa_pm_activate(sys->pm_hdl);
-	if (!clk_off && ipa_net_initialized && sys->napi_obj)
+	if (!clk_off && ipa_net_initialized && sys->napi_obj) {
+		trace_ipa3_napi_schedule(sys->ep->client);
 		napi_schedule(sys->napi_obj);
-	else if (!clk_off &&
+	} else if (!clk_off &&
 		IPA_CLIENT_IS_LOW_LAT_CONS(sys->ep->client)) {
 		tasklet_schedule(&sys->tasklet);
 	} else
@@ -5272,6 +5275,9 @@ int ipa3_rx_poll(u32 clnt_hdl, int weight)
 		IPAERR("Invalid client.\n");
 		return cnt;
 	}
+	ep = &ipa3_ctx->ep[clnt_hdl];
+
+	trace_ipa3_napi_poll_entry(ep->client);
 
 	wan_def_sys = ipa3_ctx->ep[ipa_ep_idx].sys;
 	remain_aggr_weight = weight / IPA_WAN_AGGR_PKT_CNT;
@@ -5282,7 +5288,6 @@ int ipa3_rx_poll(u32 clnt_hdl, int weight)
 		return -EINVAL;
 	}
 
-	ep = &ipa3_ctx->ep[clnt_hdl];
 start_poll:
 	while (remain_aggr_weight > 0 &&
 			atomic_read(&ep->sys->curr_polling_state)) {
@@ -5327,6 +5332,7 @@ start_poll:
 		IPADBG_LOW("Client = %d not replenished free descripotrs\n",
 				ep->client);
 	}
+	trace_ipa3_napi_poll_exit(ep->client);
 	return cnt;
 }
 

+ 125 - 3
drivers/platform/msm/ipa/ipa_v3/ipa_trace.h

@@ -123,19 +123,35 @@ TRACE_EVENT(
 TRACE_EVENT(
 	rmnet_ipa_netif_rcv_skb3,
 
-	TP_PROTO(unsigned long rx_pkt_cnt),
+	TP_PROTO(const struct sk_buff *skb, unsigned long rx_pkt_cnt),
 
-	TP_ARGS(rx_pkt_cnt),
+	TP_ARGS(skb, rx_pkt_cnt),
 
 	TP_STRUCT__entry(
+		__string(name,			skb->dev->name)
+		__field(const void *,	skbaddr)
+		__field(u16,			protocol)
+		__field(unsigned int,	len)
+		__field(unsigned int,	data_len)
 		__field(unsigned long,	rx_pkt_cnt)
 	),
 
 	TP_fast_assign(
+		__assign_str(name, skb->dev->name);
+		__entry->skbaddr = skb;
+		__entry->protocol = ntohs(skb->protocol);
+		__entry->len = skb->len;
+		__entry->data_len = skb->data_len;
 		__entry->rx_pkt_cnt = rx_pkt_cnt;
 	),
 
-	TP_printk("rx_pkt_cnt=%lu", __entry->rx_pkt_cnt)
+	TP_printk("dev=%s skbaddr=%p protocol=0x%04x len=%u data_len=%u rx_pkt_cnt=%lu",
+		__get_str(name),
+		__entry->skbaddr,
+		__entry->protocol,
+		__entry->len,
+		__entry->data_len,
+		__entry->rx_pkt_cnt)
 );
 
 TRACE_EVENT(
@@ -174,6 +190,112 @@ TRACE_EVENT(
 	TP_printk("napi_overall_poll_pkt_cnt=%d", __entry->poll_num)
 );
 
+TRACE_EVENT(
+	ipa3_napi_schedule,
+
+	TP_PROTO(unsigned long client),
+
+	TP_ARGS(client),
+
+	TP_STRUCT__entry(
+		__field(unsigned long,	client)
+	),
+
+	TP_fast_assign(
+		__entry->client = client;
+	),
+
+	TP_printk("client=%lu", __entry->client)
+);
+
+TRACE_EVENT(
+	ipa3_napi_poll_entry,
+
+	TP_PROTO(unsigned long client),
+
+	TP_ARGS(client),
+
+	TP_STRUCT__entry(
+		__field(unsigned long,	client)
+	),
+
+	TP_fast_assign(
+		__entry->client = client;
+	),
+
+	TP_printk("client=%lu", __entry->client)
+);
+
+
+TRACE_EVENT(
+	ipa3_napi_poll_exit,
+
+	TP_PROTO(unsigned long client),
+
+	TP_ARGS(client),
+
+	TP_STRUCT__entry(
+		__field(unsigned long,	client)
+	),
+
+	TP_fast_assign(
+		__entry->client = client;
+	),
+
+	TP_printk("client=%lu", __entry->client)
+);
+
+TRACE_EVENT(
+	ipa3_tx_dp,
+
+	TP_PROTO(const struct sk_buff *skb, unsigned long client),
+
+	TP_ARGS(skb, client),
+
+	TP_STRUCT__entry(
+		__string(name,			skb->dev->name)
+		__field(const void *,	skbaddr)
+		__field(u16,			protocol)
+		__field(unsigned int,	len)
+		__field(unsigned int,	data_len)
+		__field(unsigned long,	client)
+	),
+
+	TP_fast_assign(
+		__assign_str(name, skb->dev->name);
+		__entry->skbaddr = skb;
+		__entry->protocol = ntohs(skb->protocol);
+		__entry->len = skb->len;
+		__entry->data_len = skb->data_len;
+		__entry->client = client;
+	),
+
+	TP_printk("dev=%s skbaddr=%p protocol=0x%04x len=%u data_len=%u client=%lu",
+		__get_str(name),
+		__entry->skbaddr,
+		__entry->protocol,
+		__entry->len,
+		__entry->data_len,
+		__entry->client)
+);
+
+TRACE_EVENT(
+	ipa3_tx_done,
+
+	TP_PROTO(unsigned long client),
+
+	TP_ARGS(client),
+
+	TP_STRUCT__entry(
+		__field(unsigned long,	client)
+	),
+
+	TP_fast_assign(
+		__entry->client = client;
+	),
+
+	TP_printk("client=%lu", __entry->client)
+);
 
 #endif /* _IPA_TRACE_H */
 

+ 1 - 1
drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c

@@ -1394,7 +1394,7 @@ static void apps_ipa_packet_receive_notify(void *priv,
 		skb->protocol = htons(ETH_P_MAP);
 
 		if (ipa3_rmnet_res.ipa_napi_enable) {
-			trace_rmnet_ipa_netif_rcv_skb3(dev->stats.rx_packets);
+			trace_rmnet_ipa_netif_rcv_skb3(skb, dev->stats.rx_packets);
 			result = netif_receive_skb(skb);
 		} else {
 			if (dev->stats.rx_packets % IPA_WWAN_RX_SOFTIRQ_THRESH