Skip to contentSkip to conversation

ath10k: HTT stats

PATCH In review Kalle Valo 1 participant 5 messages Sep 3, 2013 – Sep 6, 2013 Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore

Kalle Valo

author
#0 lore raw

cover ath10k: HTT stats

Adds trace events and a debugfs interface to enable HTT stats from firmware.

---

Kalle Valo (3):
ath10k: add trace event ath10k_htt_stats
ath10k: implement ath10k_debug_start/stop()
ath10k: add htt_stats_enable debugfs file

 drivers/net/wireless/ath/ath10k/core.c   |    6 +
 drivers/net/wireless/ath/ath10k/core.h   |    3 +
 drivers/net/wireless/ath/ath10k/debug.c  |  121 ++++++++++++++++++++++++++++++
 drivers/net/wireless/ath/ath10k/debug.h  |   11 +++
 drivers/net/wireless/ath/ath10k/htt.h    |    1 
 drivers/net/wireless/ath/ath10k/htt_rx.c |    5 +
 drivers/net/wireless/ath/ath10k/htt_tx.c |   42 ++++++++++
 drivers/net/wireless/ath/ath10k/trace.h  |   21 +++++
 8 files changed, 209 insertions(+), 1 deletion(-)
author
#1 lore raw

PATCH 1/3 ath10k: add trace event ath10k_htt_stats

For analysing various data path statistics in user space.

---
 drivers/net/wireless/ath/ath10k/htt_rx.c |    5 ++++-
 drivers/net/wireless/ath/ath10k/trace.h  |   21 +++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/htt_rx.c +4 -1
index 9bb0ae89..af31d2f 100644
@@ -20,6 +20,7 @@
 #include "htt.h"
 #include "txrx.h"
 #include "debug.h"
+#include "trace.h"
 
 #include <linux/log2.h>
 
@@ -1198,8 +1199,10 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
 	case HTT_T2H_MSG_TYPE_TEST:
 		/* FIX THIS */
 		break;
-	case HTT_T2H_MSG_TYPE_TX_INSPECT_IND:
 	case HTT_T2H_MSG_TYPE_STATS_CONF:
+		trace_ath10k_htt_stats(skb->data, skb->len);
+		break;
+	case HTT_T2H_MSG_TYPE_TX_INSPECT_IND:
 	case HTT_T2H_MSG_TYPE_RX_ADDBA:
 	case HTT_T2H_MSG_TYPE_RX_DELBA:
 	case HTT_T2H_MSG_TYPE_RX_FLUSH:
drivers/net/wireless/ath/ath10k/trace.h +21 -0
index 85e806b..bf1ceb8 100644
@@ -158,6 +158,27 @@ TRACE_EVENT(ath10k_wmi_event,
 	)
 );
 
+TRACE_EVENT(ath10k_htt_stats,
+	TP_PROTO(void *buf, size_t buf_len),
+
+	TP_ARGS(buf, buf_len),
+
+	TP_STRUCT__entry(
+		__field(size_t, buf_len)
+		__dynamic_array(u8, buf, buf_len)
+	),
+
+	TP_fast_assign(
+		__entry->buf_len = buf_len;
+		memcpy(__get_dynamic_array(buf), buf, buf_len);
+	),
+
+	TP_printk(
+		"len %zu",
+		__entry->buf_len
+	)
+);
+
 #endif /* _TRACE_H_ || TRACE_HEADER_MULTI_READ*/
 
 /* we don't want to use include/trace/events */
author
#2 lore raw

PATCH 2/3 ath10k: implement ath10k_debug_start/stop()

In reply to Kalle Valo

Needed for the HTT stats implementation.

---
 drivers/net/wireless/ath/ath10k/core.c  |    6 ++++++
 drivers/net/wireless/ath/ath10k/debug.c |   10 ++++++++++
 drivers/net/wireless/ath/ath10k/debug.h |   11 +++++++++++
 3 files changed, 27 insertions(+)
drivers/net/wireless/ath/ath10k/core.c +6 -0
index 2dd39a8..4f2b0e7 100644
@@ -630,6 +630,10 @@ int ath10k_core_start(struct ath10k *ar)
 	if (status)
 		goto err_disconnect_htc;
 
+	status = ath10k_debug_start(ar);
+	if (status)
+		goto err_disconnect_htc;
+
 	ar->free_vdev_map = (1 << TARGET_NUM_VDEVS) - 1;
 
 	return 0;
