From 24b45463b653cf2aa204ca3ff303f8fe848d416f Mon Sep 17 00:00:00 2001
From: yinbin <yinbin8@huawei.com>
Date: Sat, 16 Dec 2023 20:21:21 +0800
Subject: [PATCH] fix gazellectl lstack show ip -r with ltran error && log info
 display unknow error

---
 src/lstack/core/lstack_stack_stat.c | 1 +
 src/ltran/ltran_dfx.c               | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lstack/core/lstack_stack_stat.c b/src/lstack/core/lstack_stack_stat.c
index e4ccc41..23571b4 100644
--- a/src/lstack/core/lstack_stack_stat.c
+++ b/src/lstack/core/lstack_stack_stat.c
@@ -201,6 +201,7 @@ static void get_stack_dfx_data(struct gazelle_stack_dfx_data *dfx, struct protoc
     switch (stat_mode) {
         case GAZELLE_STAT_LSTACK_SHOW:
         case GAZELLE_STAT_LSTACK_SHOW_RATE:
+        case GAZELLE_STAT_LTRAN_SHOW_LSTACK:
             get_stack_stats(dfx, stack);
 	    /* fall through */
         case GAZELLE_STAT_LSTACK_SHOW_AGGREGATE:
diff --git a/src/ltran/ltran_dfx.c b/src/ltran/ltran_dfx.c
index 25d4f35..5291fe0 100644
--- a/src/ltran/ltran_dfx.c
+++ b/src/ltran/ltran_dfx.c
@@ -99,7 +99,7 @@ static void gazelle_print_lstack_nic_features(void *buf, const struct gazelle_st
 static struct gazelle_dfx_list g_gazelle_dfx_tbl[] = {
     {GAZELLE_STAT_LTRAN_SHOW,          sizeof(struct gazelle_stat_ltran_total),  gazelle_print_ltran_stat_total},
     {GAZELLE_STAT_LTRAN_SHOW_RATE,     sizeof(struct gazelle_stat_ltran_total),  gazelle_print_ltran_stat_rate},
-    {GAZELLE_STAT_LTRAN_SHOW_LB_RATE,     sizeof(struct gazelle_stat_ltran_total),  gazelle_print_ltran_stat_lb_rate},
+    {GAZELLE_STAT_LTRAN_SHOW_LB_RATE,     sizeof(struct gazelle_stat_lstack_total),  gazelle_print_ltran_stat_lb_rate},
     {GAZELLE_STAT_LTRAN_SHOW_INSTANCE, sizeof(struct gazelle_stat_ltran_client), gazelle_print_ltran_stat_client},
     {GAZELLE_STAT_LTRAN_SHOW_BURST,    sizeof(struct gazelle_stat_ltran_total),  gazelle_print_ltran_stat_burst},
     {GAZELLE_STAT_LTRAN_SHOW_LATENCY,  sizeof(struct in_addr),                  gazelle_print_ltran_stat_latency},
-- 
2.27.0

