From 295ad7d27233404457488089453a51d39e4d8038 Mon Sep 17 00:00:00 2001
From: yangchen <yangchen145@huawei.com>
Date: Mon, 8 Jan 2024 09:12:59 +0800
Subject: [PATCH] gazellectl: add tcp_input empty ack cnt

---
 src/common/gazelle_dfx_msg.h |  1 +
 src/ltran/ltran_dfx.c        | 29 +++++++++++++++--------------
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/src/common/gazelle_dfx_msg.h b/src/common/gazelle_dfx_msg.h
index 478c440..d58a072 100644
--- a/src/common/gazelle_dfx_msg.h
+++ b/src/common/gazelle_dfx_msg.h
@@ -143,6 +143,7 @@ struct gazelle_stat_lstack_snmp {
     uint32_t tcp_out_of_seq;
     uint32_t tcp_acceptmbox_full;
     uint32_t tcp_listen_drops;
+    uint32_t tcp_in_empty_acks;
 
     /* UDP */
     uint32_t udp_in_datagrams;
diff --git a/src/ltran/ltran_dfx.c b/src/ltran/ltran_dfx.c
index 08c9da3..5d4e74c 100644
--- a/src/ltran/ltran_dfx.c
+++ b/src/ltran/ltran_dfx.c
@@ -855,21 +855,22 @@ static void gazelle_print_lstack_stat_rate(void *buf, const struct gazelle_stat_
 
 static void gazelle_print_lstack_tcp_stat(const struct gazelle_stat_lstack_snmp *snmp)
 {
-    printf("tcp_act_open: %u\n",     snmp->tcp_act_open);
-    printf("tcp_passive_open: %u\n", snmp->tcp_passive_open);
-    printf("tcp_attempt_fail: %u\n", snmp->tcp_attempt_fail);
-    printf("tcp_estab_rst: %u\n",    snmp->tcp_estab_rst);
-    printf("tcp_out_seg: %u\n",      snmp->tcp_out_seg);
-    printf("tcp_retran_seg: %u\n",   snmp->tcp_retran_seg);
-    printf("tcp_in_seg: %u\n",       snmp->tcp_in_seg);
-    printf("tcp_in_err: %u\n",       snmp->tcp_in_err);
-    printf("tcp_out_rst: %u\n",      snmp->tcp_out_rst);
-    printf("tcp_fin_ack_cnt: %u\n",  snmp->tcp_fin_ack_cnt);
-    printf("tcp_delay_ack_cnt: %u\n", snmp->tcp_delay_ack_cnt);
-    printf("tcp_refused_cnt: %u\n",  snmp->tcp_refused_cnt);
-    printf("tcp_out_of_seq: %u\n",  snmp->tcp_out_of_seq);
+    printf("tcp_act_open: %u\n",         snmp->tcp_act_open);
+    printf("tcp_passive_open: %u\n",     snmp->tcp_passive_open);
+    printf("tcp_attempt_fail: %u\n",     snmp->tcp_attempt_fail);
+    printf("tcp_estab_rst: %u\n",        snmp->tcp_estab_rst);
+    printf("tcp_out_seg: %u\n",          snmp->tcp_out_seg);
+    printf("tcp_retran_seg: %u\n",       snmp->tcp_retran_seg);
+    printf("tcp_in_seg: %u\n",           snmp->tcp_in_seg);
+    printf("tcp_in_err: %u\n",           snmp->tcp_in_err);
+    printf("tcp_out_rst: %u\n",          snmp->tcp_out_rst);
+    printf("tcp_fin_ack_cnt: %u\n",      snmp->tcp_fin_ack_cnt);
+    printf("tcp_delay_ack_cnt: %u\n",    snmp->tcp_delay_ack_cnt);
+    printf("tcp_refused_cnt: %u\n",      snmp->tcp_refused_cnt);
+    printf("tcp_out_of_seq: %u\n",       snmp->tcp_out_of_seq);
     printf("tcp_acceptmbox_full: %u\n",  snmp->tcp_acceptmbox_full);
-    printf("tcp_listen_drops: %u\n",  snmp->tcp_listen_drops);
+    printf("tcp_listen_drops: %u\n",     snmp->tcp_listen_drops);
+    printf("tcp_in_empty_acks: %u\n",    snmp->tcp_in_empty_acks);
 }
 
 static void gazelle_print_ltran_stat_lb_rate(void *buf, const struct gazelle_stat_msg_request *req_msg)
-- 
2.33.0

