From patchwork Wed Dec 9 17:29:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 58174 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp824523lbb; Wed, 9 Dec 2015 09:50:39 -0800 (PST) X-Received: by 10.98.73.10 with SMTP id w10mr32598pfa.164.1449683439843; Wed, 09 Dec 2015 09:50:39 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id la15si13956156pab.205.2015.12.09.09.50.38; Wed, 09 Dec 2015 09:50:39 -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 S1753142AbbLIRt0 (ORCPT + 28 others); Wed, 9 Dec 2015 12:49:26 -0500 Received: from mail-pf0-f173.google.com ([209.85.192.173]:35794 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752935AbbLIRtU (ORCPT ); Wed, 9 Dec 2015 12:49:20 -0500 Received: by pfu207 with SMTP id 207so33384982pfu.2 for ; Wed, 09 Dec 2015 09:49:19 -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=HZGi5fK8B6+666ph+uxP0V5Rk1WPjUvIFUW7r+VzNxU=; b=AnmIbZPQ/toBA2Iy/p3Kuw97XX8Uut4EWepRdTpEAa19BptCWKMDRiJGQZnuS/2Ssp y4/5znNgF7wMJdJFnlIiMR4P+EMYL/AcHyLcauWcEg6ICc7vQP8IAfBnB2HyZQTjvweu Jbnv4HF7/ebLRp232YWrwvyd0L03/WzZUKlKoIJmz3lGeP6T03Jk375qdIl2AIrFG7V0 l0m2j3/yZVi/nEBU4LoTDc1AGq1NoKTKBwol1vXEqu6gEWtnEl5u4vO1GHElkFGfSJn/ YLk47HBzBdTtELFptsYvKgHEjJml9VwZm3uq6G2JGgTUjVpl8mH4Ket8hmMtkZz4MYGN dnpA== 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=HZGi5fK8B6+666ph+uxP0V5Rk1WPjUvIFUW7r+VzNxU=; b=e3ogJ4lQwbJngOhDcF56RxEFwFzIT85hqUR5aV4Ef720nplPynBGUL1YFj8YHEcK+z rsqRHCj7UW/f/UmEFTw/p//2fxN4zMijLvB0jem4WCoPydxUPKBTJ7il5GREgYeSS+k0 WuVzhyqVKEp0uOPmxnwEWHTBJ7qLiJTLuRMpwNN5lIpjrYe5q4zecpDwbVxC8cW4CQjy pxxYbqgOVd6M+/p0uvv9YlkW80QfN9YuJL3SzuZoo3OM+C4M5RUtAFI6ecQJyE6O1CXG PiG/OIRaw70HLAGCYJADAAx96EN8tNG+lZiw6krqhh/3fTHmzwTguzcpmI2ivUHB4GWe g9Xg== X-Gm-Message-State: ALoCoQki0V7MZB40scX/MhW3Bv+pbxSTJxTVq4d1Xd6Du1P3I4jOH1YRsz1SkV9gSPz+sIr/GmQKLhtx35XHq0lLTbQuGogpCg== X-Received: by 10.98.86.10 with SMTP id k10mr14817261pfb.85.1449683359324; Wed, 09 Dec 2015 09:49:19 -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.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 09:49:18 -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 1/7] trace/events: Add gup trace events Date: Wed, 9 Dec 2015 09:29:18 -0800 Message-Id: <1449682164-9933-2-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 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..ac0e011 --- /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 int nr_pages), + + TP_ARGS(start, nr_pages), + + TP_STRUCT__entry( + __field( unsigned long, start ) + __field( unsigned int, nr_pages ) + ), + + TP_fast_assign( + __entry->start = start; + __entry->nr_pages = nr_pages; + ), + + TP_printk("start=%lx nr_pages=%d", __entry->start, __entry->nr_pages) +); + +DEFINE_EVENT(gup, gup_get_user_pages, + + TP_PROTO(unsigned long start, unsigned int nr_pages), + + TP_ARGS(start, nr_pages) +); + +DEFINE_EVENT(gup, gup_get_user_pages_fast, + + TP_PROTO(unsigned long start, unsigned int nr_pages), + + TP_ARGS(start, nr_pages) +); + +#endif /* _TRACE_GUP_H */ + +/* This part must be outside protection */ +#include