Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1485648

[PATCH net-next 06/11] rxrpc: Add a tracepoint to log ACK transmission

From David Howells <dhowells@redhat.com>
Newsgroups linux.kernel
Subject [PATCH net-next 06/11] rxrpc: Add a tracepoint to log ACK transmission
Date 2016-09-18 01:30 +0200
Message-ID <sixdx-qm-43@gated-at.bofh.it> (permalink)
References <sixdw-qm-3@gated-at.bofh.it>
Organization Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903

Show all headers | View raw


Add a tracepoint to log information about ACK transmission.

Signed-off-by: David Howels <dhowells@redhat.com>
---

 include/trace/events/rxrpc.h |   30 ++++++++++++++++++++++++++++++
 net/rxrpc/conn_event.c       |    3 +++
 net/rxrpc/output.c           |    7 ++++++-
 3 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/include/trace/events/rxrpc.h b/include/trace/events/rxrpc.h
index 2b19f3fa5174..d545d692ae22 100644
--- a/include/trace/events/rxrpc.h
+++ b/include/trace/events/rxrpc.h
@@ -260,6 +260,36 @@ TRACE_EVENT(rxrpc_rx_ack,
 		      __entry->n_acks)
 	    );
 
+TRACE_EVENT(rxrpc_tx_ack,
+	    TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t first,
+		     rxrpc_serial_t serial, u8 reason, u8 n_acks),
+
+	    TP_ARGS(call, first, serial, reason, n_acks),
+
+	    TP_STRUCT__entry(
+		    __field(struct rxrpc_call *,	call		)
+		    __field(rxrpc_seq_t,		first		)
+		    __field(rxrpc_serial_t,		serial		)
+		    __field(u8,				reason		)
+		    __field(u8,				n_acks		)
+			     ),
+
+	    TP_fast_assign(
+		    __entry->call = call;
+		    __entry->first = first;
+		    __entry->serial = serial;
+		    __entry->reason = reason;
+		    __entry->n_acks = n_acks;
+			   ),
+
+	    TP_printk("c=%p %s f=%08x r=%08x n=%u",
+		      __entry->call,
+		      rxrpc_acks(__entry->reason),
+		      __entry->first,
+		      __entry->serial,
+		      __entry->n_acks)
+	    );
+
 #endif /* _TRACE_RXRPC_H */
 
 /* This part must be outside protection */
diff --git a/net/rxrpc/conn_event.c b/net/rxrpc/conn_event.c
index a43f4c94a88d..9b19c51831aa 100644
--- a/net/rxrpc/conn_event.c
+++ b/net/rxrpc/conn_event.c
@@ -98,6 +98,9 @@ static void rxrpc_conn_retransmit_call(struct rxrpc_connection *conn,
 		pkt.info.rwind		= htonl(rxrpc_rx_window_size);
 		pkt.info.jumbo_max	= htonl(rxrpc_rx_jumbo_max);
 		len += sizeof(pkt.ack) + sizeof(pkt.info);
+
+		trace_rxrpc_tx_ack(NULL, chan->last_seq, 0,
+				   RXRPC_ACK_DUPLICATE, 0);
 		break;
 	}
 
diff --git a/net/rxrpc/output.c b/net/rxrpc/output.c
index 0b21ed859de7..2c9daeadce87 100644
--- a/net/rxrpc/output.c
+++ b/net/rxrpc/output.c
@@ -38,12 +38,14 @@ struct rxrpc_pkt_buffer {
 static size_t rxrpc_fill_out_ack(struct rxrpc_call *call,
 				 struct rxrpc_pkt_buffer *pkt)
 {
+	rxrpc_serial_t serial;
 	rxrpc_seq_t hard_ack, top, seq;
 	int ix;
 	u32 mtu, jmax;
 	u8 *ackp = pkt->acks;
 
 	/* Barrier against rxrpc_input_data(). */
+	serial = call->ackr_serial;
 	hard_ack = READ_ONCE(call->rx_hard_ack);
 	top = smp_load_acquire(&call->rx_top);
 
@@ -51,7 +53,7 @@ static size_t rxrpc_fill_out_ack(struct rxrpc_call *call,
 	pkt->ack.maxSkew	= htons(call->ackr_skew);
 	pkt->ack.firstPacket	= htonl(hard_ack + 1);
 	pkt->ack.previousPacket	= htonl(call->ackr_prev_seq);
-	pkt->ack.serial		= htonl(call->ackr_serial);
+	pkt->ack.serial		= htonl(serial);
 	pkt->ack.reason		= call->ackr_reason;
 	pkt->ack.nAcks		= top - hard_ack;
 
@@ -75,6 +77,9 @@ static size_t rxrpc_fill_out_ack(struct rxrpc_call *call,
 	pkt->ackinfo.rwind	= htonl(call->rx_winsize);
 	pkt->ackinfo.jumbo_max	= htonl(jmax);
 
+	trace_rxrpc_tx_ack(call, hard_ack + 1, serial, call->ackr_reason,
+			   top - hard_ack);
+
 	*ackp++ = 0;
 	*ackp++ = 0;
 	*ackp++ = 0;

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next 00/11] rxrpc: Tracepoint addition and improvement David Howells <dhowells@redhat.com> - 2016-09-18 01:30 +0200
  [PATCH net-next 04/11] rxrpc: Add a tracepoint to follow the life  of a packet in the Tx buffer David Howells <dhowells@redhat.com> - 2016-09-18 01:30 +0200
  [PATCH net-next 08/11] rxrpc: Add a tracepoint to follow what  recvmsg does David Howells <dhowells@redhat.com> - 2016-09-18 01:30 +0200
  [PATCH net-next 05/11] rxrpc: Add a tracepoint to log received ACK  packets David Howells <dhowells@redhat.com> - 2016-09-18 01:30 +0200
  [PATCH net-next 01/11] rxrpc: Print the packet type name in the Rx  packet trace David Howells <dhowells@redhat.com> - 2016-09-18 01:30 +0200
  [PATCH net-next 11/11] rxrpc: Add config to inject packet loss David Howells <dhowells@redhat.com> - 2016-09-18 01:30 +0200
    Re: [PATCH net-next 11/11] rxrpc: Add config to inject packet loss Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-09-18 13:50 +0200
  [PATCH net-next 10/11] rxrpc: Improve skb tracing David Howells <dhowells@redhat.com> - 2016-09-18 01:30 +0200
  [PATCH net-next 06/11] rxrpc: Add a tracepoint to log ACK  transmission David Howells <dhowells@redhat.com> - 2016-09-18 01:30 +0200
  [PATCH net-next 03/11] rxrpc: Add connection tracepoint and client  conn state tracepoint David Howells <dhowells@redhat.com> - 2016-09-18 01:30 +0200
  Re: [PATCH net-next 00/11] rxrpc: Tracepoint addition and  improvement David Miller <davem@davemloft.net> - 2016-09-19 08:00 +0200

csiph-web