Received: by 10.192.165.148 with SMTP id m20csp3459563imm; Mon, 23 Apr 2018 07:00:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+Nyfl4TZDqV/AJgm3UzkUCaIsl3IYkC3hNGdNT7NwF22hG3CDcqlEFMw30pQ39u1iux67e X-Received: by 2002:a17:902:7510:: with SMTP id i16-v6mr12952601pll.291.1524492033686; Mon, 23 Apr 2018 07:00:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524492033; cv=none; d=google.com; s=arc-20160816; b=FEhbhnq8lsvfc5Gu+sNxM3eLlYgvEKAO8toOWs93c88zTorHXhmjtSGwwjIHf9bJRA 6nlvgYhui9ZUooPWx586XrcI+ejNWdLB6ccNyUrQUVrf4sVolV7D427iJFFZP/TXjO1P pvsBJLbTmSPNICOPi8xSyYMS0qYZ2uINfS+HkmhT4oM3odG+3BLsdX1vdC9cBbrmpcOD A27Wz/1+fG1NQCkG/FLDrCMsGGILq/+1EuYaLmDMFn+OeavpXR8lfsPXpKLwkf/akOQe KwdwbzAHIVibblwLPrGsVBC2Asuj22Ef35C9LTSw9359dbJsQDETvVZwE8qaEPthqF3w T5Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date :arc-authentication-results; bh=BUDWaB1ZHBDqprcH2EchOLcIyfjCrUwFKvVNKls30IQ=; b=UtZglmz5+suGdt1k+cvBGSHPCSbAf63qTNdIYOTbB8o2C5GjCPDOOqG/izOCzSiW81 7NujVXixAmSfQo37LR+68pN+oeyOd5ASqmNvWwrLJcJwM6QDEJD1tqfVPDKDQZQ0+c+E bLaM3EVYQIf1KWZtx470TweFbHQQ+HANE99AKUFGKSv6kWclYM5BLHQc2HVNwfJw2SWo IZXvQHNH4F8ZRFAXCpEQjrRaqlH1fq30jF5DDd4VldJb/KipGpd06O15eFaZ6Un/EbeZ EEvNcbsmYm1DOYR0HB1Eq1S2S7NmnODKJpl02b0bfhw2QPWbR0cTOTqsv7eT5G6u8Sfh db0A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i11si9549214pgt.19.2018.04.23.07.00.18; Mon, 23 Apr 2018 07:00:33 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755526AbeDWN6s (ORCPT + 99 others); Mon, 23 Apr 2018 09:58:48 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:48764 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755281AbeDWN6q (ORCPT ); Mon, 23 Apr 2018 09:58:46 -0400 Received: from localhost (67.110.78.66.ptr.us.xo.net [67.110.78.66]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 4332913DB8E4B; Mon, 23 Apr 2018 06:58:45 -0700 (PDT) Date: Mon, 23 Apr 2018 09:58:44 -0400 (EDT) Message-Id: <20180423.095844.822486182037441168.davem@davemloft.net> To: laoar.shao@gmail.com Cc: eric.dumazet@gmail.com, alexei.starovoitov@gmail.com, songliubraving@fb.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 net-next] net: introduce a new tracepoint for tcp_rcv_space_adjust From: David Miller In-Reply-To: <1524237506-11011-1-git-send-email-laoar.shao@gmail.com> References: <1524237506-11011-1-git-send-email-laoar.shao@gmail.com> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 23 Apr 2018 06:58:45 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yafang Shao Date: Fri, 20 Apr 2018 23:18:26 +0800 > tcp_rcv_space_adjust is called every time data is copied to user space, > introducing a tcp tracepoint for which could show us when the packet is > copied to user. > > When a tcp packet arrives, tcp_rcv_established() will be called and with > the existed tracepoint tcp_probe we could get the time when this packet > arrives. > Then this packet will be copied to user, and tcp_rcv_space_adjust will > be called and with this new introduced tracepoint we could get the time > when this packet is copied to user. > With these two tracepoints, we could figure out whether the user program > processes this packet immediately or there's latency. > > Hence in the printk message, sk_cookie is printed as a key to relate > tcp_rcv_space_adjust with tcp_probe. > > Maybe we could export sockfd in this new tracepoint as well, then we > could relate this new tracepoint with epoll/read/recv* tracepoints, and > finally that could show us the whole lifespan of this packet. But we > could also implement that with pid as these functions are executed in > process context. > > Signed-off-by: Yafang Shao > > --- > v2 -> v3: use sock_gen_cookie in tcp_event_sk as well. > Maybe we could init sk_cookie in the stack then in other code > path we just read it other than set it. If that is needed I > will do it in another new patch. > v1 -> v2: use sk_cookie as a key suggested by Eric. Applied, thank you.