]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ss: mptcp: print out last time counters
authorGeliang Tang <geliang@kernel.org>
Fri, 12 Apr 2024 08:19:52 +0000 (10:19 +0200)
committerDavid Ahern <dsahern@kernel.org>
Sat, 13 Apr 2024 16:43:04 +0000 (16:43 +0000)
Three new "last time" counters have been added to "struct mptcp_info":
last_data_sent, last_data_recv and last_ack_recv. They have been added
in commit 18d82cde7432 ("mptcp: add last time fields in mptcp_info") in
net-next recently.

This patch prints out these new counters into mptcp_stats output in ss.

Signed-off-by: Geliang Tang <geliang@kernel.org>
Acked-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: David Ahern <dsahern@kernel.org>
misc/ss.c

index 87008d7c97c8af9eae6eb7a71027f642068f8037..81b813c1b376c5e73a0dbb09fff5aa300a1e7b90 100644 (file)
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -3279,6 +3279,12 @@ static void mptcp_stats_print(struct mptcp_info *s)
                out(" bytes_acked:%llu", s->mptcpi_bytes_acked);
        if (s->mptcpi_subflows_total)
                out(" subflows_total:%u", s->mptcpi_subflows_total);
+       if (s->mptcpi_last_data_sent)
+               out(" last_data_sent:%u", s->mptcpi_last_data_sent);
+       if (s->mptcpi_last_data_recv)
+               out(" last_data_recv:%u", s->mptcpi_last_data_recv);
+       if (s->mptcpi_last_ack_recv)
+               out(" last_ack_recv:%u", s->mptcpi_last_ack_recv);
 }
 
 static void mptcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,