代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gazelle 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。