Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2455815rdb; Fri, 8 Dec 2023 08:35:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IFQGfmv+9fnsAnMp0n0SSMZrXg642O6S4NkY3pT2f9cVbJEPbcXOvHqPy1h9hUfAiSllSxF X-Received: by 2002:a17:902:9a0a:b0:1d0:6ffd:9e1c with SMTP id v10-20020a1709029a0a00b001d06ffd9e1cmr327274plp.110.1702053340991; Fri, 08 Dec 2023 08:35:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702053340; cv=none; d=google.com; s=arc-20160816; b=VspLjxUIeP3+y9pOCSMFMVRqAB8VuguONI0pwxwJjgQcCWQ+IKQC6XH2q7mOUiXWSP thvbcIvc5QoMxZMbfu5JWBZwChkzaO8ZxtPDtszFL2Wi2FMN2ljcJKMwHnyJSP9i1DlI 6N8JfB+n8tu/g7YLe7gwsXL9UNVMgTKVEEp0ijnBUWU95gBWa7afQvuhw+0pzRwQSmA5 8TRx2qrrOqtaTnnylHoUuoPIj1Bo8w2NOVR3SSxc6c7Gy0Qs4EV8pvLudDwjEqfSL+Gn muSGVcw5te+64uigkITam3iGMM8XaUA35Ya11LNITSUoTpYUREh3uSwChnCt1YSBuQ64 t+BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=docXXJUQKvFo6hCEMQlJujtXrlSpD8+6ZnuTkNOMosw=; fh=hPWrg32dlFKNN5MdTsgIUJTVaEJ0Jhxi8OfbSIPXQ0A=; b=yb4QBy5ET+OqRXgiI9M4LBSwVAvwx2GjbX3iPQBTN4E/IiHgPgKB98Z5AvZlgAZYOx 9fjhiqBR7rdfw+TF6vDINvwuDXrLQV16vOxM/2gbewUrvc9VDReAAtfFrEWp+zK1nBd9 ppokRg0V9RUcD+UB9B08cahOtFrYVCLMbLsdcHneEWjCuWM2gM7gjXOLHV923Td6Ws7E cyopyanjk8WJyUnu4Pdbk4XHT2xME7jxRONGTs6dD4YS63DPMiko6S/Tm8q6Gk1H3+Pa rJpJkdG9yZaFIUsS5S03V8BIOT78cEX/0CJ3qKO/FIMni8OMjcAKNHaOAhH+M0ztWB1N SEow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GDMWy+Me; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id jk8-20020a170903330800b001d06da4274dsi1859518plb.99.2023.12.08.08.35.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 08:35:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GDMWy+Me; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 7CC6380AC379; Fri, 8 Dec 2023 08:35:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1574038AbjLHQfB (ORCPT + 99 others); Fri, 8 Dec 2023 11:35:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233597AbjLHQe5 (ORCPT ); Fri, 8 Dec 2023 11:34:57 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47AE4198D for ; Fri, 8 Dec 2023 08:35:03 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C539C433C9; Fri, 8 Dec 2023 16:35:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702053302; bh=xQL6pG6caMEyh27UFdkVG4YVqENSinSYSj4xkfqkX3c=; h=From:To:Cc:Subject:Date:From; b=GDMWy+MeAdezgVTuAgkePTDVNCDmK6Xb8vdKI+aRsMe1aHkIohr2LQhf1GDl1VW3p Qquxo3Cj+Gf5cb/QZuFokdhqLBP1FrAJ8Xgxymun8pajiCz2JdgZZgcvyIlNCfokKf ZdzdF2+bkZMDW7TxDMJP7oBDr7yXViufFmxlCNNPhkBiSacXp8vNxdVzu0oTokHzAV 6qPuW2i5fpMmEiIjtxUrcndcOqG8XNhqGbfo4rzj/q/rM6gbc9497pDenwuTZzf+cu BATEflAHnCRp+pUO+NvOT4fGDZLRsbteEvmG2mBAHMHsZYrv252nKEnpnFjnwwRvhS 1x1qOB9aFrx8w== From: Naveen N Rao To: , Cc: Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Aneesh Kumar K.V" , Steven Rostedt , Mark Rutland , Florent Revest , Masami Hiramatsu Subject: [RFC PATCH 0/9] powerpc: ftrace updates Date: Fri, 8 Dec 2023 22:00:39 +0530 Message-ID: X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 08 Dec 2023 08:35:22 -0800 (PST) Early RFC. This series attempts to address couple of issues with the existing support for ftrace on powerpc, with a view towards improving performance when ftrace is not enabled. See patch 6 for more details. Patches 7 and 8 implement support for ftrace direct calls, through adding support for DYNAMIC_FTRACE_WITH_CALL_OPS. The first 5 patches are minor cleanups and updates, and can go in separately. This series depends on Benjamin Gray's series adding support for patch_ulong(). I have lightly tested this patch set and it looks to be working well. As described in patch 6, context_switch microbenchmark shows an improvement of ~6% with this series with ftrace disabled. Performance when ftrace is enabled reduces due to how DYNAMIC_FTRACE_WITH_CALL_OPS works, and due to support for direct calls. Some of that can hopefully be improved, if this approach is otherwise ok. - Naveen Naveen N Rao (8): powerpc/ftrace: Fix indentation in ftrace.h powerpc/ftrace: Unify 32-bit and 64-bit ftrace entry code powerpc/ftrace: Remove nops after the call to ftrace_stub powerpc/kprobes: Use ftrace to determine if a probe is at function entry powerpc/ftrace: Update and move function profile instructions out-of-line powerpc/ftrace: Add support for DYNAMIC_FTRACE_WITH_CALL_OPS powerpc/ftrace: Add support for DYNAMIC_FTRACE_WITH_DIRECT_CALLS samples/ftrace: Add support for ftrace direct samples on powerpc Sathvika Vasireddy (1): powerpc/Kconfig: Select FUNCTION_ALIGNMENT_4B arch/powerpc/Kconfig | 6 + arch/powerpc/Makefile | 6 +- arch/powerpc/include/asm/code-patching.h | 15 +- arch/powerpc/include/asm/ftrace.h | 35 ++- arch/powerpc/include/asm/linkage.h | 3 - arch/powerpc/kernel/asm-offsets.c | 7 + arch/powerpc/kernel/kprobes.c | 69 +++++- arch/powerpc/kernel/trace/ftrace.c | 231 ++++++++++++++++---- arch/powerpc/kernel/trace/ftrace_entry.S | 182 +++++++++++---- samples/ftrace/ftrace-direct-modify.c | 94 +++++++- samples/ftrace/ftrace-direct-multi-modify.c | 110 +++++++++- samples/ftrace/ftrace-direct-multi.c | 64 +++++- samples/ftrace/ftrace-direct-too.c | 72 +++++- samples/ftrace/ftrace-direct.c | 61 +++++- 14 files changed, 845 insertions(+), 110 deletions(-) base-commit: 9a15ae60f2c9707433b01e55815cd9142be102b2 prerequisite-patch-id: 38d3e705bf2e27cfa5e3ba369a6ded84ba6615c2 prerequisite-patch-id: 609d292e054b2396b603890522a940fa0bdfb6d8 prerequisite-patch-id: 6f7213fb77b1260defbf43be0e47bff9c80054cc prerequisite-patch-id: f2328625ae2193c3c8e336b154b62030940cece8 -- 2.43.0