tcptop: Filter out negative values in receive probe
When tcp_cleanup_rbuf() is called from tcp_recvmsg(), "copied" may be an
error code, especially -EAGAIN for non-blocking receives.
diff --git a/tools/tcptop.py b/tools/tcptop.py
index 0f9ead6..9ca10f6 100755
--- a/tools/tcptop.py
+++ b/tools/tcptop.py
@@ -148,6 +148,9 @@
u16 dport = 0, family = sk->__sk_common.skc_family;
u64 *val, zero = 0;
+ if (copied <= 0)
+ return 0;
+
if (family == AF_INET) {
struct ipv4_key_t ipv4_key = {.pid = pid};
ipv4_key.saddr = sk->__sk_common.skc_rcv_saddr;