Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756474AbbGFNeM (ORCPT ); Mon, 6 Jul 2015 09:34:12 -0400 Received: from mail-la0-f53.google.com ([209.85.215.53]:36499 "EHLO mail-la0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756393AbbGFNd2 (ORCPT ); Mon, 6 Jul 2015 09:33:28 -0400 From: Max Filippov To: linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org Cc: Chris Zankel , Marc Gauthier , Max Filippov Subject: [PATCH 6/8] xtensa: count software page fault perf events Date: Mon, 6 Jul 2015 16:32:47 +0300 Message-Id: <1436189569-28802-7-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1436189569-28802-1-git-send-email-jcmvbkbc@gmail.com> References: <1436189569-28802-1-git-send-email-jcmvbkbc@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1150 Lines: 38 Signed-off-by: Max Filippov --- arch/xtensa/mm/fault.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/xtensa/mm/fault.c b/arch/xtensa/mm/fault.c index 9e3571a..76360a2 100644 --- a/arch/xtensa/mm/fault.c +++ b/arch/xtensa/mm/fault.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -142,6 +143,12 @@ good_area: } up_read(&mm->mmap_sem); + perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); + if (flags & VM_FAULT_MAJOR) + perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, address); + else if (flags & VM_FAULT_MINOR) + perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, address); + return; /* Something tried to access memory that isn't in our memory map.. -- 1.8.1.4 -- 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/