ath10k: add tracing for rx descriptor
authorRajkumar Manoharan <rmanohar@qti.qualcomm.com>
Fri, 3 Oct 2014 05:02:47 +0000 (08:02 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 7 Oct 2014 14:10:40 +0000 (17:10 +0300)
Upon the reception of frame, the descriptor status are reported
to user space by tracepoint. This is useful for collecting rx
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_rx.c
drivers/net/wireless/ath/ath10k/trace.h

index a078451b4620a4201bb2e4e66b52578641f74bd4..7add88ea0e2e275e54322f9fba8c0101c2fe354c 100644 (file)
@@ -316,6 +316,7 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt,
        int msdu_len, msdu_chaining = 0;
        struct sk_buff *msdu, *next;
        struct htt_rx_desc *rx_desc;
+       u32 tsf;
 
        lockdep_assert_held(&htt->rx_ring.lock);
 
@@ -447,6 +448,9 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt,
                last_msdu = __le32_to_cpu(rx_desc->msdu_end.info0) &
                                RX_MSDU_END_INFO0_LAST_MSDU;
 
+               tsf = __le32_to_cpu(rx_desc->ppdu_end.tsf_timestamp);
+               trace_ath10k_htt_rx_desc(ar, tsf, &rx_desc->attention,
+                                        sizeof(*rx_desc) - sizeof(u32));
                if (last_msdu) {
                        msdu->next = NULL;
                        break;
index 971ff23b600791228fd3d4978727945ea4faa6ce..3841667e3a85a9651b0f33d304cccd9f749671f3 100644 (file)
@@ -281,6 +281,35 @@ TRACE_EVENT(ath10k_htt_pktlog,
         )
 );
 
+TRACE_EVENT(ath10k_htt_rx_desc,
+           TP_PROTO(struct ath10k *ar, u32 tsf, void *rxdesc, u16 len),
+
+       TP_ARGS(ar, tsf, rxdesc, len),
+
+       TP_STRUCT__entry(
+               __string(device, dev_name(ar->dev))
+               __string(driver, dev_driver_string(ar->dev))
+               __field(u32, tsf)
+               __field(u16, len)
+               __dynamic_array(u8, rxdesc, len)
+       ),
+
+       TP_fast_assign(
+               __assign_str(device, dev_name(ar->dev));
+               __assign_str(driver, dev_driver_string(ar->dev));
+               __entry->tsf = tsf;
+               __entry->len = len;
+               memcpy(__get_dynamic_array(rxdesc), rxdesc, len);
+       ),
+
+       TP_printk(
+               "%s %s %u len %hu",
+               __get_str(driver),
+               __get_str(device),
+               __entry->tsf,
+               __entry->len
+        )
+);
 #endif /* _TRACE_H_ || TRACE_HEADER_MULTI_READ*/
 
 /* we don't want to use include/trace/events */