From patchwork Tue Dec 1 23:06:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 57527 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2518439lbb; Tue, 1 Dec 2015 15:27:52 -0800 (PST) X-Received: by 10.98.13.22 with SMTP id v22mr61143pfi.125.1449012472532; Tue, 01 Dec 2015 15:27:52 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id lf12si294081pab.22.2015.12.01.15.27.52; Tue, 01 Dec 2015 15:27:52 -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 S932238AbbLAX1u (ORCPT + 28 others); Tue, 1 Dec 2015 18:27:50 -0500 Received: from mail-pa0-f45.google.com ([209.85.220.45]:34202 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757285AbbLAX0B (ORCPT ); Tue, 1 Dec 2015 18:26:01 -0500 Received: by padhx2 with SMTP id hx2so19964533pad.1 for ; Tue, 01 Dec 2015 15:26:01 -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=QSShqP/ivpUe59Ib8FNnJ/9jGrrgGoF5/DQtIzNAml4=; b=QDzuuzZNZV4HpPOCv0CS2HidOx3TE73rlNexKeY/N1W0vNS5kzjmgf+Dr8ipyIgl6V r5l+VuujN6/b0sdq/u7sxtTBhbGwDApBo1w826SNRQNfZduJfl1TgHT1kospCBGHQ3oO fhAU3zW/g1l5yHPjVEsMwAa5I7jdDbxXhrCRvJNx+a4bDMi+I9XW23fSRLL5lYYrraZa X7/DMg8Y4X9+S4qZlTsGjvUWOkk1Kpucw6tZICn8/pn8RxE/+YHoZj7i6Ww2PoA9ecdP 2G1eKxXrNA7AmofyHUZI80KyhjsxveHlJxdDZ01ueZNZd+fWNIN8QI79IXeWSmo6E9SO JQhQ== 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=QSShqP/ivpUe59Ib8FNnJ/9jGrrgGoF5/DQtIzNAml4=; b=QMYSxphmeAlxpiLwpDjSEIhqgUWHuwDPO5DGu6OCJXIkJoEdQ/h8tGiXmQ5yDKDaUP T52mpAyUecuhbw5ttoZ6D8ZMGyOnnVoNiw9vUTpZbndZYwPDdi2jixKup2xS6H7rpIqC JKffqG8rS842yHyPEGjaqCfhZvALPox/w59vKKjdiI+UrICohd4xgMUV3m7PGX29/VS6 CLvlA3FIGdOuxSA4GKX/ctsa7zpI99j2zTwXlC8wo9CvAiGOwNAB9+/4bf0LBQkofs0Y MvWdvx++ILZ1aOHVUASWb83X2sGxKnBbgtpZvtFMtD/U9Ytgxu95Cd3WZzLF4qWgbA5D dSgw== X-Gm-Message-State: ALoCoQk4xPQEcu+RiFqeirLUkE/eSpQbaPCXPW+evZk3sai/LnibWvliRBaFDg89DdEfkovK36Uw X-Received: by 10.66.159.38 with SMTP id wz6mr154008pab.12.1449012360987; Tue, 01 Dec 2015 15:26:00 -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 sz9sm108777pab.13.2015.12.01.15.26.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Dec 2015 15:26:00 -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 1/7] trace/events: Add gup trace events Date: Tue, 1 Dec 2015 15:06:11 -0800 Message-Id: <1449011177-30686-2-git-send-email-yang.shi@linaro.org> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1449011177-30686-1-git-send-email-yang.shi@linaro.org> References: <1449011177-30686-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 | 77 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 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..37d18f9 --- /dev/null +++ b/include/trace/events/gup.h @@ -0,0 +1,77 @@ +#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( + __array( char, comm, TASK_COMM_LEN ) + __field( unsigned long, address ) + ), + + TP_fast_assign( + memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); + __entry->address = address; + ), + + TP_printk("comm=%s address=%lx", __entry->comm, __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, + unsigned int gup_flags, struct page **pages, + struct vm_area_struct **vmas, int *nonblocking), + + TP_ARGS(tsk, mm, start, nr_pages, gup_flags, pages, vmas, nonblocking), + + TP_STRUCT__entry( + __array( char, comm, TASK_COMM_LEN ) + __field( unsigned long, start ) + __field( unsigned long, nr_pages ) + ), + + TP_fast_assign( + memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); + __entry->start = start; + __entry->nr_pages = nr_pages; + ), + + TP_printk("comm=%s start=%lx nr_pages=%lu", __entry->comm, __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