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 BEAD3C433F5 for ; Mon, 9 May 2022 18:23:16 +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:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KagoB8xKMi+H/DQXvh1AOsekWTnL8w8RKGJLTmla3TY=; b=bPGSxf2lNpMgqZ YdSi9vc2+gE7W4Xux/jHtDYE/gGo3b1IikczOqyOUH6CsI+QcgE4dpDzIjCM36RWX/Y0TC9VlQw/L jNbJvTZwfhfOcQt8oRmu0PS0m2GxpRPfLPlbtHPmidiwgI0RPMWix+TLUpjGk7GfptOBlaG03fNbq HpNUlLngouRlkipLo7q7SR5Y98jSnUoDckSGEZdNWQkGB7ni9u4LvMDety+HIf+hKQWh42LO4JrDC PF5Xd5jlY36DUAfcohIo+5fkxBzTZALfmOFeyS7ECORWGnOU3tixzk0YZ2+Fga/sD6TR0HKYjjQZk L625I+vkCjsIq3vXZ+Cg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1no81O-00FpuX-RE; Mon, 09 May 2022 18:22:14 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1no81K-00Fpo4-2o for linux-arm-kernel@lists.infradead.org; Mon, 09 May 2022 18:22:12 +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 16087B80FA6; Mon, 9 May 2022 18:22:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92DCBC385B2; Mon, 9 May 2022 18:22:05 +0000 (UTC) Date: Mon, 9 May 2022 14:22:03 -0400 From: Steven Rostedt To: Masami Hiramatsu Cc: Mark Rutland , Wang ShaoBo , cj.chengjian@huawei.com, huawei.libin@huawei.com, xiexiuqi@huawei.com, liwei391@huawei.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will@kernel.org, zengshun.wu@outlook.com Subject: Re: [RFC PATCH -next v2 3/4] arm64/ftrace: support dynamically allocated trampolines Message-ID: <20220509142203.6c4f2913@gandalf.local.home> In-Reply-To: <20220505121538.04773ac98e2a8ba17f675d39@kernel.org> References: <20220421100639.03c0d123@gandalf.local.home> <20220421114201.21228eeb@gandalf.local.home> <20220421130648.56b21951@gandalf.local.home> <20220422114541.34d71ad9@gandalf.local.home> <20220426174749.b5372c5769af7bf901649a05@kernel.org> <20220505121538.04773ac98e2a8ba17f675d39@kernel.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220509_112210_325500_0C40C68F X-CRM114-Status: GOOD ( 17.28 ) 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 On Thu, 5 May 2022 12:15:38 +0900 Masami Hiramatsu wrote: > OK. But my interest is that the ftrace on arm64 can provide a limited > access to registers via pt_regs or not. I don't mind the contained values > so much because in the most case, 'users' will (most likely) access to the > ARGs via BPF or tracefs (and we can just warn users if they try to access > the registers which is not saved.) But if the arm64 ftrace only provides > a special data structure, arch-independent code must have 2 different access > code. That is inefficient. That is my concern. > IOW, I'm interested in interface abstraction. Note, ftrace now has a ftrace_regs structure that is passed to the callbacks for the function tracer. It then has an arch dependent helper function ftrace_get_regs(fregs), that returns a pt_regs from the fregs only if the fregs has a full pt_regs to return. If not, it returns NULL. This was suggested by both Peter Zijlstra and Thomas Gleixner when I introduced FTRACE_WITH_ARGS, where all functions can now get the arguments from fregs, but not the full pt_regs. If a ftrace_ops has the REGS flag set (using ftrace_regs_caller), the ftrace_get_regs(fregs) will return the pt_regs, or it will return NULL if ftrace_regs_caller was not used. This way the same parameter can provide full pt_regs or a subset, and have an generic interface to tell the difference. -- Steve _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel