ath10k: add tracing for ath10k_htt_pktlog
authorRajkumar Manoharan <rmanohar@qti.qualcomm.com>
Fri, 3 Oct 2014 05:02:40 +0000 (08:02 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 7 Oct 2014 14:10:27 +0000 (17:10 +0300)
This is useful for collecting pktlog statistics of tx, rx
and rate information, so add tracing for the API call.

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

index ce86ed29e11904c32804f3e013e13d2102fead4d..0c934a8378dba315489df956626b284027f1a585 100644 (file)
@@ -69,7 +69,6 @@ struct ath10k_fw_crash_data *
 ath10k_debug_get_new_fw_crash_data(struct ath10k *ar);
 
 void ath10k_debug_dbglog_add(struct ath10k *ar, u8 *buffer, int len);
-
 #define ATH10K_DFS_STAT_INC(ar, c) (ar->debug.dfs_stats.c++)
 
 void ath10k_debug_get_et_strings(struct ieee80211_hw *hw,
index 3b44217a6c190b70749182037e051583983b6c48..15c58e884b6a3ed2a09f09cf318e9fd8f3bad1ce 100644 (file)
@@ -725,7 +725,7 @@ static inline u8 *htt_rx_test_get_chars(struct htt_rx_test *rx_test)
  */
 struct htt_pktlog_msg {
        u8 pad[3];
-       __le32 payload[1 /* or more */];
+       u8 payload[0];
 } __packed;
 
 struct htt_dbg_stats_rx_reorder_stats {
index 60d40a04508b1d8189f41dd88d417d76d68ac50a..a078451b4620a4201bb2e4e66b52578641f74bd4 100644 (file)
@@ -1674,6 +1674,15 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
        case HTT_T2H_MSG_TYPE_RX_DELBA:
                ath10k_htt_rx_delba(ar, resp);
                break;
+       case HTT_T2H_MSG_TYPE_PKTLOG: {
+               struct ath10k_pktlog_hdr *hdr =
+                       (struct ath10k_pktlog_hdr *)resp->pktlog_msg.payload;
+
+               trace_ath10k_htt_pktlog(ar, resp->pktlog_msg.payload,
+                                       sizeof(*hdr) +
+                                       __le16_to_cpu(hdr->size));
+               break;
+       }
        case HTT_T2H_MSG_TYPE_RX_FLUSH: {
                /* Ignore this event because mac80211 takes care of Rx
                 * aggregation reordering.
index 006a9cbc60b262f70f267bd889ff51200faa6853..4b86ca363b39fda20ce1b5875ecd7e36cdc3959b 100644 (file)
@@ -80,6 +80,15 @@ enum ath10k_mcast2ucast_mode {
        ATH10K_MCAST2UCAST_ENABLED = 1,
 };
 
+struct ath10k_pktlog_hdr {
+       __le16 flags;
+       __le16 missed_cnt;
+       __le16 log_type;
+       __le16 size;
+       __le32 timestamp;
+       u8 payload[0];
+} __packed;
+
 /* Target specific defines for MAIN firmware */
 #define TARGET_NUM_VDEVS                       8
 #define TARGET_NUM_PEER_AST                    2
index 574b75ab260988a6525339ed44623e71e790a273..971ff23b600791228fd3d4978727945ea4faa6ce 100644 (file)
@@ -254,6 +254,33 @@ TRACE_EVENT(ath10k_wmi_dbglog,
        )
 );
 
+TRACE_EVENT(ath10k_htt_pktlog,
+           TP_PROTO(struct ath10k *ar, void *buf, u16 buf_len),
+
+       TP_ARGS(ar, buf, buf_len),
+
+       TP_STRUCT__entry(
+               __string(device, dev_name(ar->dev))
+               __string(driver, dev_driver_string(ar->dev))
+               __field(u16, buf_len)
+               __dynamic_array(u8, pktlog, buf_len)
+       ),
+
+       TP_fast_assign(
+               __assign_str(device, dev_name(ar->dev));
+               __assign_str(driver, dev_driver_string(ar->dev));
+               __entry->buf_len = buf_len;
+               memcpy(__get_dynamic_array(pktlog), buf, buf_len);
+       ),
+
+       TP_printk(
+               "%s %s size %hu",
+               __get_str(driver),
+               __get_str(device),
+               __entry->buf_len
+        )
+);
+
 #endif /* _TRACE_H_ || TRACE_HEADER_MULTI_READ*/
 
 /* we don't want to use include/trace/events */