Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp875736rwb; Thu, 18 Aug 2022 14:01:13 -0700 (PDT) X-Google-Smtp-Source: AA6agR5PGj18AD9l9TDv5sprMU6nMWOTD9MDqtVKOJoAgl2TGUObp5mfymkUxPKNf5yxip4cwdm0 X-Received: by 2002:a17:907:7389:b0:732:fc99:cf6a with SMTP id er9-20020a170907738900b00732fc99cf6amr2943443ejc.335.1660856473306; Thu, 18 Aug 2022 14:01:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660856473; cv=none; d=google.com; s=arc-20160816; b=RDnMznC4w6b7t67BKE2CuwCFxxUnmxUZNUwe1N/9FjQVaA3fsH1FkarOw+ioRNc4je pSF781So/1Vo+pXejvJSOgCRYPunxaXC8S9NffT4yz9/2bQrJ4czztGteQvL9iAaBsG6 YYrwFeBeJSVuai8ZszOWTwXZ5V2eeIcCHUpwsyu5cpGklzHCcrpB81qmZ6NYD90fPCD6 DR8V1O2PM7H4sOqhpU1+ZbRaqjBTkCvGnt741dygYSvHbFAkoh3pMp5DDGPE3JLSxFKf Ui9CGRh2lSqGRZXYyH2c7Rb2sonGTwfs+lHdzbPUck0sg6EiQHB/efVDhtUdNXZhSErD HIlg== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=HefsESiJ7LIGsXJgDnsGBPDDa2TzZPw+LEwMBwzteos=; b=BKsTvk2XVhvim5Dc9lYsJQgsybW5pTQOSxfgdt0VrR2uxumul0GJs79+adxIEDpQH4 uLdNV5BRiCcTaQ7mHaWihArCS3hu/pVOjo25NHgATYBpcQMXkoH8Su8HvjYzNvfUS/xC PY87ptSGZQ68yzw/IxiUKk6e/O7BhiG0F7nXeO0ZlirIY17FRFaTCd49KwK/ve8y5voq t+bU+tF3dxyCNSamWuMQE5LjPAAUk956x91aJq0mC90wqXPXm8NiWP3+3HTk4YzNCRn4 2DG7Qm8k8sl/gGYTwGIbN3wQwvo67oLGLxyZFnrN93q6Jnc8zn/8VTeWWs86ZebUwqHG pURg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sd1-20020a1709076e0100b00730824744dasi1860627ejc.507.2022.08.18.14.00.45; Thu, 18 Aug 2022 14:01:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344546AbiHRUuV (ORCPT + 99 others); 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 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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