Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2760901imm; Thu, 24 May 2018 15:41:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoKNsdYttq1i0tPLk4n8L5u1gbk95Odn2058mcIYQfEHDWEyZT/Myz+Q1Bn7P+SqCW4vG8m X-Received: by 2002:a63:794d:: with SMTP id u74-v6mr7375626pgc.328.1527201688282; Thu, 24 May 2018 15:41:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527201688; cv=none; d=google.com; s=arc-20160816; b=ALq1Xo8sW8C+pxfQe1BYuPPYFN6pdzBG/KNX7UQVpmlkUaSiDdpOOmw2m8uIdxyXAL 8aAAc52v2FiBmAsWvxU4lSKPi2txGeif6chbFScKuI0DHmO0m0aRS6MI/bygIiDuSYlX 4rF1mIt9+oLiZJd3C0+ugSa9BzEMnHQvC/i9RQG8Mxf0MFoKlFlpQRZaKKJ3O2Cup1hv ddSd4zm2xldpVVVB8UCnpLsMVOo0rwabpzCkLjZYBouwJey+tAVxTTiKZSKHPELE8Kti JPmE/1GFxm6r/LnsIUX3FhOii77hUds4we9pacRoHpuuJU8lyJsn28tNjem2BlJHREo/ rnsg== 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=Y8RXdCTYqI4G18N2bKqBNJCMaWED+YBzENDwsggjxx4=; b=piTWfexGz7C7a/QsY3+f1xOLafBc+WbQyoIeH1/hhg5IADy8jfJjggBMUQMw6++FFn gRK+XpFd5s4TxKduqanZMt6N63wrR9SC2E/+5CcyIdX0BfNo6hCBkZDgS1d8B/6W25n6 //6eP3tts/NLZJlDAZ6zjFs0JGlWUhXicn0pAR/S+sGxSBrMyy6dOIrPNYK1mNpb2Twi J4ve1+lNJOWSBMisA0xcEHutDbq6PwpsJ8gkcfWWkZGShfgL3ReMZvR+K+ravq2+osI/ pQZkEuFK3aAvdvQeyqIE7e5/JNzeCWqeR4KplDDqRPZYwzclXFhVw0L3cb3rGZkEPGuf QUeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BpGQtBe0; 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 c17-v6si5859821pgp.408.2018.05.24.15.41.13; Thu, 24 May 2018 15:41:28 -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=BpGQtBe0; 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 S966740AbeEXMsk (ORCPT + 99 others); Thu, 24 May 2018 08:48:40 -0400 Received: from mail-pf0-f176.google.com ([209.85.192.176]:39094 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965191AbeEXMsh (ORCPT ); Thu, 24 May 2018 08:48:37 -0400 Received: by mail-pf0-f176.google.com with SMTP id a22-v6so838782pfn.6; Thu, 24 May 2018 05:48:36 -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=Y8RXdCTYqI4G18N2bKqBNJCMaWED+YBzENDwsggjxx4=; b=BpGQtBe0wI1m83rUqFZmWzcEIPi1JnOOIUwGqWDBEGMB202evgHoFyWIHziyT9pfzs hZwScadxbjoK/TkxToHLcCbanvlVT2Ic1i2Za0EK1hU2kPqvyiNn246ivfAIhgHNr4qb mjqGTh1lkuY8co3qpK2ZSh9oMhO4Sk6eSSdBpgsMDTjqqBOKZRDiFHwrMIJllI4Ovaum P+P3inPTjjvBawNuSPTMlDO1FdUdm5JAP5cMshD6XmvqqzjU1A0y/+J4k/fiWks73/5M g9DLV+vBVXq+1KVs3PNF8NR76mYJP34X780v7F7WX0Up3VLTflLE91bU9ZTFmc4aTkNc ZApA== 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=Y8RXdCTYqI4G18N2bKqBNJCMaWED+YBzENDwsggjxx4=; b=J0Kx0YYkGeVsvP0RAUzRv3RGTh+tGQ1ZnZ7knpVKTvzYKewdgMQk7QWzsC/blGgiPa FlM/fQ/qHzz1hyczgsPawe/mr/1EVVe6KyO5MTGW6sZSVAZIfgVHsCjScUs74g0t3ARh 3XUAr0H39OsspOYYOhficsSy03PwrlosDV/aoZGqmo8EUeu/AqTlueGGkYovODwmdbAs LYE3HeumWRsdcRd19FjVwF6M45mIpVmJBVyz5agWjK/guFFqZoUaANUrdR899wo97T7v GRF/woxkyUy62oDX+5K0VSPXEoIVd9JiMwBklYKAii7C+ovm6VPhU6tOvbhv0gLATYXF W0zQ== X-Gm-Message-State: ALKqPweLJtvAVTmSltvODMvxk3E3g0NC2rz9N+OMf/LMI2pQeBbla0ts Q2J165Sw85vkf/PjAJiQ7fQ= X-Received: by 2002:a62:3f81:: with SMTP id z1-v6mr7174540pfj.216.1527166116608; Thu, 24 May 2018 05:48:36 -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 j186-v6sm10378207pgc.10.2018.05.24.05.48.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 May 2018 05:48:35 -0700 (PDT) From: Yafang Shao To: davem@davemloft.net, songliubraving@fb.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yafang Shao Subject: [PATCH net-next] tcp: use data length instead of skb->len in tcp_probe Date: Thu, 24 May 2018 20:48:17 +0800 Message-Id: <1527166097-10908-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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/trace/events/tcp.h b/include/trace/events/tcp.h index c1a5284..259b991 100644 --- a/include/trace/events/tcp.h +++ b/include/trace/events/tcp.h @@ -261,7 +261,7 @@ __entry->dport = ntohs(inet->inet_dport); __entry->mark = skb->mark; - __entry->length = skb->len; + __entry->length = skb->len - tcp_hdrlen(skb); __entry->snd_nxt = tp->snd_nxt; __entry->snd_una = tp->snd_una; __entry->snd_cwnd = tp->snd_cwnd; @@ -272,7 +272,7 @@ __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->snd_cwnd, __entry->ssthresh, __entry->snd_wnd, -- 1.8.3.1