From patchwork Tue Dec 1 22:42:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 57520 Delivered-To: patches@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2506351lbb; Tue, 1 Dec 2015 15:01:47 -0800 (PST) X-Received: by 10.98.74.221 with SMTP id c90mr83921641pfj.127.1449010907380; Tue, 01 Dec 2015 15:01:47 -0800 (PST) Return-Path: Received: from mail-pa0-x22b.google.com (mail-pa0-x22b.google.com. [2607:f8b0:400e:c03::22b]) by mx.google.com with ESMTPS id zh9si130125pac.79.2015.12.01.15.01.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Dec 2015 15:01:47 -0800 (PST) Received-SPF: pass (google.com: domain of yang.shi@linaro.org designates 2607:f8b0:400e:c03::22b as permitted sender) client-ip=2607:f8b0:400e:c03::22b; Authentication-Results: mx.google.com; spf=pass (google.com: domain of yang.shi@linaro.org designates 2607:f8b0:400e:c03::22b as permitted sender) smtp.mailfrom=yang.shi@linaro.org; dkim=pass header.i=@linaro-org.20150623.gappssmtp.com Received: by pacej9 with SMTP id ej9so19350324pac.2 for ; Tue, 01 Dec 2015 15:01:47 -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; bh=eVqxTige9JxeVSV3jd95A7x2eGH30vTjFhbeckCOyVE=; b=Y47xwEwldTSo3hvYiZ7c2l3bm84GCgEOE0zecOKvLcmm80K9xXMtwyarFju5Rzk7E/ 8hWl/Qj4gaQAu3AH2FC6UjnIZ86onL41yWOxQlRahQZCzn5gG7EBNk+DOwvW1F0l9IvQ oLvRKfq0QSI23mVy0Yf6BxZIDzuk5xMv5QvKQXLiISmMoC1CGJBtaVtW2VpawGaXpkm/ Dwyc/ZH3ncxvqWDpzaRWenlt48yiLEK/S4ZtqzAjQLDBMKmZw7jMro885IHCKSXLKknr Ms3/LMb+lq+6/uC+ZSkgi35YOLw3ootgkBgepnph80Av4lvS0memNz+0bCILHJwZpl1T osZA== 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; bh=eVqxTige9JxeVSV3jd95A7x2eGH30vTjFhbeckCOyVE=; b=Eb1ypZ9xn2xOypWKw2qHMP6oJF1iS0ghEd7rP2ddpsEY9WeAvcS3U0zwJeaOOKPjVM BHWlfNdndSCDDNFbn2d+ZZYxwJ4sZqCfKrfkWvG6UTaAQ5YZe2vmBTEXI348zO0Fw8t7 Z/TZa0nJHDLSGMgUHQxW9qxBE5cP4C7XBmueVHUwCh3yVj0X8g3vroT0Uq/CWSoMXy+V WdBIHwSlpRDJYpfOuy1A1TCgz0+5Te58ZFIhoIWNK9zW3zMBJ6nKdwvz+VpAnQtnIb5i KsdaA8yFMAT0sZVO07Lo/py8WZ/zxvnqG+VxiL0a4NQQU9oz1BIPcrKZlKe2OSI1WK+h HVig== X-Gm-Message-State: ALoCoQktw42YiuY5pTQM8ocU1B7ty1NO8+Q2dy+8R/QSo3xT7qn2tRzSAF38mwHBFc7qSrfYxBqa X-Received: by 10.66.251.193 with SMTP id zm1mr102454296pac.154.1449010907013; Tue, 01 Dec 2015 15:01:47 -0800 (PST) Return-Path: 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 fc8sm46587pab.21.2015.12.01.15.01.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Dec 2015 15:01:46 -0800 (PST) From: Yang Shi To: yang.shi@linaro.org Cc: patches@linaro.org, linaro-kernel@lists.linaro.org, Yang Shi Subject: [PATCH 1/7] trace/events: Add gup trace events Date: Tue, 1 Dec 2015 14:42:20 -0800 Message-Id: <1449009740-29604-1-git-send-email-yang.shi@linaro.org> X-Mailer: git-send-email 2.0.2 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 Cc: Yang Shi 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 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