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 A44CBC74A5B for ; Sat, 18 Mar 2023 16:41:54 +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=a377nT99wUstM5CJ9eX6HA16PBzlBi34ZGKeAxr5v20=; b=dvAo6388jPLaNq 42e9M6dfIjJ9meCGb1K3vbQ0WJhArATqvKwh0k9/XHTU8XvlXcsh5Y/wb5GePTS2PCz78GdfUgZbL Tj5X2LOwNhVzkgPTtoNuO/oGPu8BCJrwbjBkqQNtxTNqntwN09xnO3D41F6mpR5cwV8vWBjBkTSWc QdF81NtYuZp9V8P+VS2GiQK7BmDGwyJ2HL+3PkIG5yRDdnUBdsZtq+FhEsw9lxosTUxAWXpm1Sjn3 XLpfNA7ZDfGZLB3yJq5d1RKHjoyipyLKi99+hSVyjwwgLOVP11Ul0dC0ujkP7/sB4AQ3Z4/fufv2t QOQ6aC2IPoSX20xP5myg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pdZbk-0050q8-1V; Sat, 18 Mar 2023 16:40:40 +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 1pdZbf-0050pQ-2F; Sat, 18 Mar 2023 16:40:37 +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 582A8B8091A; Sat, 18 Mar 2023 16:40:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EEBFC433EF; Sat, 18 Mar 2023 16:40:30 +0000 (UTC) Date: Sat, 18 Mar 2023 12:40:28 -0400 From: Steven Rostedt To: Donglin Peng Cc: "Russell King (Oracle)" , mhiramat@kernel.org, mark.rutland@arm.com, will@kernel.org, catalin.marinas@arm.com, palmer@dabbelt.com, paul.walmsley@sifive.com, tglx@linutronix.de, dave.hansen@linux.intel.com, x86@kernel.org, mingo@redhat.com, xiehuan09@gmail.com, dinghui@sangfor.com.cn, huangcun@sangfor.com.cn, dolinux.peng@gmail.com, linux-trace-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/2] function_graph: Support recording and printing the return value of function Message-ID: <20230318124028.4faf75d1@rorschach.local.home> In-Reply-To: <34781b74-8d3e-a7e6-9abe-e8d45d680eec@sangfor.com.cn> References: <20230315133911.958741-1-pengdonglin@sangfor.com.cn> <20230315133911.958741-2-pengdonglin@sangfor.com.cn> <34781b74-8d3e-a7e6-9abe-e8d45d680eec@sangfor.com.cn> 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-20230318_094035_901182_F886E488 X-CRM114-Status: GOOD ( 17.61 ) 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 Fri, 17 Mar 2023 10:49:49 +0800 Donglin Peng wrote: > > So, really it depends what size of return value we want to report. > > Also, please bear in mind that where a function returns a 32-bit > > value, that will be in r0, and r1 will be whatever happened to be > > in it at function exit - there's no defined value for r1. > > > > Thank you. I will document this as a limitation of fgraph return value. > It can just cover most cases at present and I think the r0 is enough. One thing we could possibly do here is to use BTF or objtool to denote the return value of each function and use 2 bits of the ftrace rec->flags to state that it is: 0 - void 1 - 1 word size return 2 - 2 word size return I believe we can get access to the function's rec via the return call (or add that access) and pass both words to the return function, and then the return callback can use this lookup to determine what values are useful or not. In any case, I would suggest passing both regs to the callback, and for now just ignore the second reg until we can come up with a way to differentiate each function. -- Steve _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel