[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1418608606-1569264-4-git-send-email-kafai@fb.com>
Date: Sun, 14 Dec 2014 17:56:44 -0800
From: Martin KaFai Lau <kafai@...com>
To: <netdev@...r.kernel.org>
CC: "David S. Miller" <davem@...emloft.net>,
Hannes Frederic Sowa <hannes@...essinduktion.org>,
Steven Rostedt <rostedt@...dmis.org>,
Lawrence Brakmo <brakmo@...com>, Josef Bacik <jbacik@...com>,
Kernel Team <Kernel-team@...com>
Subject: [RFC PATCH net-next 3/5] tcp: Add a few more tracepoints for tcp tracer
The tcp tracer, which will be added in the later patch, depends
on them to collect statistics.
Signed-off-by: Martin KaFai Lau <kafai@...com>
---
include/trace/events/tcp.h | 15 +++++++++++++++
net/ipv4/tcp_input.c | 6 ++++++
2 files changed, 21 insertions(+)
diff --git a/include/trace/events/tcp.h b/include/trace/events/tcp.h
index 81b40ef..440a26b 100644
--- a/include/trace/events/tcp.h
+++ b/include/trace/events/tcp.h
@@ -167,6 +167,21 @@ TRACE_EVENT(tcp_rcv_established,
__entry->rcv_nxt, __entry->rcv_wnd)
);
+DECLARE_TRACE(tcp_ooo_rcv,
+ TP_PROTO(struct sock *sk),
+ TP_ARGS(sk)
+);
+
+DECLARE_TRACE(tcp_sacks_rcv,
+ TP_PROTO(struct sock *sk, int num_sacks),
+ TP_ARGS(sk, num_sacks)
+);
+
+DECLARE_TRACE(tcp_rtt_sample,
+ TP_PROTO(struct sock *sk, long rtt_sample_us),
+ TP_ARGS(sk, rtt_sample_us)
+);
+
#undef TCP_TRACE_ASSIGN_SA
#endif /* _TRACE_TCP_H */
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 808fad7..1f82987 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1650,6 +1650,8 @@ tcp_sacktag_write_queue(struct sock *sk, const struct sk_buff *ack_skb,
int i, j;
int first_sack_index;
+ trace_tcp_sacks_rcv(sk, num_sacks);
+
state.flag = 0;
state.reord = tp->packets_out;
state.rtt_us = -1L;
@@ -2932,6 +2934,9 @@ static inline bool tcp_ack_update_rtt(struct sock *sk, const int flag,
/* RFC6298: only reset backoff on valid RTT measurement. */
inet_csk(sk)->icsk_backoff = 0;
+
+ trace_tcp_rtt_sample(sk, seq_rtt_us);
+
return true;
}
@@ -4232,6 +4237,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPOFOQUEUE);
SOCK_DEBUG(sk, "out of order segment: rcv_next %X seq %X - %X\n",
tp->rcv_nxt, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq);
+ trace_tcp_ooo_rcv(sk);
skb1 = skb_peek_tail(&tp->out_of_order_queue);
if (!skb1) {
--
1.8.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists