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 X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAFEFC433B4 for ; Sat, 8 May 2021 10:53:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C3C986105A for ; Sat, 8 May 2021 10:53:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230257AbhEHKyH (ORCPT ); Sat, 8 May 2021 06:54:07 -0400 Received: from mx2.suse.de ([195.135.220.15]:48114 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230326AbhEHKyF (ORCPT ); Sat, 8 May 2021 06:54:05 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A4623ADD7; Sat, 8 May 2021 10:53:02 +0000 (UTC) Date: Sat, 8 May 2021 12:53:01 +0200 From: Michal =?iso-8859-1?Q?Such=E1nek?= To: Martin KaFai Lau Cc: Nathan Chancellor , Jiri Slaby , Jiri Olsa , dwarves@vger.kernel.org, Arnaldo Carvalho de Melo , Andrii Nakryiko , bpf@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH v2 dwarves] btf: Remove ftrace filter Message-ID: <20210508105301.GD12700@kitsune.suse.cz> References: <20210506205622.3663956-1-kafai@fb.com> <20210508050321.2qrmkzq7zjpphqo7@kafai-mbp.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210508050321.2qrmkzq7zjpphqo7@kafai-mbp.dhcp.thefacebook.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Fri, May 07, 2021 at 10:03:21PM -0700, Martin KaFai Lau wrote: > On Thu, May 06, 2021 at 07:54:37PM -0700, Nathan Chancellor wrote: > > On Thu, May 06, 2021 at 01:56:22PM -0700, Martin KaFai Lau wrote: > > > BTF is currently generated for functions that are in ftrace list > > > or extern. > > > > > > A recent use case also needs BTF generated for functions included in > > > allowlist. In particular, the kernel > > > commit e78aea8b2170 ("bpf: tcp: Put some tcp cong functions in allowlist for bpf-tcp-cc") > > > allows bpf program to directly call a few tcp cc kernel functions. Those > > > kernel functions are currently allowed only if CONFIG_DYNAMIC_FTRACE > > > is set to ensure they are in the ftrace list but this kconfig dependency > > > is unnecessary. > > > > > > Those kernel functions are specified under an ELF section .BTF_ids. > > > There was an earlier attempt [0] to add another filter for the functions in > > > the .BTF_ids section. That discussion concluded that the ftrace filter > > > should be removed instead. > > > > > > This patch is to remove the ftrace filter and its related functions. > > > > > > Number of BTF FUNC with and without is_ftrace_func(): > > > My kconfig in x86: 40643 vs 46225 > > > Jiri reported on arm: 25022 vs 55812 > > > > > > [0]: https://lore.kernel.org/dwarves/20210423213728.3538141-1-kafai@fb.com/ > > > > > > Cc: Andrii Nakryiko > > > Cc: Jiri Olsa > > > Signed-off-by: Martin KaFai Lau > > > > This fixes an issue with Fedora's s390x config that CKI noticed: > > > > https://groups.google.com/g/clang-built-linux/c/IzthpckBJvc/m/MPWGDmXiAwAJ > > > > Tested-by: Nathan Chancellor # build > Thanks all for reviewing and testing. > > In my cross compile ppc64 test, it does not solve the issue. > The problem is the tcp-cc functions (e.g. "cublictcp_*") > are not STT_FUNC in ppc64, so they are not collected in collect_function(). > The ".cubictcp_*" is STT_FUNC though. > > Since only the x86 (64 and 32) bpf jit can call these tcp-cc functions now > and there is no usage for adding them to .BTF_ids for other ARCHs, > I have post a patch to limit them to x86: > https://lore.kernel.org/bpf/20210508005011.3863757-1-kafai@fb.com/ That's probably not the way to go. If function symbols start with a dot in ppc64 elfv1 abi then pahole should learn to add a dot for ppc64 elfv1 abi. Or we can build ppc64 BE using the elfv2 abi and depend on elfv2 abi for BTF on ppc64. The patch for enabling elfv2 for BE is currently under discussion and I have the patch that adds the dependency ready as well. Thanks Michal