1 Star 0 Fork 32

hantwofish/gazelle_1

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0075-dfx-fix-gazellectl-lstack-show-ip-failed.patch 3.25 KB
一键复制 编辑 原始数据 按行查看 历史
yinbin6 提交于 2023-12-09 23:07 . sync upstream patch
From f2080c02b864d6ce7f07b874e489bb5ea98b837a Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng14@huawei.com>
Date: Wed, 6 Dec 2023 20:33:13 +0800
Subject: [PATCH] dfx: fix 'gazellectl lstack show ip' failed
---
src/common/gazelle_dfx_msg.h | 3 ++-
src/ltran/ltran_dfx.c | 7 +++++--
src/ltran/ltran_monitor.c | 2 +-
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/common/gazelle_dfx_msg.h b/src/common/gazelle_dfx_msg.h
index ac6ea5e..d2c6ef9 100644
--- a/src/common/gazelle_dfx_msg.h
+++ b/src/common/gazelle_dfx_msg.h
@@ -35,9 +35,10 @@ enum GAZELLE_STAT_MODE {
GAZELLE_STAT_LTRAN_LOG_LEVEL_SET,
GAZELLE_STAT_LTRAN_SHOW_SOCKTABLE,
GAZELLE_STAT_LTRAN_SHOW_CONNTABLE,
+ GAZELLE_STAT_LTRAN_SHOW_LSTACK,
- GAZELLE_STAT_LSTACK_LOG_LEVEL_SET,
GAZELLE_STAT_LSTACK_SHOW,
+ GAZELLE_STAT_LSTACK_LOG_LEVEL_SET,
GAZELLE_STAT_LSTACK_SHOW_RATE,
GAZELLE_STAT_LSTACK_SHOW_SNMP,
GAZELLE_STAT_LSTACK_SHOW_CONN,
diff --git a/src/ltran/ltran_dfx.c b/src/ltran/ltran_dfx.c
index d3ff527..c200b1d 100644
--- a/src/ltran/ltran_dfx.c
+++ b/src/ltran/ltran_dfx.c
@@ -105,8 +105,11 @@ static struct gazelle_dfx_list g_gazelle_dfx_tbl[] = {
{GAZELLE_STAT_LTRAN_LOG_LEVEL_SET, 0, gazelle_print_ltran_wait},
{GAZELLE_STAT_LTRAN_SHOW_SOCKTABLE, sizeof(struct gazelle_stat_forward_table), gazelle_print_ltran_sock},
{GAZELLE_STAT_LTRAN_SHOW_CONNTABLE, sizeof(struct gazelle_stat_forward_table), gazelle_print_ltran_conn},
+
+ {GAZELLE_STAT_LTRAN_SHOW_LSTACK, sizeof(struct gazelle_stat_lstack_total), gazelle_print_lstack_stat_total},
+ {GAZELLE_STAT_LSTACK_SHOW, sizeof(struct gazelle_stack_dfx_data), gazelle_print_lstack_stat_total},
+
{GAZELLE_STAT_LSTACK_LOG_LEVEL_SET, 0, gazelle_print_ltran_wait},
- {GAZELLE_STAT_LSTACK_SHOW, sizeof(struct gazelle_stat_lstack_total), gazelle_print_lstack_stat_total},
{GAZELLE_STAT_LSTACK_SHOW_RATE, sizeof(struct gazelle_stack_dfx_data), gazelle_print_lstack_stat_rate},
{GAZELLE_STAT_LSTACK_SHOW_SNMP, sizeof(struct gazelle_stack_dfx_data), gazelle_print_lstack_stat_snmp},
{GAZELLE_STAT_LSTACK_SHOW_CONN, sizeof(struct gazelle_stack_dfx_data), gazelle_print_lstack_stat_conn},
@@ -1265,7 +1268,7 @@ static int32_t parse_dfx_lstack_show_args(int32_t argc, char *argv[], struct gaz
long int delay = 1;
if (argc == GAZELLE_LSTACK_PARAM_NUM) {
- req_msg[cmd_index++].stat_mode = GAZELLE_STAT_LSTACK_SHOW;
+ req_msg[cmd_index++].stat_mode = g_use_ltran ? GAZELLE_STAT_LTRAN_SHOW_LSTACK : GAZELLE_STAT_LSTACK_SHOW;
return cmd_index;
}
diff --git a/src/ltran/ltran_monitor.c b/src/ltran/ltran_monitor.c
index 792db89..b2bcc07 100644
--- a/src/ltran/ltran_monitor.c
+++ b/src/ltran/ltran_monitor.c
@@ -338,7 +338,7 @@ static int32_t lstack_req_mode_process(int32_t fd, const struct gazelle_stat_msg
case GAZELLE_STAT_LTRAN_SHOW_LB_RATE:
handle_resp_lstack_total(req_msg, fd);
break;
- case GAZELLE_STAT_LSTACK_SHOW:
+ case GAZELLE_STAT_LTRAN_SHOW_LSTACK:
handle_resp_lstack_total(req_msg, fd);
handle_resp_lstack_transfer(req_msg, fd);
break;
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hantwofish/gazelle_1.git
git@gitee.com:hantwofish/gazelle_1.git
hantwofish
gazelle_1
gazelle_1
master

搜索帮助