Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp915728rwb; Thu, 18 Aug 2022 14:51:15 -0700 (PDT) X-Google-Smtp-Source: AA6agR7SqoJ3dt4Iui16XbYteA5cbUBMj62SaUFL7Wvnj7seuU5aI7TkG4QxWTz9vH/DgRkrBD8Y X-Received: by 2002:a17:906:98d6:b0:73c:7d42:292a with SMTP id zd22-20020a17090698d600b0073c7d42292amr1176953ejb.567.1660859475176; Thu, 18 Aug 2022 14:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660859475; cv=none; d=google.com; s=arc-20160816; b=d7HqpjLrZxBwmX045ZPnX4wI6zevfLqMHR+erR8SQqKcYEb3ClW0juGLztbE4wpNVc qlts9gspjrOYTeE0NnRNv2jMC8llF8Qa+5kkL7hAOgPuD3fllcHW9gXsa7WlKXbdg4U6 pO0frj2zRo5aUs2ZBMldt0gksQmVW4H8ZHI0yCWy0M2OfrwAdoB30timBlZD4zcP13rj dis9juz+uD3HcIguctgsxPXecJEa4xHAjTZZ77sm3nkghep3FUxxdU4l/ZqqOFNxlz7M 02AN7+KbG6GwwwMKpDBOSVnn+KjkZ9mZLQHMK75NXTOZ/8ov5FbKNZmAJWtmQa3GKNSC Pv2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:dkim-signature; bh=urJ4x4daK3qEX9oZLw5VGbCPYDe2Pbjud3LODXMY5SI=; b=HHeoiyV9B3iHsyyzZ1gMH4PSXeG0m0BMMAyx94XNYKouKtbcT5RA9kgQOtUiy1jMKs 7jKkV6W0vcKK3y2udJverVAPvr/uCVXABA49L2cpb3HMiIAtdqeKJ7zpszL+kBL3qYCT ZejBoGRYX3q6+J23sZc1OK93QSa8lNS2cP77aT8+oyY48JyKCUsOFPEX8KrwH2AGMnGL 1mG2WfBSTfIjEwQZyyPn/CPQYaRN4YLS7O/kR1/l66uyg4UfbjOva5hSJ7opAd80iZ48 UXIurbtv9xCQ8ER0lh4wqrsbIGUXnRno+mJbM8Di4p3WbVLnmTdH2l9cMpyuBSP/H+U9 7DfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MRXUnPkx; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds1-20020a170907724100b0072af6ec8081si1905218ejc.651.2022.08.18.14.50.49; Thu, 18 Aug 2022 14:51:15 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MRXUnPkx; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347064AbiHRVXB (ORCPT + 99 others); Thu, 18 Aug 2022 17:23:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346856AbiHRVWn (ORCPT ); Thu, 18 Aug 2022 17:22:43 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49998DDA98; Thu, 18 Aug 2022 14:15:52 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id b16so3411173edd.4; Thu, 18 Aug 2022 14:15:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc; bh=urJ4x4daK3qEX9oZLw5VGbCPYDe2Pbjud3LODXMY5SI=; b=MRXUnPkxgf54nxSOsWezWiISbU/cpg5JJ1xBtg4OeUeCbDBzOpvRdl7K1+aZSMaPTl b5B5NYHcQ31pwH0+64T3jgim2hyrGw+PXzwz3I8Z8JwZObRLgnjj0bcyrqigI4WvLkZt i1PxthtGyCrvyaQMQ4InhNghYV4BcfhDniwaqp1R6sr2uq1ES7MSlmcZeEuX8uroDy37 UMVA8Dw3Qj5I2KKo/zlMm8Y4eBqK4xHpAH0lADBlzEHbqRDVxm4N8s0nV55aVyObxjF0 +vX9Dej0AgZm9X5odtb2Jnucwt9f6PFwCjAT5VryMlaC61gMt7INwKVMqtXpRyVBGA/0 agzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc; bh=urJ4x4daK3qEX9oZLw5VGbCPYDe2Pbjud3LODXMY5SI=; b=yjGzG4AAufcIQE98Ng+HmKgzoA6JwkvXlB7IGZvGRgH1njZn2IuiYY6PTnicYSPjJ5 Y+4to0aJMzNT0qWQUT8xvLKBG9NNBz/aIBxW4gNZuuMMGl6hL614qTjzODgcU8AUW4jK FboitFVbsofyrhxEuwhipyPMMY935U5QWK81+Ogw03RWJXQUn/mqKWZsZkIG9QQAlciV 7FAUaPEdegEkMss0JHUBRwDu4e7xFKGYwyVtsIS1w0PvuLMSWpMEuu8dZJOfX7XPmHm9 CLwh1PtJKZ+GrYv8SDs6o8ZYn4clssXHFdlK8ihymBQLBYCzQWUzhfuE2QFOKNvMfpvn KgpQ== X-Gm-Message-State: ACgBeo0sdO0ct42Y+5J1nT7fvk2tNHRoyGpGAvHxyaKFVQ4DCi4HX1Xc byDqpxEMh5c0/4t13cB+atk= X-Received: by 2002:a05:6402:190e:b0:43e:1588:4c32 with SMTP id e14-20020a056402190e00b0043e15884c32mr3623547edz.76.1660857274874; Thu, 18 Aug 2022 14:14:34 -0700 (PDT) Received: from krava ([83.240.63.36]) by smtp.gmail.com with ESMTPSA id p21-20020a170906141500b00730a234b863sm1329344ejc.77.2022.08.18.14.14.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 14:14:34 -0700 (PDT) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Thu, 18 Aug 2022 23:14:32 +0200 To: Steven Rostedt Cc: Jiri Olsa , 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: References: <20220818165024.433f56fd@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220818165024.433f56fd@gandalf.local.home> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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, Aug 18, 2022 at 04:50:24PM -0400, Steven Rostedt wrote: > 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 \ > ... > is there a reason to keep NON_MCOUNT_PATCHABLE section for x86? otherwise LGTM jirka