ath10k: add tracing for tx info
authorRajkumar Manoharan <rmanohar@qti.qualcomm.com>
Fri, 3 Oct 2014 05:02:54 +0000 (08:02 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 7 Oct 2014 14:10:47 +0000 (17:10 +0300)
The tx info such as msdu_id, frame len, vdev id and tid are reported
to user space by tracepoint. This is useful for collecting tx
statistics.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/htt_tx.c
drivers/net/wireless/ath/ath10k/trace.h
drivers/net/wireless/ath/ath10k/txrx.c

index bd87a35201d895856620719dc5477fbedb3d7062..fdfb1713b17310a9f2e16bff487b7e105f25e615 100644 (file)
@@ -557,6 +557,7 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
        skb_cb->htt.txbuf->cmd_tx.frags_paddr = __cpu_to_le32(frags_paddr);
        skb_cb->htt.txbuf->cmd_tx.peerid = __cpu_to_le32(HTT_INVALID_PEERID);
 
+       trace_ath10k_htt_tx(ar, msdu_id, msdu->len, vdev_id, tid);
        ath10k_dbg(ar, ATH10K_DBG_HTT,
                   "htt tx flags0 %hhu flags1 %hu len %d id %hu frags_paddr %08x, msdu_paddr %08x vdev %hhu tid %hhu\n",
                   flags0, flags1, msdu->len, msdu_id, frags_paddr,
index 3841667e3a85a9651b0f33d304cccd9f749671f3..33b9bf4387f830cdeea8620d118382a20ed8b193 100644 (file)
@@ -310,6 +310,66 @@ TRACE_EVENT(ath10k_htt_rx_desc,
                __entry->len
         )
 );
+
+TRACE_EVENT(ath10k_htt_tx,
+           TP_PROTO(struct ath10k *ar, u16 msdu_id, u16 msdu_len,
+                    u8 vdev_id, u8 tid),
+
+       TP_ARGS(ar, msdu_id, msdu_len, vdev_id, tid),
+
+       TP_STRUCT__entry(
+               __string(device, dev_name(ar->dev))
+               __string(driver, dev_driver_string(ar->dev))
+               __field(u16, msdu_id)
+               __field(u16, msdu_len)
+               __field(u8, vdev_id)
+               __field(u8, tid)
+       ),
+
+       TP_fast_assign(
+               __assign_str(device, dev_name(ar->dev));
+               __assign_str(driver, dev_driver_string(ar->dev));
+               __entry->msdu_id = msdu_id;
+               __entry->msdu_len = msdu_len;
+               __entry->vdev_id = vdev_id;
+               __entry->tid = tid;
+       ),
+
+       TP_printk(
+               "%s %s msdu_id %d msdu_len %d vdev_id %d tid %d",
+               __get_str(driver),
+               __get_str(device),
+               __entry->msdu_id,
+               __entry->msdu_len,
+               __entry->vdev_id,
+               __entry->tid
+        )
+);
+
+TRACE_EVENT(ath10k_txrx_tx_unref,
+           TP_PROTO(struct ath10k *ar, u16 msdu_id),
+
+       TP_ARGS(ar, msdu_id),
+
+       TP_STRUCT__entry(
+               __string(device, dev_name(ar->dev))
+               __string(driver, dev_driver_string(ar->dev))
+               __field(u16, msdu_id)
+       ),
+
+       TP_fast_assign(
+               __assign_str(device, dev_name(ar->dev));
+               __assign_str(driver, dev_driver_string(ar->dev));
+               __entry->msdu_id = msdu_id;
+       ),
+
+       TP_printk(
+               "%s %s msdu_id %d",
+               __get_str(driver),
+               __get_str(device),
+               __entry->msdu_id
+        )
+);
 #endif /* _TRACE_H_ || TRACE_HEADER_MULTI_READ*/
 
 /* we don't want to use include/trace/events */
index a0cbc21d0d4b9146ff4a4f578f29be2f88bcdc13..f9c90e37bc7c3ad05d3ccf8a53bb58e729b55d3b 100644 (file)
@@ -78,6 +78,7 @@ void ath10k_txrx_tx_unref(struct ath10k_htt *htt,
 
        info = IEEE80211_SKB_CB(msdu);
        memset(&info->status, 0, sizeof(info->status));
+       trace_ath10k_txrx_tx_unref(ar, tx_done->msdu_id);
 
        if (tx_done->discard) {
                ieee80211_free_txskb(htt->ar->hw, msdu);