Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2466589rwb; Mon, 15 Aug 2022 06:06:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR5B/wth3YRFjpFkLaSChO+1W05vT2ksKxu83/LhqyDL/SFiPHEwqG5BfI0ovvttcdHc7csw X-Received: by 2002:a63:85c7:0:b0:428:c1d8:36ee with SMTP id u190-20020a6385c7000000b00428c1d836eemr4956532pgd.58.1660568766461; Mon, 15 Aug 2022 06:06:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660568766; cv=none; d=google.com; s=arc-20160816; b=aH+wv6btn2PNJpdQxHtjnoAhgI82rMagXgKtzOBYt0eoTLVYXdgvNuAvqDjYiRWHub 1hVcgy13FdHXZKXrE48EnecxOPtW/luGUU4NDGOqDg+X06BnyzlD8oua/tn1c3d+CPHK 8OtkstWsPlvEaIHzuDwfkfTXO0Ous4IuTBrrao3nUU3gbQcvpQQd3h+CYqft9BH4W2nG a65dSVJLp+A+2JWFUV5m1SITuNHy+xnCC/PffSRfQeq4R0fygWpQCLFCVpufYE649Fsy XAgAjokX41wBBTuEnoiJxGWGObuczazSO2tspdWfnbNrnNJuey7pvA79wnNWDVe7kH49 vGJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=AZAXOi6uFyMoBC8VUTD1zgcVsenCR+DQMIXTIoFpT/0=; b=ICHciSMrRFJWyrzEolivTlYRHU20BT8YSV3V7Y8zxbo/CSrSIx2TjGPF9WO2py8y07 OhY+lQ48awX+IoylrT0HVp8+EdMpRikVNN/T+mXVTOYUYdx6nx3gAQImK4AGeFsm4HVT NpUR5712/g8qK3naBAsQAgL1Yhy1f8bFL85FWVDSP+vs7qj13YvSL13hbu5Yp9luSTI+ t6Pt6YhR8iOZR5SY4KJ1BM/Pg6gCJf9WNw7DHvFc1b1ipX32HggocNpIB+qOtROYDT4D l/fR72qiG7quHZDxWeS/cV/lP7IP5eRHciwhHsXZA3QRV86Rgd4Bw883QroYHP9awOAf xXMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="nWc09iP/"; 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 y25-20020a056a00181900b005107cf64e1dsi11260279pfa.212.2022.08.15.06.05.54; Mon, 15 Aug 2022 06:06:06 -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="nWc09iP/"; 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 S242144AbiHOMav (ORCPT + 99 others); Mon, 15 Aug 2022 08:30:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242442AbiHOMas (ORCPT ); Mon, 15 Aug 2022 08:30:48 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5B1B6400; Mon, 15 Aug 2022 05:30:45 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id i14so13251767ejg.6; Mon, 15 Aug 2022 05:30:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc; bh=AZAXOi6uFyMoBC8VUTD1zgcVsenCR+DQMIXTIoFpT/0=; b=nWc09iP/xVHrJlRgxfqL+6ks4L79jBKv9Qn7z3VwR1O4lCk7VgRn9ivwliirXO3Fa7 FeXwtoccQfvz6jxIYJH63frD9/ywBMF5T9nRMuvA37bJeqrSopOC2XRcCXzMojb4Hd0i vvHc/13tjp5uURE/3dGg2Uda5fEiZm9FzH/hkc+CpQ8o5b/f2xbfxillFL1w+9OpJIqo 43Wl90OGa4t9KmyeOTLBVIOlrAGoUFhW4lgrW1LbjoNMc2rFnVyEpM9NPWPB2/sndRzz +IG5gETAGKnQyaz/p8vPX6MNes6nVO44Dbmfv9H254iLjrt4twudHSiXRzZyjj/r5z7o 1G+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=AZAXOi6uFyMoBC8VUTD1zgcVsenCR+DQMIXTIoFpT/0=; b=2P37HX4wojNRfB2kRJzcsJLgY2h/uQe8oFXosIodtGGWKjS6VJW8X7Sd6pxVQvTJ9i cqZwWnPJfzSgQsDcg1PAM2C26wvevbfE6Ss+OzwIs6ZcfNiLiU6Y0E+Bd/V8281GGrD8 6oGT+XHs2qP75cWRxeMbqLiYnwT9bSa1iLLptfWYx3Q4p+xs0aZohFxDF7KAsbcSUhrR sFoAHFXDbdKzQnwF7VVJauDHOjHFu6QE3ezKncCUt8GY1/eI30EbCL6wixm5hGLmNLfb PTKRGGSIIegYPMm6zNNkHonL8wCxcFXucAgWVf3xou2g4C72LB28xOJi5fUfqSyaaJg/ IujA== X-Gm-Message-State: ACgBeo1Bo8KhmVY8aSru562vBQJ1S7aUQiYaRREMUsfDyln6koZS75WW O4mHwkWopMUTsMlFA9NJ2dDNc/1OOf4IefykT4k= X-Received: by 2002:a17:907:272a:b0:731:4699:b375 with SMTP id d10-20020a170907272a00b007314699b375mr10373781ejl.633.1660566644129; Mon, 15 Aug 2022 05:30:44 -0700 (PDT) MIME-Version: 1.0 References: <20220722122548.2db543ca@gandalf.local.home> <20220722174120.688768a3@gandalf.local.home> <20220813150252.5aa63650@rorschach.local.home> <77477710-c383-73b1-4f78-fe65a81c09b7@huawei.com> In-Reply-To: From: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= Date: Mon, 15 Aug 2022 14:30:32 +0200 Message-ID: Subject: Re: [RFC] ftrace: Add support to keep some functions out of ftrace To: Jiri Olsa Cc: Chen Zhongjin , Steven Rostedt , 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 , Peter Zijlstra Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Mon, 15 Aug 2022 at 14:19, Bj=C3=B6rn T=C3=B6pel wrot= e: > > On Mon, 15 Aug 2022 at 13:29, Jiri Olsa wrote: > > > > On Mon, Aug 15, 2022 at 01:01:06PM +0200, Bj=C3=B6rn T=C3=B6pel wrote: > > > On Mon, 15 Aug 2022 at 10:04, Jiri Olsa wrote: > > > [...] > > > > > > > > > > > > > > Today, objtool has also got involved, and added an "--mcount"= option > > > > > > > that will create the section too. > > > > > > I overlooked that objtool is involved as well, > > > > > > will check on that > > > > > > > > > > objtool --mcount option only involves mcount_loc generation (see > > > > > annotate_call_site) and other validation check call destination d= irectly > > > > > (see is_fentry_call). > > > > > > > > > > Some simply removing --mcount option dose work for this. > > > > > > > > > > > > > > > Another question, it seems we can export and use DEFINE_BPF_DISPA= TCHER out > > > > > of kernel, does that means we should add NO_MCOUNT_FILES for thes= e single > > > > > uages as well? > > > > > > > > yes, cc-ing Bj=C3=B6rn to make sure it's valid use case for dispatc= her > > > > > > > > > > Hmm, could you expand a bit on how this would work? > > > > the goal here is to remove bpf_dispatcher__func functions from > > ftrace, because it's updated by dispatcher code with bpf_arch_text_poke= , > > but it's also visible and attachable to ftrace.. and will cause problem= s > > when these 2 updates will race > > > > question was if DEFINE_BPF_DISPATCHER can be used in kernel module, > > which would bring another realm of problems ;-) > > > > Oh, now I follow. AFAIK there is only one flavor of BPF dispatcher in > use, and that's the XDP dispatcher, which does not reside in module > code, but is typically *called* by module code. > Some history why the EXPORT is required: https://lore.kernel.org/bpf/CAADnVQ+eD-=3DFZrg8L+YcdCyAS+E30W=3DZ-ShtEXAXVF= jmxV4usg@mail.gmail.com/