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


Groups > linux.kernel > #1490232

[PATCH net-next 13/15] rxrpc: Add a tracepoint to log injected Rx packet loss

From David Howells <dhowells@redhat.com>
Newsgroups linux.kernel
Subject [PATCH net-next 13/15] rxrpc: Add a tracepoint to log injected Rx packet loss
Date 2016-09-23 17:20 +0200
Message-ID <skAqB-5wp-13@gated-at.bofh.it> (permalink)
References <skAqB-5wp-5@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 received packets that get discarded due to Rx
packet loss.

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

 include/trace/events/rxrpc.h |   21 +++++++++++++++++++++
 net/rxrpc/input.c            |   11 +++++------
 2 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/include/trace/events/rxrpc.h b/include/trace/events/rxrpc.h
index 6001bf93dc79..9413b17ba04b 100644
--- a/include/trace/events/rxrpc.h
+++ b/include/trace/events/rxrpc.h
@@ -484,6 +484,27 @@ TRACE_EVENT(rxrpc_timer,
 		      __entry->timer - __entry->now)
 	    );
 
+TRACE_EVENT(rxrpc_rx_lose,
+	    TP_PROTO(struct rxrpc_skb_priv *sp),
+
+	    TP_ARGS(sp),
+
+	    TP_STRUCT__entry(
+		    __field_struct(struct rxrpc_host_header,	hdr		)
+			     ),
+
+	    TP_fast_assign(
+		    memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
+			   ),
+
+	    TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s *LOSE*",
+		      __entry->hdr.epoch, __entry->hdr.cid,
+		      __entry->hdr.callNumber, __entry->hdr.serviceId,
+		      __entry->hdr.serial, __entry->hdr.seq,
+		      __entry->hdr.type, __entry->hdr.flags,
+		      __entry->hdr.type <= 15 ? rxrpc_pkts[__entry->hdr.type] : "?UNK")
+	    );
+
 #endif /* _TRACE_RXRPC_H */
 
 /* This part must be outside protection */
diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
index fb3e2f6afa3b..19b1e189f5dc 100644
--- a/net/rxrpc/input.c
+++ b/net/rxrpc/input.c
@@ -837,20 +837,19 @@ void rxrpc_data_ready(struct sock *udp_sk)
 	skb_orphan(skb);
 	sp = rxrpc_skb(skb);
 
+	/* dig out the RxRPC connection details */
+	if (rxrpc_extract_header(sp, skb) < 0)
+		goto bad_message;
+
 	if (IS_ENABLED(CONFIG_AF_RXRPC_INJECT_LOSS)) {
 		static int lose;
 		if ((lose++ & 7) == 7) {
+			trace_rxrpc_rx_lose(sp);
 			rxrpc_lose_skb(skb, rxrpc_skb_rx_lost);
 			return;
 		}
 	}
 
-	_net("Rx UDP packet from %08x:%04hu",
-	     ntohl(ip_hdr(skb)->saddr), ntohs(udp_hdr(skb)->source));
-
-	/* dig out the RxRPC connection details */
-	if (rxrpc_extract_header(sp, skb) < 0)
-		goto bad_message;
 	trace_rxrpc_rx_packet(sp);
 
 	_net("Rx RxRPC %s ep=%x call=%x:%x",

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


Thread

[PATCH net-next 00/15] rxrpc: Bug fixes and tracepoints David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
  [PATCH net-next 13/15] rxrpc: Add a tracepoint to log injected Rx  packet loss David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
  [PATCH net-next 11/15] rxrpc: Add a tracepoint for the call timer David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
  [PATCH net-next 05/15] rxrpc: Use before_eq() and friends to  compare serial numbers David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
  [PATCH net-next 10/15] rxrpc: Don't call the tx_ack tracepoint if  don't generate an ACK David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
  [PATCH net-next 08/15] rxrpc: Fix call timer David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
    Re: [PATCH net-next 08/15] rxrpc: Fix call timer Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-09-23 20:10 +0200
      Re: [PATCH net-next 08/15] rxrpc: Fix call timer David Howells <dhowells@redhat.com> - 2016-09-23 20:30 +0200
  [PATCH net-next 09/15] rxrpc: Pass the last Tx packet marker in the  annotation buffer David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
  [PATCH net-next 04/15] rxrpc: Should be using ktime_add_ms() not  ktime_add_ns() David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
  [PATCH net-next 03/15] rxrpc: Make sure sendmsg() is woken on call  completion David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
  [PATCH net-next 14/15] rxrpc: Add tracepoint for ACK proposal David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
  [PATCH net-next 15/15] rxrpc: Add a tracepoint to log which packets  will be retransmitted David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
  [PATCH net-next 01/15] rxrpc: Preset timestamp on Tx sk_buffs David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
  [PATCH net-next 07/15] rxrpc: Fix accidental cancellation of  scheduled resend by ACK parser David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
    Re: [PATCH net-next 07/15] rxrpc: Fix accidental cancellation of  scheduled resend by ACK parser Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-09-23 20:10 +0200
      Re: [PATCH net-next 07/15] rxrpc: Fix accidental cancellation of scheduled resend by ACK parser David Howells <dhowells@redhat.com> - 2016-09-23 20:30 +0200
  [PATCH net-next 06/15] rxrpc: Need to start the resend timer on  initial transmission David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
  Re: [PATCH net-next 00/15] rxrpc: Bug fixes and tracepoints David Miller <davem@davemloft.net> - 2016-09-24 14:30 +0200

csiph-web