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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED 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 0EE8FC282CB for ; Tue, 5 Feb 2019 16:04:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CFED92080F for ; Tue, 5 Feb 2019 16:04:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730232AbfBEQEm (ORCPT ); Tue, 5 Feb 2019 11:04:42 -0500 Received: from www62.your-server.de ([213.133.104.62]:53112 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727250AbfBEQEl (ORCPT ); Tue, 5 Feb 2019 11:04:41 -0500 Received: from [78.46.172.3] (helo=sslproxy06.your-server.de) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1gr3DC-0007KU-U1; Tue, 05 Feb 2019 17:04:39 +0100 Received: from [178.197.249.40] (helo=linux.home) by sslproxy06.your-server.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1gr3DC-000Sex-NM; Tue, 05 Feb 2019 17:04:38 +0100 Subject: Re: [PATCH btf v2 0/3] Add BTF types deduplication algorithm To: Andrii Nakryiko , netdev@vger.kernel.org, ast@fb.com, yhs@fb.com, acme@kernel.org, kernel-team@fb.com, kafai@fb.com, ecree@solarflare.com, andrii.nakryiko@gmail.com References: <20190205012946.1590917-1-andriin@fb.com> From: Daniel Borkmann Message-ID: <82763374-5db5-b104-9aba-e88447f688df@iogearbox.net> Date: Tue, 5 Feb 2019 17:04:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20190205012946.1590917-1-andriin@fb.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.100.2/25351/Tue Feb 5 11:35:19 2019) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 02/05/2019 02:29 AM, Andrii Nakryiko wrote: > This patch series adds BTF deduplication algorithm to libbpf. This algorithm > allows to take BTF type information containing duplicate per-compilation unit > information and reduce it to equivalent set of BTF types with no duplication without > loss of information. It also deduplicates strings and removes those strings that > are not referenced from any BTF type (and line information in .BTF.ext section, > if any). > > Algorithm also resolves struct/union forward declarations into concrete BTF types > across multiple compilation units to facilitate better deduplication ratio. If > undesired, this resolution can be disabled through specifying corresponding options. > > When applied to BTF data emitted by pahole's DWARF->BTF converter, it reduces > the overall size of .BTF section by about 65x, from about 112MB to 1.75MB, leaving > only 29247 out of initial 3073497 BTF type descriptors. > > Algorithm with minor differences and preliminary results before FUNC/FUNC_PROTO > support is also described more verbosely at: > https://facebookmicrosites.github.io/bpf/blog/2018/11/14/btf-enhancement.html > > v1->v2: > - rebase on latest bpf-next > - err_log/elog -> pr_debug > - btf__dedup, btf__get_strings, btf__get_nr_types listed under 0.0.2 version > > Andrii Nakryiko (3): > btf: extract BTF type size calculation > btf: add BTF types deduplication algorithm > selftests/btf: add initial BTF dedup tests > > tools/lib/bpf/btf.c | 1851 +++++++++++++++++++++++- > tools/lib/bpf/btf.h | 10 + > tools/lib/bpf/libbpf.map | 3 + > tools/testing/selftests/bpf/test_btf.c | 535 ++++++- > 4 files changed, 2332 insertions(+), 67 deletions(-) Applied, thanks!