Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3294469imm; Fri, 25 May 2018 03:14:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoGJ6h7G7mmgfzm/DzliiZQAYvN7k+Ko7vUqH0GSTKaqrPo65joybDZ43fmEqhu0Tuity5Y X-Received: by 2002:a63:87c8:: with SMTP id i191-v6mr1525658pge.124.1527243295524; Fri, 25 May 2018 03:14:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527243295; cv=none; d=google.com; s=arc-20160816; b=DJYqVgRrQBwDWjbJij0searnoj2SySwcf6/cBAl3pWujjxc6n+kDhEfu1zyZogT5Ok yHdTXdyHhrC8/8f9LL1piiw4ergEts28TqUkoIYACTfIzLAPQRFj2w/N1yoICKyn3/7j HFchJfR5dUi7PnzPlMl+ojwWk6uvS00C16s85axN49+Qd0cwA3Ei9tFIhSQVEhLtcSQL uKLEHiLa5pMmXnbFFprbz5AZXyJjaDhYV5QMkrL38k1GLtsuhGFVNbu3RQKva/vez6No PQzWoRplwUsZsYf5xvG3DFL2cMQFAIGUXy27QYAaFgowGNYHU14+tlq1zdxgMYBxochI LQbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=GuuOuosRLHepReo3SWv7WH7Pxu8vujskrce2nzbIw+M=; b=N7IMouCL/WyIUCANT3ssq60Voal/qwWO/rdVR15wO7C1hw2tndJW+56ogm3Wbm4wIJ Qhz9kt6ydgHIbuytIKd6fJppDrreJnAyVKR9vsejUVMZEmOZEKkdatPDVA3zwGi9XYgY HOvl5u+1yEyAna00t5U4J9eGfql32tfmrVGB4vP/6WaapWmseSTC7+NMTm3nkPbiHvy9 /JrJ3mrE/fSJChGQBGOhWb15j229Guqt3o3aBFTgZGU4jLaxvv2rL3PBW/XOr+sqWXyL ecvQ8mzbtNSSvbQ6paDagtkZUgSDKseK815TBbxQN5p6nPmzhBF53/HvvKmXT6RryoX/ 7IMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B1vqWDhz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d7-v6si16264999pgn.455.2018.05.25.03.14.40; Fri, 25 May 2018 03:14:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B1vqWDhz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936093AbeEYKOS (ORCPT + 99 others); Fri, 25 May 2018 06:14:18 -0400 Received: from mail-pg0-f48.google.com ([74.125.83.48]:46696 "EHLO mail-pg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935638AbeEYKOQ (ORCPT ); Fri, 25 May 2018 06:14:16 -0400 Received: by mail-pg0-f48.google.com with SMTP id a3-v6so2106617pgt.13; Fri, 25 May 2018 03:14:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=GuuOuosRLHepReo3SWv7WH7Pxu8vujskrce2nzbIw+M=; b=B1vqWDhziwiHvy/l1BefMCaPZGZAOmukrTSUXh+dH1rFWa3oIbYJi+Iq9t2Rt5wCEE 9MQ9Z9NWbl0VllpP0uxSKXi2IjhPhYoRgmx6xNJo+kF8IQJR5j5GI7ZuVplwZoK61l9s IedL+0WoW+fm91076ml8XPqUxbVMbCwD10aLRxwxn8Il4U2syph4a1Aq3MTkM7mrUtjL AcvTIPP4V7En086mSYAmh4WSkIcKBkavZieloMV+iSYv+MzHHGg1fIIhgBGFCtj5psw/ NgvQ0QoH0EOLkQDO9Q43t3sVzz4bjYzUw224Qjx7o09bGREABBpIwlpcaxf+jEtW9L7k YIgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=GuuOuosRLHepReo3SWv7WH7Pxu8vujskrce2nzbIw+M=; b=HdVs0gqz5771jSv60ztbOaMq9Qwubol5Gtm4eixtxOlZROUnX1csAr3Fge5ZwxhKpC AUnkD2UN0y2qnJSD6jtimGVMhB0YIiIBvc15REuqiQeyUfHzMPu7Y78eXVOWA3yOUVcs nJN7gt570HforxWa1X5GntcLYuCsudKLvCEZyxb5rJ5gdZ2b2zmZtG88Dk5ZsX4pX9A6 gcUqwWHeu5V+PwzomZKXEwW6TP3vMhV1nTi+J9GdyfuUYQAvkqJR09XEl8WmbWgCP86I iVF7YKTcFvvolsCeE6DdTHKuW4mWErRF22KBgyS/aTWe/h2cjvEUSLIcp8K3ZTVAG+4J JBxg== X-Gm-Message-State: ALKqPwcEHLBfGGjDwu+75UfpyzDzvaBj1/iw2qtMaz3YDG1j9tXNE6r0 dSfLchTwYT8J2RiCucQKhwM= X-Received: by 2002:a65:424d:: with SMTP id d13-v6mr1484886pgq.234.1527243256189; Fri, 25 May 2018 03:14:16 -0700 (PDT) Received: from li1588-6.members.linode.com (li1588-6.members.linode.com. [139.162.104.6]) by smtp.gmail.com with ESMTPSA id s88-v6sm55465018pfe.43.2018.05.25.03.14.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 03:14:15 -0700 (PDT) From: Yafang Shao To: songliubraving@fb.com Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yafang Shao Subject: [PATCH v2 net-next] tcp: use data length instead of skb->len in tcp_probe Date: Fri, 25 May 2018 18:14:05 +0800 Message-Id: <1527243245-29582-1-git-send-email-laoar.shao@gmail.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org skb->len is meaningless to user. data length could be more helpful, with which we can easily filter out the packet without payload. Signed-off-by: Yafang Shao --- include/trace/events/tcp.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/trace/events/tcp.h b/include/trace/events/tcp.h index c1a5284..703abb6 100644 --- a/include/trace/events/tcp.h +++ b/include/trace/events/tcp.h @@ -236,7 +236,7 @@ __field(__u16, sport) __field(__u16, dport) __field(__u32, mark) - __field(__u16, length) + __field(__u16, data_len) __field(__u32, snd_nxt) __field(__u32, snd_una) __field(__u32, snd_cwnd) @@ -261,7 +261,7 @@ __entry->dport = ntohs(inet->inet_dport); __entry->mark = skb->mark; - __entry->length = skb->len; + __entry->data_len = skb->len - tcp_hdrlen(skb); __entry->snd_nxt = tp->snd_nxt; __entry->snd_una = tp->snd_una; __entry->snd_cwnd = tp->snd_cwnd; @@ -272,9 +272,9 @@ __entry->sock_cookie = sock_gen_cookie(sk); ), - TP_printk("src=%pISpc dest=%pISpc mark=%#x length=%d snd_nxt=%#x snd_una=%#x snd_cwnd=%u ssthresh=%u snd_wnd=%u srtt=%u rcv_wnd=%u sock_cookie=%llx", + TP_printk("src=%pISpc dest=%pISpc mark=%#x data_len=%d snd_nxt=%#x snd_una=%#x snd_cwnd=%u ssthresh=%u snd_wnd=%u srtt=%u rcv_wnd=%u sock_cookie=%llx", __entry->saddr, __entry->daddr, __entry->mark, - __entry->length, __entry->snd_nxt, __entry->snd_una, + __entry->data_len, __entry->snd_nxt, __entry->snd_una, __entry->snd_cwnd, __entry->ssthresh, __entry->snd_wnd, __entry->srtt, __entry->rcv_wnd, __entry->sock_cookie) ); -- 1.8.3.1