代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gazelle 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 62297e7fb9299a75bc582b1abb4343e88e5c7c05 Mon Sep 17 00:00:00 2001
From: ningjin <ningjin@kylinos.cn>
Date: Thu, 28 Mar 2024 16:05:01 +0800
Subject: [PATCH] gazellectl add lwip stats_proto print
---
src/common/gazelle_dfx_msg.h | 4 ++++
src/ltran/ltran_dfx.c | 12 +++++++-----
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/common/gazelle_dfx_msg.h b/src/common/gazelle_dfx_msg.h
index 5d626a2..17e1662 100644
--- a/src/common/gazelle_dfx_msg.h
+++ b/src/common/gazelle_dfx_msg.h
@@ -206,6 +206,10 @@ struct gazelle_stat_lstack_proto {
/* data */
uint16_t xmit; /* Transmitted packets. */
uint16_t recv; /* Received packets. */
+ uint16_t tx_in; /* Transmitted in packets. */
+ uint16_t tx_out; /* Transmitted out packets. */
+ uint16_t rx_in; /* Received in packets. */
+ uint16_t rx_out; /* Received out packets. */
uint16_t fw; /* Forwarded packets. */
uint16_t drop; /* Dropped packets. */
uint16_t chkerr; /* Checksum error. */
diff --git a/src/ltran/ltran_dfx.c b/src/ltran/ltran_dfx.c
index c81cce2..f4e55e3 100644
--- a/src/ltran/ltran_dfx.c
+++ b/src/ltran/ltran_dfx.c
@@ -1114,8 +1114,10 @@ static void gazelle_print_lstack_stat_proto_core(const struct gazelle_stack_dfx_
const struct gazelle_stat_lstack_proto *proto)
{
printf("\n------ stack tid: %6u ------\n", stat->tid);
- printf("xmit: %u\n", proto->xmit);
- printf("recv: %u\n", proto->recv);
+ printf("tx_in: %u\n", proto->tx_in);
+ printf("tx_out: %u\n", proto->tx_out);
+ printf("rx_in: %u\n", proto->rx_in);
+ printf("rx_out: %u\n", proto->rx_out);
printf("fw: %u\n", proto->fw);
printf("drop: %u\n", proto->drop);
printf("chkerr: %u\n", proto->chkerr);
@@ -1297,11 +1299,11 @@ static void show_usage(void)
" -x, xstats show lstack xstats \n"
" -k, nic-features show state of protocol offload and other features \n"
" -a, aggregatin [time] show lstack send/recv aggregation \n"
+ " -p, protocol {UDP | TCP | ICMP | IP | ETHARP} show lstack protocol statistics \n"
" set: \n"
" loglevel {error | info | debug} set lstack loglevel \n"
" lowpower {0 | 1} set lowpower enable \n"
" [time] measure latency time default 1S, maximum 30mins \n\n"
- " -p, protocol {UDP | TCP | ICMP | IP | ETHARP | IP_FRAG} show lstack protocol statistics \n"
#ifdef GAZELLE_FAULT_INJECT_ENABLE
" *inject params*\n"
" |inject_type | digit_param_1 | digit_param_2 | inject_rule |\n"
@@ -1512,8 +1514,8 @@ static int32_t parse_dfx_lstack_show_proto_args(int32_t argc, char *argv[], stru
int32_t ret;
char *param = argv[GAZELLE_OPTIONS2_ARG_IDX];
- if (strcmp(param, "UDP") != 0 && strcmp(param, "TCP") != 0 && strcmp(param, "IP") &&
- strcmp(param, "ICMP") && strcmp(param, "ETHARP") != 0) {
+ if ((param == NULL) || (strcmp(param, "UDP") != 0 && strcmp(param, "TCP") != 0 && strcmp(param, "IP") &&
+ strcmp(param, "ICMP") && strcmp(param, "ETHARP") != 0)) {
return cmd_index;
}
ret = strncpy_s(req_msg[cmd_index].data.protocol, MAX_PROTOCOL_LENGTH, argv[GAZELLE_OPTIONS2_ARG_IDX],
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。