Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp927618rwb; Thu, 18 Aug 2022 15:05:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR7R8TLkMY6RxRJicoO64C9CnW0arAOivniO5tml269bKsRT/ov9Dy0jYxt48j+DKOQCTC5X X-Received: by 2002:a17:90a:bb18:b0:1f2:f715:60bc with SMTP id u24-20020a17090abb1800b001f2f71560bcmr10824841pjr.215.1660860353175; Thu, 18 Aug 2022 15:05:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660860353; cv=none; d=google.com; s=arc-20160816; b=eT7A28Oco/0abT60/k0PVU0StrZ/1a8zQOJ60vU3z5MxkPK5O5V3nryHrCSnpFUiL5 12K7eGB/Ysl07H79SUC0vUKvhyakoaAIHMnB2D7HTKAhZGyVdh67S5Nnx/FNt0nM+16p cSqR+o4Z99S5saZKD+Oc8XdSKll+dH1Pl3JSjGsysuPP8GzRQf4j3vl802fzi3Y0pMe1 wkn1+4uXANYoJca1xdqB1GkfW7mqiDFFCkIynHZkkx7ontUI5KXRB488q/kjYg9XHkL1 BA1wgk411ZBUFGlY7sU0/CBj9BpEb+UM5Xq4krhSgNAOfozPjMB482/b7d+TdhvazcRi j/yw== 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=CiTL5HnekfjqUpmditrs+w9/F0W/1X/M0uXhus6DyhE=; b=0l47JWKkNJYS8sxjH3Ag+YYt9w/+eszwycdUXSQH6t42Jf1IjUBFX1suoshET+eOEC FGWupwQCSlmCzI1cpJTRwuKmT5sFjZdsv7oc0XeKsKAMHnnpu7pNrw+AcmWEAJX6fhzs 870zZQgwUFbxdm8oWsrLWTQifRB3H7LwlSqvrqYvY2TlClqwRV69yqEURy5MThQcYy1e pYZd1niSa/3TUnJ1x/s8JzxetQbssj7aTCcjr6vjchTMW3exEDMVcJOna7kpLYBC+DZB IjYs0m1EzyWOVlkBEbAEhmfGoD9gcNF4so2gLw3QBM0zFuifw8ksrglwmef19HjFexlf YpLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EuWsiuCk; 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 l11-20020a170902f68b00b00170c27cceb5si2280856plg.620.2022.08.18.15.05.41; Thu, 18 Aug 2022 15:05:53 -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=EuWsiuCk; 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 S1345723AbiHRVdF (ORCPT + 99 others); Thu, 18 Aug 2022 17:33:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232083AbiHRVdA (ORCPT ); Thu, 18 Aug 2022 17:33:00 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 754D41144; Thu, 18 Aug 2022 14:32:59 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id x21so3461826edd.3; Thu, 18 Aug 2022 14:32:59 -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=CiTL5HnekfjqUpmditrs+w9/F0W/1X/M0uXhus6DyhE=; b=EuWsiuCkZPpxHdW4bfvh26ZwaSPeY1B3LLlrCFCWUefmWz2549EmYh8qHUU/MdnOwm 1WeLbk3FDKznDxP3hPxTuuHbSefbKPM8V74qIzNe+zX8gvrN3c9xZFtS4RMYgHMouc4h 7y+Th11v8ztk2/yWTl9rSCQ5WimMFkpWj400xUziuREPZaykKVu9scjZjwkS5sj6dFZF DIBwmfvJRvI+SSI0hjWwPo95pu5w1prwmRpMPOM04mWIEg9xL/UXuKLUdY8dc7jrTlQA qjQ2i1cyDQN53TNThaRAOId7mXsQVMrKZKnqrb8eI3vzQMnoMxLd71CLdS1HvlIGMWBB 2kcg== 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=CiTL5HnekfjqUpmditrs+w9/F0W/1X/M0uXhus6DyhE=; b=t7tPlkSxSx291jY0FthwzwatfzgYK//QNdWfivybtYNYiBB6wlZuV2V6QMDm6Qgw3K KgbaHqW5cfeMYGZ7Vm+GVAxkEBlv3Mq+JLnXuEFWNRCwUDVNrmhhwgOW2g1wHelE4ndb sFqV1QYY2bddoeCtrBtX4zH529F67m9CtfGG14Mn5I7Y0jKxXonFrdbg0Qpe9idmi7RS vhxnc0maPCMd1vxeNasflP+EdvmbD2AOa18WvR/84XzNRuocOjZiaqZVT4wWKovu37hA ALDwwc9qZuavNJkaplShWFweQC3MbZHLGGrmJztYJhawquMwfjWn3HjThpCprCylHjQQ 9ZOQ== X-Gm-Message-State: ACgBeo3xDyEUEKCLyc1Dm94fRCsZ9dSDWed5OvskWpKoSL0XIJW3ZVpo IsyNrZeB26/CzvKUSTwimxWtIxSHtrlZzA== X-Received: by 2002:a05:6402:25c6:b0:43b:7797:d953 with SMTP id x6-20020a05640225c600b0043b7797d953mr3705988edb.254.1660858378054; Thu, 18 Aug 2022 14:32:58 -0700 (PDT) Received: from krava ([83.240.63.36]) by smtp.gmail.com with ESMTPSA id b2-20020a17090636c200b006fee7b5dff2sm1364138ejc.143.2022.08.18.14.32.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 14:32:57 -0700 (PDT) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Thu, 18 Aug 2022 23:32:55 +0200 To: Alexei Starovoitov Cc: Steven Rostedt , Jiri Olsa , Peter Zijlstra , 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: 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 02:00:21PM -0700, Alexei Starovoitov wrote: > On Thu, Aug 18, 2022 at 1:50 PM 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 \ > > ... > > > > ?? > > That's what more or less Peter's patch is doing: > Here it is again for reference: > https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?id=8d075bdf11193f1d276bf19fa56b4b8dfe24df9e ah nice, and discards the __patchable_function_entries section, great jirka