From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 33B2EC6FD1D for ; Mon, 20 Mar 2023 13:20:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WQuHBXEfuD2iLa2J+zzu1viAY64xbi4x7qL52ylxw7M=; b=Yn6pzQ2k+hVply v6OCXPlXPqn6qfRg5EnjLgFW7L+ib+2MSHZSyOAVdqZTZR1MwKo3obaAY1DWYkgAEFtbTevWUj2XY ITRejgYsJbXt+Dzuirj0I5hpa9JPfIDdkHHTNI8IZnhHMjvCyHd3VEAjVgAT0q2xjLvYgXVbTE3LH ZVp3qM46O8VQqJKH7VG9yBPTWM+prCrogMMsMFEILnrF61b9n0BaFe3tCrOW+pvohzkAoMB8IbSlA zwWfgGiMwckAyXKi4sIKZhntOyk6MM/EC4BYf8nnc6M6MynDCD2r8zQC4YHx5Hg9ZtHJCjsoso8lm 3YXeX89+jX/5bW8A1Yog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1peFQC-00967O-14; Mon, 20 Mar 2023 13:19:32 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1peFPl-0095rJ-2K for linux-arm-kernel@lists.infradead.org; Mon, 20 Mar 2023 13:19:07 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 631CAB80D58; Mon, 20 Mar 2023 13:19:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C8C9C4339E; Mon, 20 Mar 2023 13:19:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679318343; bh=G4pPz8oIMmbr/5XkBqmuCaf4Fo7uw4oVjyQLPcnR7t0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nBwcx8tKghpfpBE9K9Fmd5mnYSu0zboj+jQUYKwY5dTtFzDPh2AueggvqhVkVnVZe N991rlE2i7ERnx5GePxGrGy/7DAoWyzfco+Dp1psuaoh+e5cmfldoT7pxtp2KLn7ff ia/qhmMZ8LVK+tX+1/N+jjWFyITPG7aQQUG5Hzza3RhVP+hhyEvZnf5Q08r6bt057h AASp3tejsOGCGt46MVhXZ6HuMMh9nEiiAFrdbsrRkrChFaIfuPoS+s67xzOOWr9Zc7 7l9fLa/pidn/ynGn2Tx55TK/Mwdh20ONwGAatnsKhVbWCnstN6l6/otDpeHuXN9fO1 B4tdV4UfXge9w== From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk Cc: Ard Biesheuvel , Frederic Weisbecker , Guenter Roeck , Peter Zijlstra , Linus Walleij , Arnd Bergmann Subject: [PATCH v4 05/12] ARM: vfp: Record VFP bounces as perf emulation faults Date: Mon, 20 Mar 2023 14:18:38 +0100 Message-Id: <20230320131845.3138015-6-ardb@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230320131845.3138015-1-ardb@kernel.org> References: <20230320131845.3138015-1-ardb@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1469; i=ardb@kernel.org; h=from:subject; bh=G4pPz8oIMmbr/5XkBqmuCaf4Fo7uw4oVjyQLPcnR7t0=; b=owGbwMvMwCFmkMcZplerG8N4Wi2JIUUiVttuf2jfp0nV4tMbp31q4uG6knTZ6M/HXwIMjI3pf zd5vhLtKGVhEONgkBVTZBGY/ffdztMTpWqdZ8nCzGFlAhnCwMUpABOZ4sPI8C9wrj0n59lpnMkv FC2UDv/pbfbPKWi/9YyT43PLtDp2fYb/KYrH3+wuXi20ZtJvvWkKBb4Z9ao+vyzMQn62+kz4Uf6 QHwA= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230320_061905_918638_A02BC8DD X-CRM114-Status: GOOD ( 14.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org VFP 'bouncing' occurs when the VFP unit cannot complete the execution of a VFP instruction, either because it is not implemented at all, or because the values of the arguments are out of range for the hardware implementation, and the software needs to step in to complete the operation. To give some insight in how much certain programs rely on this bouncing, record the emulation of a VFP instruction in perf's emulation-faults counter. This can be used like so perf stat -e emulation-faults ./testfloat -all2 and the output will be something like Performance counter stats for './testfloat -all2': 259,277 emulation-faults:u 6.846432176 seconds time elapsed Signed-off-by: Ard Biesheuvel --- arch/arm/vfp/vfpmodule.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c index 4c7473d2f89a040f..039c8dab990699e2 100644 --- a/arch/arm/vfp/vfpmodule.c +++ b/arch/arm/vfp/vfpmodule.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -313,6 +314,7 @@ static u32 vfp_emulate_instruction(u32 inst, u32 fpscr, struct pt_regs *regs) * emulate it. */ } + perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, regs->ARM_pc); return exceptions & ~VFP_NAN_FLAG; } -- 2.39.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel