1 Star 0 Fork 32

fantaotao1/gazelle

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0008-fix-gazellectl-l-option-error.patch 2.12 KB
一键复制 编辑 原始数据 按行查看 历史
jinag12 提交于 2022-03-16 22:23 . fix gazelle test issue
From b9914a2ff92b34242eefd9d42bc80a8b0a6307c5 Mon Sep 17 00:00:00 2001
From: wuchangsheng <wuchangsheng2@huawei.com>
Date: Tue, 8 Mar 2022 14:45:59 +0800
Subject: [PATCH 08/34] fix gazellectl -l option error
---
src/ltran/ltran_dfx.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/ltran/ltran_dfx.c b/src/ltran/ltran_dfx.c
index 159fbb9..381d30d 100644
--- a/src/ltran/ltran_dfx.c
+++ b/src/ltran/ltran_dfx.c
@@ -1182,19 +1182,23 @@ static int32_t parse_dfx_cmd_args(int32_t argc, char *argv[], struct gazelle_sta
return num_cmd;
}
-static int32_t check_cmd_support(enum GAZELLE_STAT_MODE stat_mode)
+static int32_t check_cmd_support(struct gazelle_stat_msg_request *req_msg, int32_t req_msg_num)
{
- switch (stat_mode) {
+ switch (req_msg[0].stat_mode) {
case GAZELLE_STAT_LSTACK_LOG_LEVEL_SET:
case GAZELLE_STAT_LSTACK_SHOW:
case GAZELLE_STAT_LSTACK_SHOW_SNMP:
case GAZELLE_STAT_LSTACK_SHOW_CONN:
case GAZELLE_STAT_LSTACK_SHOW_LATENCY:
case GAZELLE_STAT_LSTACK_LOW_POWER_MDF:
- case GAZELLE_STAT_LTRAN_START_LATENCY:
return 0;
default:
- show_usage();
+ if (req_msg[0].stat_mode == GAZELLE_STAT_LTRAN_START_LATENCY &&
+ req_msg[req_msg_num - 1].stat_mode == GAZELLE_STAT_LSTACK_SHOW_LATENCY) {
+ return 0;
+ }
+ /* keep output consistency */
+ printf("connect ltran failed. errno: 111 ret=-1\n");
return -1;
}
@@ -1220,9 +1224,9 @@ int32_t main(int32_t argc, char *argv[])
g_gazelle_dfx_tbl[GAZELLE_STAT_LSTACK_SHOW].recv_size = sizeof(struct gazelle_stack_dfx_data);
g_gazelle_dfx_tbl[GAZELLE_STAT_LTRAN_START_LATENCY].recv_size =sizeof(struct gazelle_stack_dfx_data);
g_gazelle_dfx_tbl[GAZELLE_STAT_LTRAN_STOP_LATENCY].recv_size =sizeof(struct gazelle_stack_dfx_data);
- ret = check_cmd_support(req_msg[msg_index].stat_mode);
+ ret = check_cmd_support(req_msg, req_msg_num);
if (ret < 0) {
- return 0;
+ return -1;
}
}
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fantaotao1/gazelle.git
git@gitee.com:fantaotao1/gazelle.git
fantaotao1
gazelle
gazelle
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385