mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-21 19:31:55 +00:00
137 lines
4.4 KiB
Diff
137 lines
4.4 KiB
Diff
From d8f091827da0ac6c2da81c94f9028b3b8b9c0bc0 Mon Sep 17 00:00:00 2001
|
|
From: Saleemuddin Shaik <quic_saleemud@quicinc.com>
|
|
Date: Mon, 3 Jul 2023 17:13:54 +0530
|
|
Subject: [PATCH] ath12k: add per histogram count support.
|
|
|
|
Added the tlv for accessing HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG,
|
|
Total 100 histogram counts will be retrived.
|
|
Support to monitor PER stats measured for a set of stations added.
|
|
|
|
To print the per_histogram_count.
|
|
commands:
|
|
echo 9 > /sys/kernel/debug/ath12k/qcn9274 hw2.0_0004:01:00.0/mac0/htt_stats_type
|
|
cat /sys/kernel/debug/ath12k/qcn9274 hw2.0_0004:01:00.0/mac0/htt_stats
|
|
|
|
Signed-off-by: Saleemuddin Shaik <quic_saleemud@quicinc.com>
|
|
---
|
|
.../wireless/ath/ath12k/debugfs_htt_stats.c | 71 +++++++++++++++++++
|
|
.../wireless/ath/ath12k/debugfs_htt_stats.h | 6 ++
|
|
2 files changed, 77 insertions(+)
|
|
|
|
diff --git a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c
|
|
index 3b0bb4a..4f5f7af 100644
|
|
--- a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c
|
|
+++ b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c
|
|
@@ -13,6 +13,7 @@
|
|
|
|
#define HTT_MAX_STRING_LEN 256
|
|
#define HTT_MAX_PRINT_CHAR_PER_ELEM 15
|
|
+#define HTT_HISTOGRAM_STATS_LEN 512
|
|
|
|
|
|
#define PRINT_ARRAY_TO_BUF(out, buflen, arr, str, len, newline) \
|
|
@@ -8042,6 +8043,74 @@ static inline void htt_print_dlpager_stats_tlv(const void *tag_buf,
|
|
stats_req->buf_len = len;
|
|
}
|
|
|
|
+static inline void htt_print_histogram_stats_tlv(const void *tag_buf,
|
|
+ struct debug_htt_stats_req *stats_req)
|
|
+{
|
|
+ const struct htt_tx_histogram_stats_tlv *htt_stats_buf = tag_buf;
|
|
+ u8 i = 0;
|
|
+ u16 index = 0;
|
|
+ u8 *buf = stats_req->buf;
|
|
+ u32 len = stats_req->buf_len;
|
|
+ u32 buf_len = ATH12K_HTT_STATS_BUF_SIZE;
|
|
+ char data[HTT_HISTOGRAM_STATS_LEN] = {0};
|
|
+
|
|
+ len += scnprintf(buf + len, buf_len - len, "PER_HISTOGRAM_STATS\n");
|
|
+
|
|
+ index = 0;
|
|
+ memset(data, 0x0, HTT_HISTOGRAM_STATS_LEN);
|
|
+
|
|
+ for (i = 0 ; i < 25; i++) {
|
|
+ index += scnprintf(&data[index],
|
|
+ HTT_HISTOGRAM_STATS_LEN - index,
|
|
+ " %u:%u,", i, htt_stats_buf->per_histogram_cnt[i]);
|
|
+ if (index >= HTT_HISTOGRAM_STATS_LEN)
|
|
+ break;
|
|
+ }
|
|
+
|
|
+ len += scnprintf(buf + len, buf_len - len, "Per_histogram_cnt: %s\n", data);
|
|
+
|
|
+ index = 0;
|
|
+ memset(data, 0x0, HTT_HISTOGRAM_STATS_LEN);
|
|
+
|
|
+ for (i = 25 ; i < 50; i++) {
|
|
+ index += scnprintf(&data[index],
|
|
+ HTT_HISTOGRAM_STATS_LEN - index,
|
|
+ " %u:%u,", i, htt_stats_buf->per_histogram_cnt[i]);
|
|
+ if (index >= HTT_HISTOGRAM_STATS_LEN)
|
|
+ break;
|
|
+ }
|
|
+
|
|
+ len += scnprintf(buf + len, buf_len - len, " %s\n", data);
|
|
+
|
|
+ index = 0;
|
|
+ memset(data, 0x0, HTT_HISTOGRAM_STATS_LEN);
|
|
+
|
|
+ for (i = 50 ; i < 75; i++) {
|
|
+ index += scnprintf(&data[index],
|
|
+ HTT_HISTOGRAM_STATS_LEN - index,
|
|
+ " %u:%u,", i, htt_stats_buf->per_histogram_cnt[i]);
|
|
+ if (index >= HTT_HISTOGRAM_STATS_LEN)
|
|
+ break;
|
|
+ }
|
|
+
|
|
+ len += scnprintf(buf + len, buf_len - len, " %s\n", data);
|
|
+
|
|
+ index = 0;
|
|
+ memset(data, 0x0, HTT_HISTOGRAM_STATS_LEN);
|
|
+
|
|
+ for (i = 75 ; i < HTT_TX_PDEV_STATS_NUM_PER_COUNTERS; i++) {
|
|
+ index += scnprintf(&data[index],
|
|
+ HTT_HISTOGRAM_STATS_LEN - index,
|
|
+ " %u:%u,", i, htt_stats_buf->per_histogram_cnt[i]);
|
|
+ if (index >= HTT_HISTOGRAM_STATS_LEN)
|
|
+ break;
|
|
+ }
|
|
+
|
|
+ len += scnprintf(buf + len, buf_len - len, " %s\n", data);
|
|
+
|
|
+ stats_req->buf_len = len;
|
|
+}
|
|
+
|
|
static int ath12k_dbg_htt_ext_stats_parse(struct ath12k_base *ab,
|
|
u16 tag, u16 len, const void *tag_buf,
|
|
void *user_data)
|
|
@@ -8670,6 +8739,8 @@ static int ath12k_dbg_htt_ext_stats_parse(struct ath12k_base *ab,
|
|
case HTT_STATS_TX_PDEV_MLO_TXOP_ABORT_TAG:
|
|
htt_print_tx_pdev_stats_mlo_txop_abort_tlv_v(tag_buf, len, stats_req);
|
|
break;
|
|
+ case HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG:
|
|
+ htt_print_histogram_stats_tlv(tag_buf, stats_req);
|
|
default:
|
|
break;
|
|
}
|
|
diff --git a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.h b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.h
|
|
index 9f642ce..ce1ff5f 100644
|
|
--- a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.h
|
|
+++ b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.h
|
|
@@ -2551,6 +2551,12 @@ struct htt_rx_pdev_be_ul_mimo_user_stats_tlv {
|
|
u32 be_rx_ulmumimo_mpdu_fail;
|
|
};
|
|
|
|
+struct htt_tx_histogram_stats_tlv {
|
|
+ u32 rate_retry_mcs_drop_cnt;
|
|
+ u32 mcs_drop_rate[HTT_TX_PDEV_STATS_NUM_MCS_DROP_COUNTERS];
|
|
+ u32 per_histogram_cnt[HTT_TX_PDEV_STATS_NUM_PER_COUNTERS];
|
|
+};
|
|
+
|
|
struct htt_rx_pdev_ul_mumimo_trig_be_stats_tlv {
|
|
u32 mac_id__word;
|
|
|
|
--
|
|
2.17.1
|
|
|