@@ -647,6 +651,7 @@ EXPORT_SYMBOL(ath10k_core_start);
 
 void ath10k_core_stop(struct ath10k *ar)
 {
+	ath10k_debug_stop(ar);
 	ath10k_htc_stop(&ar->htc);
 	ath10k_htt_detach(&ar->htt);
 	ath10k_wmi_detach(ar);
@@ -777,6 +782,7 @@ void ath10k_core_unregister(struct ath10k *ar)
 	 * Otherwise we will fail to submit commands to FW and mac80211 will be
 	 * unhappy about callback failures. */
 	ath10k_mac_unregister(ar);
+
 	ath10k_core_free_firmware_files(ar);
 }
 EXPORT_SYMBOL(ath10k_core_unregister);
drivers/net/wireless/ath/ath10k/debug.c +10 -0
index 09f535a..219d469 100644
@@ -517,6 +517,15 @@ static const struct file_operations fops_chip_id = {
 	.llseek = default_llseek,
 };
 
+int ath10k_debug_start(struct ath10k *ar)
+{
+	return 0;
+}
+
+void ath10k_debug_stop(struct ath10k *ar)
+{
+}
+
 int ath10k_debug_create(struct ath10k *ar)
 {
 	ar->debug.debugfs_phy = debugfs_create_dir("ath10k",
@@ -541,6 +550,7 @@ int ath10k_debug_create(struct ath10k *ar)
 
 	return 0;
 }
+
 #endif /* CONFIG_ATH10K_DEBUGFS */
 
 #ifdef CONFIG_ATH10K_DEBUG
drivers/net/wireless/ath/ath10k/debug.h +11 -0
index 168140c..9c442a8 100644
@@ -42,6 +42,8 @@ extern __printf(1, 2) int ath10k_err(const char *fmt, ...);
 extern __printf(1, 2) int ath10k_warn(const char *fmt, ...);
 
 #ifdef CONFIG_ATH10K_DEBUGFS
+int ath10k_debug_start(struct ath10k *ar);
+void ath10k_debug_stop(struct ath10k *ar);
 int ath10k_debug_create(struct ath10k *ar);
 void ath10k_debug_read_service_map(struct ath10k *ar,
 				   void *service_map,
@@ -50,6 +52,15 @@ void ath10k_debug_read_target_stats(struct ath10k *ar,
 				    struct wmi_stats_event *ev);
 
 #else
+int ath10k_debug_start(struct ath10k *ar)
+{
+	return 0;
+}
+
+void ath10k_debug_stop(struct ath10k *ar)
+{
+}
+
 static inline int ath10k_debug_create(struct ath10k *ar)
 {
 	return 0;
author
#3 lore raw

PATCH 3/3 ath10k: add htt_stats_enable debugfs file

In reply to Kalle Valo
---
 drivers/net/wireless/ath/ath10k/core.h   |    3 +
 drivers/net/wireless/ath/ath10k/debug.c  |  111 ++++++++++++++++++++++++++++++
 drivers/net/wireless/ath/ath10k/htt.h    |    1 
 drivers/net/wireless/ath/ath10k/htt_tx.c |   42 +++++++++++
 4 files changed, 157 insertions(+)
drivers/net/wireless/ath/ath10k/core.h +3 -0
index 174c4b4..22b17d6 100644
@@ -246,6 +246,9 @@ struct ath10k_debug {
 	u32 wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
 
 	struct completion event_stats_compl;
+
+	unsigned long htt_stats_mask;
+	struct delayed_work htt_stats_dwork;
 };
 
 enum ath10k_state {
drivers/net/wireless/ath/ath10k/debug.c +111 -0

142 lines not on this page · raw message

drivers/net/wireless/ath/ath10k/htt.h +1 -0
index 26c78a9..e090902 100644
@@ -1327,6 +1327,7 @@ void ath10k_htt_rx_detach(struct ath10k_htt *htt);
 void ath10k_htt_htc_tx_complete(struct ath10k *ar, struct sk_buff *skb);
 void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb);
 int ath10k_htt_h2t_ver_req_msg(struct ath10k_htt *htt);
+int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie);
 int ath10k_htt_send_rx_ring_cfg_ll(struct ath10k_htt *htt);
 
 void __ath10k_htt_tx_dec_pending(struct ath10k_htt *htt);
drivers/net/wireless/ath/ath10k/htt_tx.c +42 -0

48 lines not on this page · raw message

author
#4 lore raw
In reply to Kalle Valo
Quoted 9 lines · Kalle Valo

Adds trace events and a debugfs interface to enable HTT stats from firmware.

---

Kalle Valo (3):
ath10k: add trace event ath10k_htt_stats
ath10k: implement ath10k_debug_start/stop()
ath10k: add htt_stats_enable debugfs file

All three applied.

Signature · 1 line
Kalle Valo