From patchwork Wed Dec 9 17:29:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 58170 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp823948lbb; Wed, 9 Dec 2015 09:49:32 -0800 (PST) X-Received: by 10.98.18.22 with SMTP id a22mr57627pfj.54.1449683372428; Wed, 09 Dec 2015 09:49:32 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h10si13981123pat.126.2015.12.09.09.49.31; Wed, 09 Dec 2015 09:49: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 S1753189AbbLIRt2 (ORCPT + 28 others); Wed, 9 Dec 2015 12:49:28 -0500 Received: from mail-pf0-f175.google.com ([209.85.192.175]:34108 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752937AbbLIRtU (ORCPT ); Wed, 9 Dec 2015 12:49:20 -0500 Received: by pfbg73 with SMTP id g73so34124411pfb.1 for ; Wed, 09 Dec 2015 09:49:20 -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=b8Wv+STEmnKY0AHgjVvlAoZ1UkyTR0fF5I+3a8Oq29s=; b=iJNn+K5rLJTdA2M7YcHsKNoE5y1QMFs8Z10TqvmhATIZ+mCLZjizPynwLSc+s6RkAq bN/KHD/Q7D5OgzOZrHl7bMLE1RM/PLxzw/m02/tXSvfNauBSlpHsXFaX7OPmk0EuN34N 1XNbJxXoN8N6ABT7QvBO/P4RjjDQBiMZf9rBKac5xM2bwQfAyh64sWo+z/bmSvn231aj fCk7yuJgrLcS+3cnbylG9pAeU2Ve19kAvz9QadbBrN4UrE57EMbbYB+BOliVyhgtUAy3 JEaIkowbvxNgfBSdEVnrC7E6wx5EutkMvQWs39AGdiLbbOjYIfDHiDqm6l2/D9BTn08X dhZA== 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=b8Wv+STEmnKY0AHgjVvlAoZ1UkyTR0fF5I+3a8Oq29s=; b=A8pCEzYgdGm2a9CMa3jLemZiESHeXyNGfw1JQ3AvV13ZVRe5tO8iTQbkNTmwjiJZrR uuVa3gVKMShWdpMFudEdelNX+MgcIVLjrXWVhLQ/NZCJmakQDgXW7PjDach0rhjBCTBR 71du/Q7kNjPwjPd9goikj8V/78QpBZcvfB8Hk/pTcdhWfJuw1Yq1nHT1EoHGKSjRsoNk wBvy/lHJvTwCo8F3I6zw1CkaMdS5JXAGDSYg1hsi/FL/eYhBXIEg24OyMvefdocKAUMj sj53vUD1UlGIvVOMaHGzSONS4z2/1smvTHFUCwhSNBtI2hnTa2VusYuUSthpYnPvgm0+ 67Bg== X-Gm-Message-State: ALoCoQk+/USeia+XT+ZB6FJhkzEdMtXV5YmpGcG+WHk9B04EqJKuZ9B9WJOpApxtuRBBfZXOUnzcX/7iHNwvPuY8b/aLlZhb9Q== X-Received: by 10.98.70.19 with SMTP id t19mr58933pfa.50.1449683360276; Wed, 09 Dec 2015 09:49:20 -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 l20sm13049117pfi.10.2015.12.09.09.49.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 09:49:19 -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 v4 2/7] mm/gup: add gup trace points Date: Wed, 9 Dec 2015 09:29:19 -0800 Message-Id: <1449682164-9933-3-git-send-email-yang.shi@linaro.org> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1449682164-9933-1-git-send-email-yang.shi@linaro.org> References: <1449682164-9933-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..00a3cff 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, nr_pages); + /* * Disable interrupts. We use the nested form as we can already have * interrupts disabled by get_futex_key.