From patchwork Tue Dec 8 19:39:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 57899 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp244163lbb; Tue, 8 Dec 2015 12:01:32 -0800 (PST) X-Received: by 10.98.2.197 with SMTP id 188mr7434168pfc.135.1449604892868; Tue, 08 Dec 2015 12:01:32 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n18si7121094pfb.35.2015.12.08.12.01.32; Tue, 08 Dec 2015 12:01:32 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752606AbbLHT76 (ORCPT + 28 others); Tue, 8 Dec 2015 14:59:58 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:33321 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752561AbbLHT7z (ORCPT ); Tue, 8 Dec 2015 14:59:55 -0500 Received: by pabur14 with SMTP id ur14so16975715pab.0 for ; Tue, 08 Dec 2015 11:59:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ybOZij99pzV0+cQTYLNqT6o26OIAGBt9+aAs3YB8998=; b=p6dBahkBkiZsS+EnWEG0WhehP+BzAasZfttUPutUrsivXI0F3VudDLm46TuQ1GjUjm vvYkA6WsuOmQiTCoj/UAviTCGLXT8ZIMH2M3lv4ah27dybPszeSogtzX1EnNjcZR9pjV KMiTGCzqPuXU2gOuOwfvx7mo3wYWmtSlO25LHDXz+zk4o5qFnilGUzC9AtqIl4m7Cmg+ 8VWQ0NlcmpvXC8q4xc2dL5zByNiw70PsZUetE2igGHV34PHiMSgu3gMdGQR6vIkgxYUt qRaS0Hph53Dc25IpAdoRKsVQn0J5o42T5hQTFe349WQD4qywcRuFCvmoyiDgOTb90qiv 3bZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ybOZij99pzV0+cQTYLNqT6o26OIAGBt9+aAs3YB8998=; b=TzxE/YjDjblBCQ5KHauboS9einHNC5NzzPBgNnoLf9McSyHlBr4cEi4/U32go7t2Di S4UJazVchoYNxKtxQWVKKXLoEoLW0BQ+Dsh0eGI48o2SZRXlQdKZnwEg17KcXCwqe2vM nh31k5AGBlWYZfZcTRVKmIBr+VAuvIT43biFMQsVB0/NPJGQcbJcmlsQZdrBcf09s/md WJ+LXZgY8x2yazh5HY8KCjZJOIyFnSn3UnrNcHBLt6RcMZr2sOuTIAj0HeYaBOcCJJ1V 4WolWSpmmLB41i3UspRHLiv+mUE6q5aZbGWAivL+MGIUyc378avAFZeuOCzVVEK0QZiX B15A== X-Gm-Message-State: ALoCoQn1CNjEiY4AOrAgZj1etSPUOsIDZ3CC/PoA2dEqno2/04iEeTZjijp/4lEJ0vS0rgMgPD2Oh51iwykGLgu56V8Aa0EW3w== X-Received: by 10.66.227.1 with SMTP id rw1mr2518007pac.35.1449604795450; Tue, 08 Dec 2015 11:59:55 -0800 (PST) Received: from yshi-Precision-T5600.corp.ad.wrs.com (unknown-216-82.windriver.com. [147.11.216.82]) by smtp.gmail.com with ESMTPSA id 25sm6479658pfp.62.2015.12.08.11.59.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2015 11:59:54 -0800 (PST) From: Yang Shi To: akpm@linux-foundation.org, rostedt@goodmis.org, mingo@redhat.com Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linaro-kernel@lists.linaro.org, yang.shi@linaro.org Subject: [PATCH v3 2/7] mm/gup: add gup trace points Date: Tue, 8 Dec 2015 11:39:50 -0800 Message-Id: <1449603595-718-3-git-send-email-yang.shi@linaro.org> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1449603595-718-1-git-send-email-yang.shi@linaro.org> References: <1449603595-718-1-git-send-email-yang.shi@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For slow version, just add trace point for raw __get_user_pages since all slow variants call it to do the real work finally. Signed-off-by: Yang Shi --- mm/gup.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.0.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/mm/gup.c b/mm/gup.c index deafa2c..44f05c9 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -18,6 +18,9 @@ #include "internal.h" +#define CREATE_TRACE_POINTS +#include + static struct page *no_page_table(struct vm_area_struct *vma, unsigned int flags) { @@ -462,6 +465,8 @@ long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, if (!nr_pages) return 0; + trace_gup_get_user_pages(start, nr_pages); + VM_BUG_ON(!!pages != !!(gup_flags & FOLL_GET)); /* @@ -599,6 +604,7 @@ int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm, if (!(vm_flags & vma->vm_flags)) return -EFAULT; + trace_gup_fixup_user_fault(address); ret = handle_mm_fault(mm, vma, address, fault_flags); if (ret & VM_FAULT_ERROR) { if (ret & VM_FAULT_OOM) @@ -1340,6 +1346,8 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write, start, len))) return 0; + trace_gup_get_user_pages_fast(start, (unsigned long) nr_pages); + /* * Disable interrupts. We use the nested form as we can already have * interrupts disabled by get_futex_key.