From patchwork Wed Dec 2 22:53:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 57583 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp3175043lbb; Wed, 2 Dec 2015 15:14:00 -0800 (PST) X-Received: by 10.98.71.217 with SMTP id p86mr8594843pfi.162.1449098040203; Wed, 02 Dec 2015 15:14:00 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id mj8si7583847pab.50.2015.12.02.15.13.59; Wed, 02 Dec 2015 15:14:00 -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 S1758465AbbLBXN0 (ORCPT + 28 others); Wed, 2 Dec 2015 18:13:26 -0500 Received: from mail-pa0-f45.google.com ([209.85.220.45]:34567 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757049AbbLBXNW (ORCPT ); Wed, 2 Dec 2015 18:13:22 -0500 Received: by padhx2 with SMTP id hx2so53625014pad.1 for ; Wed, 02 Dec 2015 15:13:21 -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=1kpvDFHVPFdXiN3sTl5rHDI8dwE1sEmx77OhjDi7Tu0=; b=SIya+YmHT0ID2lLGg7ij5GtAXvT7OIXHFnT6NHbPDU/kOa/IRNC7JnQplzw5phHoZi C2aGCsef4YNHMgERzosPZHfgCtv9l2wONiXtV0LmNkq93ysyZWSRLp5VNoUvjJDuGD1b Wx8+iZA6U1d8dpKqolj3gleeHlV6s+EkYkAXH0Asi84pzBhnX/d5wC847QIEMmxFdGU+ 3bbJNHyCPZcpqrVB2ReQ2Jb6BB2zLQWZt327XFA2BQpTHDLJ6qQvpSmY065Nht0eoeSU DAxFbH2iayHmtEUjl9VruGN54VVEvIkJx5NwPR8oD6wqfzD227rKjoSrZcLma8xvvyOK lrjw== 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=1kpvDFHVPFdXiN3sTl5rHDI8dwE1sEmx77OhjDi7Tu0=; b=XnctxzqBdkvBrp2wLeMqHybZUXOndq1iyX3EPdMBpQjZ0C85QClA1vCwKV9Jah2cI0 F+U445uKiUFlXPzfkXnKm49S5BnGxdhkcxpM1XE95bX2K1yx+NAMQSwPF+P3sLwcTUsF Ab5jqZYPva6TiHE6fGikSrCoZwsWpMqHgw/uvGP1tZDF0T999RrHNXOH5zLNN595ieIG YGw7EXcub1lqGd4CVIofVbGE4lyV52YOCCQeEEGrdTwQ0BjaYz/4t1EdHcd5UEIDTcZH 3xS6q/98YcGYRlcElvE2FY43vKgITIPAjc7gP+Ql1TfMbiuzaZMLdZUDJgQNzLA9ETXE YCIQ== X-Gm-Message-State: ALoCoQkjPyAeS1o7O+svkCIptr9i2vAWhyIO0CioxELpGxJt0INy6OMRar2eVxrwhtXa2aBWDiOp X-Received: by 10.66.55.39 with SMTP id o7mr8398706pap.13.1449098001762; Wed, 02 Dec 2015 15:13:21 -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 ga13sm6429030pac.47.2015.12.02.15.13.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Dec 2015 15:13:21 -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 V2 1/7] trace/events: Add gup trace events Date: Wed, 2 Dec 2015 14:53:27 -0800 Message-Id: <1449096813-22436-2-git-send-email-yang.shi@linaro.org> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1449096813-22436-1-git-send-email-yang.shi@linaro.org> References: <1449096813-22436-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 | 71 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 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..03a4674 --- /dev/null +++ b/include/trace/events/gup.h @@ -0,0 +1,71 @@ +#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(struct task_struct *tsk, struct mm_struct *mm, + unsigned long address, unsigned int fault_flags), + + TP_ARGS(tsk, mm, address, fault_flags), + + TP_STRUCT__entry( + __field( unsigned long, address ) + ), + + TP_fast_assign( + __entry->address = address; + ), + + TP_printk("address=%lx", __entry->address) +); + +TRACE_EVENT(gup_get_user_pages, + + TP_PROTO(struct task_struct *tsk, struct mm_struct *mm, + unsigned long start, unsigned long nr_pages), + + TP_ARGS(tsk, mm, 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) +); + +TRACE_EVENT(gup_get_user_pages_fast, + + TP_PROTO(unsigned long start, int nr_pages, int write, + struct page **pages), + + TP_ARGS(start, nr_pages, write, 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) +); + +#endif /* _TRACE_GUP_H */ + +/* This part must be outside protection */ +#include