1 Star 0 Fork 32

misaka00251/gazelle

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0028-fix-lstack-show-latency.patch 2.37 KB
一键复制 编辑 原始数据 按行查看 历史
jinag12 提交于 2022-03-16 22:23 . fix gazelle test issue
From 53969ac0be85346d2abd776c66d4ff244c9f5da7 Mon Sep 17 00:00:00 2001
From: wuchangsheng <wuchangsheng2@huawei.com>
Date: Mon, 14 Mar 2022 22:41:57 +0800
Subject: [PATCH 28/34] fix lstack show latency
---
src/lstack/core/lstack_init.c | 6 ++++++
src/lstack/core/lstack_stack_stat.c | 5 +++++
src/ltran/ltran_dfx.c | 2 --
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/lstack/core/lstack_init.c b/src/lstack/core/lstack_init.c
index df60c4f..17195c8 100644
--- a/src/lstack/core/lstack_init.c
+++ b/src/lstack/core/lstack_init.c
@@ -190,6 +190,12 @@ __attribute__((constructor)) void gazelle_network_init(void)
LSTACK_EXIT(1, "pthread_getaffinity_np failed\n");
}
+ /* to prevent crash , just ignore SIGPIPE when socket is closed */
+ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
+ LSTACK_PRE_LOG(LSTACK_ERR, "signal error, errno:%d.", errno);
+ LSTACK_EXIT(1, "signal SIGPIPE SIG_IGN\n");
+ }
+
/*
* Phase 6: Init control plane and dpdk init */
pthread_t tid;
diff --git a/src/lstack/core/lstack_stack_stat.c b/src/lstack/core/lstack_stack_stat.c
index 9a8fd08..1813906 100644
--- a/src/lstack/core/lstack_stack_stat.c
+++ b/src/lstack/core/lstack_stack_stat.c
@@ -190,6 +190,11 @@ int32_t handle_stack_cmd(int32_t fd, enum GAZELLE_STAT_MODE stat_mode)
struct protocol_stack *stack = stack_group->stacks[i];
get_stack_dfx_data(&dfx, stack, stat_mode);
+ if (!use_ltran() &&
+ (stat_mode == GAZELLE_STAT_LTRAN_START_LATENCY || stat_mode == GAZELLE_STAT_LTRAN_STOP_LATENCY)) {
+ continue;
+ }
+
dfx.tid = stack->tid;
if (i == stack_group->stack_num - 1) {
dfx.eof = 1;
diff --git a/src/ltran/ltran_dfx.c b/src/ltran/ltran_dfx.c
index a575c33..3baa017 100644
--- a/src/ltran/ltran_dfx.c
+++ b/src/ltran/ltran_dfx.c
@@ -1231,8 +1231,6 @@ int32_t main(int32_t argc, char *argv[])
if (!g_use_ltran) {
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, req_msg_num);
if (ret < 0) {
return -1;
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/misaka00251/gazelle.git
git@gitee.com:misaka00251/gazelle.git
misaka00251
gazelle
gazelle
master

搜索帮助