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 8BA2EC28B2B for ; Thu, 18 Aug 2022 20:50:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345166AbiHRUuV (ORCPT ); Thu, 18 Aug 2022 16:50:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231771AbiHRUuT (ORCPT ); Thu, 18 Aug 2022 16:50:19 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99237CE496; Thu, 18 Aug 2022 13:50:18 -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 sin.source.kernel.org (Postfix) with ESMTPS id E841BCE232A; Thu, 18 Aug 2022 20:50:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 630B9C433C1; Thu, 18 Aug 2022 20:50:13 +0000 (UTC) Date: Thu, 18 Aug 2022 16:50:24 -0400 From: Steven Rostedt To: Jiri Olsa Cc: Peter Zijlstra , Alexei Starovoitov , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Ingo Molnar , bpf , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , LKML , Josh Poimboeuf Subject: Re: [RFC] ftrace: Add support to keep some functions out of ftrace Message-ID: <20220818165024.433f56fd@gandalf.local.home> In-Reply-To: References: X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; 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-kernel@vger.kernel.org On Thu, 18 Aug 2022 22:27:07 +0200 Jiri Olsa wrote: > ok, so the problem with __attribute__((patchable_function_entry(5))) is that > it puts function address into __patchable_function_entries section, which is > one of ftrace locations source: > > #define MCOUNT_REC() . = ALIGN(8); \ > __start_mcount_loc = .; \ > KEEP(*(__mcount_loc)) \ > KEEP(*(__patchable_function_entries)) \ > __stop_mcount_loc = .; \ > ... > > > it looks like __patchable_function_entries is used for other than x86 archs, > so we perhaps we could have x86 specific MCOUNT_REC macro just with > __mcount_loc section? So something like this: #ifdef CONFIG_X86 # define NON_MCOUNT_PATCHABLE KEEP(*(__patchable_function_entries)) # define MCOUNT_PATCHABLE #else # define NON_MCOUNT_PATCHABLE # define MCOUNT_PATCHABLE KEEP(*(__patchable_function_entries)) #endif #define MCOUNT_REC() . = ALIGN(8); \ __start_mcount_loc = .; \ KEEP(*(__mcount_loc)) \ MCOUNT_PATCHABLE \ __stop_mcount_loc = .; \ NON_MCOUNT_PATCHABLE \ ... ?? -- Steve