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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16962C433EF for ; Wed, 23 Mar 2022 06:28:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232715AbiCWGaT (ORCPT ); Wed, 23 Mar 2022 02:30:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbiCWGaR (ORCPT ); Wed, 23 Mar 2022 02:30:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE6C052B1B; Tue, 22 Mar 2022 23:28:47 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 6E82961618; Wed, 23 Mar 2022 06:28:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F6D0C340E8; Wed, 23 Mar 2022 06:28:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648016926; bh=jcw//5QnXtIGt33tyaZpopiiPu5NKipd6vYgSxZStfo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IoH2mGGDQsQV7jlg6cG+jF9Tqec2Qouozz6CisTnOobsPoAw+6dsrUe5etr+aSZAl jdVv6LtAr43rBdYfAcznAG6GY3dbVkUE4u8s4gTAvfOeL20mxqK/IGApOMs7JxT0q5 RjY9uz0T9OYTUhvydYHPX4cw9GSJk0Qn8xm9r1Lgs5f8XiiCVUY+IhPeOP8TOfvWXG +TmhOJLFhIsDDawr7+2XnpKkVuLs2KjMQnQEIulvBz8cKkp46F1HQlcsyLI26d8ali 48TKHi+pkc1JH71Tt5UmZ2l9xmgP5LgpKulx/dYp60J+4XPbS3uf4N1+f5FXNSI43a gaO0wHThbLKfQ== Date: Wed, 23 Mar 2022 15:28:40 +0900 From: Masami Hiramatsu To: Steven Rostedt Cc: Peter Zijlstra , Stephen Rothwell , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Linux Kernel Mailing List , Linux Next Mailing List , ast@kernel.org, hjl.tools@gmail.com, rick.p.edgecombe@intel.com, rppt@kernel.org, linux-toolchains@vger.kernel.org, Andrew.Cooper3@citrix.com, ndesaulniers@google.com Subject: Re: linux-next: build warnings after merge of the tip tree Message-Id: <20220323152840.cb6295ec547f50d3ec34f02a@kernel.org> In-Reply-To: <20220322224236.46f8c2f1@gandalf.local.home> References: <20220321112805.1393f9b9@gandalf.local.home> <20220321121209.3b95e406@gandalf.local.home> <20220321121549.1c8588c5@gandalf.local.home> <20220321124551.3d73660b@gandalf.local.home> <20220321125419.0a20415c@gandalf.local.home> <20220322091242.1ad0206b@gandalf.local.home> <20220323112323.65337d76d96836e487064a99@kernel.org> <20220322224236.46f8c2f1@gandalf.local.home> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-next@vger.kernel.org On Tue, 22 Mar 2022 22:42:36 -0400 Steven Rostedt wrote: > On Wed, 23 Mar 2022 11:23:23 +0900 > Masami Hiramatsu wrote: > > > I see the __fexit__ is needed, but why __ftail__ is needed? I guess because > > func_B is notrace, in that case the __fexit__ will not be in the func_B. > > Am I correct? > > I believe Peter and I agreed that the "best" solution so far, that has the > least amount of regressions (doesn't remove anything currently being > function graph traced, nor removes current tail calls) is: > > > At that point giving us something like: > > > > 1: > > pushsection __ftail_loc > > .long 1b - . > > popsection > > > > jmp.d32 func_B > > call __fexit__ > > ret > > > Functions with a tail call will not have a __fexit__ and we can not rely on > the function that is the tail call to do the __fexit__ for the parent > function. Thus, the compromise is to add a label where the jmp to the > tail-call function is, and when we want to trace the return of that > function, we first have to patch the jmp into a call, which will then > return back to the call to __fexit__. Got it. So the tail call "jump" will be replaced with a normal call when we trace it. That's a good idea :) > > -- Steve -- Masami Hiramatsu