代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gazelle 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 36d2ddc58cd0f467d6d7682689cc10947a8a1973 Mon Sep 17 00:00:00 2001
From: yangchen <yangchen145@huawei.com>
Date: Tue, 6 Feb 2024 11:29:26 +0800
Subject: [PATCH] add observable method of data aggregation
---
src/common/gazelle_dfx_msg.h | 2 ++
src/lstack/core/lstack_lwip.c | 2 ++
src/ltran/ltran_dfx.c | 4 +++-
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/common/gazelle_dfx_msg.h b/src/common/gazelle_dfx_msg.h
index d465efa..1ca210b 100644
--- a/src/common/gazelle_dfx_msg.h
+++ b/src/common/gazelle_dfx_msg.h
@@ -73,6 +73,8 @@ struct gazelle_stack_stat {
uint64_t tx;
uint64_t tx_prepare_fail;
uint64_t accept_fail;
+ uint64_t sock_rx_drop;
+ uint64_t sock_tx_merge;
};
struct gazelle_wakeup_stat {
diff --git a/src/lstack/core/lstack_lwip.c b/src/lstack/core/lstack_lwip.c
index 63044c2..4523907 100644
--- a/src/lstack/core/lstack_lwip.c
+++ b/src/lstack/core/lstack_lwip.c
@@ -541,6 +541,7 @@ static ssize_t do_lwip_fill_sendring(struct lwip_sock *sock, const void *buf, si
/* merge data into last pbuf */
if (!NETCONN_IS_UDP(sock) && sock->remain_len) {
+ sock->stack->stats.sock_tx_merge++;
send_len = merge_data_lastpbuf(sock, (char *)buf, len);
if (send_len >= len) {
send_len = len;
@@ -1039,6 +1040,7 @@ ssize_t do_lwip_read_from_stack(int32_t fd, void *buf, size_t len, int32_t flags
/* in udp, if pbuf remaining len less than copy_len, discard these packets */
if (recvd > 0 && NETCONN_IS_UDP(sock)) {
+ sock->stack->stats.sock_rx_drop++;
break;
}
}
diff --git a/src/ltran/ltran_dfx.c b/src/ltran/ltran_dfx.c
index 4b246a1..9f12096 100644
--- a/src/ltran/ltran_dfx.c
+++ b/src/ltran/ltran_dfx.c
@@ -648,7 +648,9 @@ static void show_lstack_stats(struct gazelle_stack_dfx_data *lstack_stat)
printf("send_pkts_fail: %-13"PRIu64" ", lstack_stat->data.pkts.stack_stat.send_pkts_fail);
printf("mbuf_pool_freecnt: %-10"PRIu32" ", lstack_stat->data.pkts.mbufpool_avail_cnt);
printf("rpc_pool_freecnt: %-12"PRIu32" \n", lstack_stat->data.pkts.rpcpool_avail_cnt);
- printf("accpet_fail: %-12"PRIu64" \n", lstack_stat->data.pkts.stack_stat.accept_fail);
+ printf("accpet_fail: %-16"PRIu64" ", lstack_stat->data.pkts.stack_stat.accept_fail);
+ printf("sock_rx_drop: %-15"PRIu64" ", lstack_stat->data.pkts.stack_stat.sock_rx_drop);
+ printf("sock_tx_merge: %-16"PRIu64" \n", lstack_stat->data.pkts.stack_stat.sock_tx_merge);
}
static void gazelle_print_lstack_stat_detail(struct gazelle_stack_dfx_data *lstack_stat,
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。