From patchwork Tue Dec 8 19:39:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 57895 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp243535lbb; Tue, 8 Dec 2015 12:00:28 -0800 (PST) X-Received: by 10.98.12.8 with SMTP id u8mr7624976pfi.76.1449604827924; Tue, 08 Dec 2015 12:00:27 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bw10si7065804pac.157.2015.12.08.12.00.27; Tue, 08 Dec 2015 12:00:27 -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 S1752646AbbLHUAA (ORCPT + 28 others); Tue, 8 Dec 2015 15:00:00 -0500 Received: from mail-pf0-f178.google.com ([209.85.192.178]:35955 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752472AbbLHT7z (ORCPT ); Tue, 8 Dec 2015 14:59:55 -0500 Received: by pfdd184 with SMTP id d184so17005579pfd.3 for ; Tue, 08 Dec 2015 11:59:54 -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=H7xN+E1iD2ohx1ZQnqg29Lg9DjHwTnkBaoH8zuLkV6c=; b=t5X5i7qvDAgSaYR6JIoZf3DYfwvYVggvzOmZOLnGoDwc6/z2PoCxAPwj+VrGb7LDbp Z+P6gngdn1AQVd4by2QXhWdRipWPeY7aj6r+5K85kCi/SFt1nCp7/Y6DPustUkefvL3m X/rtjyiyzYrxu6+CNhqvp9jrIgLdtgbCr/Pve/b99j5mMoqYBueuSaTHKLXHP+Yd4kjO IMl8xxSjZxuRbegscSCs2vu2LEDqtVIEJl5F1uVuIYtJESo8zBFRhQJcB4HUt2B4Hhd+ X5RSl0U06IPwMF6W+8PXHRRtCW+Kg/aFopQIGrCAk2Dnu+7An+UbXqNlT+STbxBG1Fdh Bh0A== 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=H7xN+E1iD2ohx1ZQnqg29Lg9DjHwTnkBaoH8zuLkV6c=; b=Pfu+V2H+BiEM7Y3cyyGcf66LOff3rzA840MBWTl6nwuILkj3iS84v7R7eGPn9BHLDr D+AivwMvVP1RM75t/SXNqBxx0yOGJj4e7g8DufL3QlL1uYAx1qdzvunQ8CkWmyipWToR ng75gkdA8wZ17XwUOIExjY3czul03TNuQxuGjmTKsLXs2jrOzkBhCqhXM42ruI0a7eSA 4QZljTEzXgxNEv+4+fTzHJFPnAqEFXGSdRR2BuF2LDhAVRts06NNTAsW46z6/BIDmCDu g5TyeEZbtY252X35VNU+4qdodQx064nvoFZ/WMg8U5DotfmDgK2gkaR1SB/SY9zDHhLJ TzIw== X-Gm-Message-State: ALoCoQkXz8YxyCp86HSNvLX+2k+8l1aMRyNnH6+L4z9Z26VvUUHDZ3v7Ul9w6c2B7uAKKduIQCtDzafhRvlc440JNixJ0VkoNQ== X-Received: by 10.98.73.10 with SMTP id w10mr7504918pfa.164.1449604794563; Tue, 08 Dec 2015 11:59:54 -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.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2015 11:59:53 -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 1/7] trace/events: Add gup trace events Date: Tue, 8 Dec 2015 11:39:49 -0800 Message-Id: <1449603595-718-2-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 page-faults events record the invoke to handle_mm_fault, but the invoke may come from do_page_fault or gup. In some use cases, the finer event count mey be needed, so add trace events support for: __get_user_pages __get_user_pages_fast fixup_user_fault Signed-off-by: Yang Shi --- include/trace/events/gup.h | 63 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 include/trace/events/gup.h -- 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/include/trace/events/gup.h b/include/trace/events/gup.h new file mode 100644 index 0000000..7575930 --- /dev/null +++ b/include/trace/events/gup.h @@ -0,0 +1,63 @@ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM gup + +#if !defined(_TRACE_GUP_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_GUP_H + +#include +#include + +TRACE_EVENT(gup_fixup_user_fault, + + TP_PROTO(unsigned long address), + + TP_ARGS(address), + + TP_STRUCT__entry( + __field( unsigned long, address ) + ), + + TP_fast_assign( + __entry->address = address; + ), + + TP_printk("address=%lx", __entry->address) +); + +DECLARE_EVENT_CLASS(gup, + + TP_PROTO(unsigned long start, unsigned long nr_pages), + + TP_ARGS(start, nr_pages), + + TP_STRUCT__entry( + __field( unsigned long, start ) + __field( unsigned long, nr_pages ) + ), + + TP_fast_assign( + __entry->start = start; + __entry->nr_pages = nr_pages; + ), + + TP_printk("start=%lx nr_pages=%lu", __entry->start, __entry->nr_pages) +); + +DEFINE_EVENT(gup, gup_get_user_pages, + + TP_PROTO(unsigned long start, unsigned long nr_pages), + + TP_ARGS(start, nr_pages) +); + +DEFINE_EVENT(gup, gup_get_user_pages_fast, + + TP_PROTO(unsigned long start, unsigned long nr_pages), + + TP_ARGS(start, nr_pages) +); + +#endif /* _TRACE_GUP_H */ + +/* This part must be outside protection */ +#include