Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2523714pxb; Fri, 5 Feb 2021 22:56:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwV9nYQqn+OVfYAOPNuEEOfhX7WCIolssHjGopODpidY8DPFxVM4dtoK7PWOUG0zf1676pc X-Received: by 2002:aa7:c804:: with SMTP id a4mr6391923edt.168.1612594587872; Fri, 05 Feb 2021 22:56:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612594587; cv=none; d=google.com; s=arc-20160816; b=XPAXgkNilbK+KFzXr5X88lV3srhngcIB1OrY7ZlrzZF5dIsJBn/hKw+RnvBPguNGer FhCGFZJRRvg9QoAkrdxLy5xkHm5vpX/qiNBHikLqYrqAUYsRijYVMI/MbxbMiRYmR1vF mDN0OpoOIz42wzH+W3l51hvjBKJOWQkUFVu4q9HWRAE6onntsmTNIPHLVRZcpBJ+lLW7 5i5A+VG4zOYh8kl4PkRSOWhZk8B7EAsxyS9wfXzfNJnVT9y+sfYYEnVh3cDnULTX4Cf8 r9DucUFFEgV8p1gLdthLa2ogEAV5CqOu4QmLL8Fkdu+ehsh9+KEKIvCtUlW2Wmyn7Wsv t2hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:reply-to :in-reply-to:references:mime-version:dkim-signature; bh=r4icrxi9raT1zE/PwdLZk8O5fKNkw262lBrx+yPfPaI=; b=z4d17BVlHHILmaQHZH36qpOFtHHyxN23C0OpzUqM6gpf8A2R5TypmRvs/gbGEQsrgW WQJEO+EGtAbGuCKE2icr4c7s0H8+TTK0jPAdI+0mwV99G9KqUBDL4rQayAAriRk8qQ1V m82lKU67xj3MRXoVg2EoThC6E27OVa4c29FCKQm+/2bQd2mYqYXmrWL2t3rFbqPu2Zpk zRsGprXfb1gV83w9kIWNblGs4qhcYu/xYUe93uV+Yz66+h5P0HXW1LtfsJcwBVkzpA7Y Z/veB7P3fpf5TaLeBojBgadY451svWj5r/xFLdgSdVmeacJsm/nYmCQtO0lqFSjShg3V AVIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ey6vNeco; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ho34si1511651ejc.343.2021.02.05.22.55.40; Fri, 05 Feb 2021 22:56:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ey6vNeco; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S229539AbhBFGxn (ORCPT + 99 others); Sat, 6 Feb 2021 01:53:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbhBFGxm (ORCPT ); Sat, 6 Feb 2021 01:53:42 -0500 Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08A37C06174A; Fri, 5 Feb 2021 22:53:01 -0800 (PST) Received: by mail-il1-x12d.google.com with SMTP id y15so7932791ilj.11; Fri, 05 Feb 2021 22:53:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=r4icrxi9raT1zE/PwdLZk8O5fKNkw262lBrx+yPfPaI=; b=ey6vNecoVmrlvxuQ7PCWmq8I0MP5+Q3O2ShT5Z9wM/0E+dsiFkbcPGBDOuAknN/8Nz vhSzmKfhy6PXIE92o/ft7dt/IB6ZHCJgz0pAUdadpK6rCjKnW9lh9E31v9eTds5jE6UB TJedhLb6etSlf8juHnijE0cMCcSK34EVRaQeM/A+p5ke/ohKhoyON2MLzuZ8KYrJOjyZ QuVHK1i7+0EZ7QxJZWhwOFryl0TxgJgsADJWItPGipvnOVCpfcXvyDYYZpMwx3/0gmCp +logoF6qt9VfseIuFlAXpqvRDK/lKUv3MLi3P0qmpmuHe7tWMlD8VD+HmzpsEd8FzFiw Ov6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=r4icrxi9raT1zE/PwdLZk8O5fKNkw262lBrx+yPfPaI=; b=fhUqjLllT9NHyJ9b4DMe9nYPcMUfuRfqvcrgd3jbHoi73oabjwfEJYA24KgJmnfW9s kBYeE5QszrbUUEiMdjuQuOC+r6ND77dC3hHc8jnw5qbZ7jNLXUcObv5yTMRr3y7sNFf7 RbEOn8xPSy3muJZnHF3ocbAPCzppxHfuEiN+4bdP8hzuWZag5OhqMQz1tj6y9qF45+qr lTSqJFy4Nxl+b0tN1RXCUq+ZGe91PeBc+W+d+iM3k6OK41OEC36oH2Bqv18prwnpDYP3 dw609FiJ9oYJjodFNlNqevSXxZVrX40FUaKpFM3XqhXAetTCwxtqB4jBM1dpuKLeLu2U WScQ== X-Gm-Message-State: AOAM531ck8cH1piCVK0vZjqUZQzFWvmGMVbao7eJQ9aVm9lWgs3CMKV7 x9NVDYnD1WCCCNymTiL9w+h+KEls1M2lLjbqGtymdI36gZLefX+G X-Received: by 2002:a92:c5c8:: with SMTP id s8mr7007524ilt.186.1612594381095; Fri, 05 Feb 2021 22:53:01 -0800 (PST) MIME-Version: 1.0 References: <20210204220741.GA920417@kernel.org> <20210205152823.GD920417@kernel.org> <20210205192446.GH920417@kernel.org> In-Reply-To: Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Sat, 6 Feb 2021 07:52:49 +0100 Message-ID: Subject: Re: ERROR: INT DW_ATE_unsigned_1 Error emitting BTF type To: Yonghong Song , Masahiro Yamada Cc: Arnaldo Carvalho de Melo , Arnaldo Carvalho de Melo , dwarves@vger.kernel.org, Linux Kernel Mailing List , bpf@vger.kernel.org, Jiri Olsa , Jan Engelhardt , Domenico Andreoli , Matthias Schwarzott , Andrii Nakryiko , Mark Wieelard , Paul Moore , Ondrej Mosnacek , =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= , Tom Stellard Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 6, 2021 at 7:26 AM Sedat Dilek wrote: > > On Sat, Feb 6, 2021 at 6:53 AM Sedat Dilek wrote: > > > > On Sat, Feb 6, 2021 at 6:44 AM Sedat Dilek wrote: > > > > > > On Sat, Feb 6, 2021 at 4:34 AM Sedat Dilek wrote: > > > > > > > > On Fri, Feb 5, 2021 at 10:54 PM Yonghong Song wrote: > > > > > > > > > > > > > > > > > > > > On 2/5/21 12:31 PM, Sedat Dilek wrote: > > > > > > On Fri, Feb 5, 2021 at 9:03 PM Yonghong Song wrote: > > > > > >> > > > > > >> > > > > > >> > > > > > >> On 2/5/21 11:24 AM, Arnaldo Carvalho de Melo wrote: > > > > > >>> Em Fri, Feb 05, 2021 at 11:10:08AM -0800, Yonghong Song escreveu: > > > > > >>>> On 2/5/21 11:06 AM, Sedat Dilek wrote: > > > > > >>>>> On Fri, Feb 5, 2021 at 7:53 PM Sedat Dilek wrote: > > > > > >>>>> Grepping through linux.git/tools I guess some BTF tools/libs need to > > > > > >>>>> know what BTF_INT_UNSIGNED is? > > > > > >>> > > > > > >>>> BTF_INT_UNSIGNED needs kernel support. Maybe to teach pahole to > > > > > >>>> ignore this for now until kernel infrastructure is ready. > > > > > >>> > > > > > >>> Yeah, I thought about doing that. > > > > > >>> > > > > > >>>> Not sure whether this information will be useful or not > > > > > >>>> for BTF. This needs to be discussed separately. > > > > > >>> > > > > > >>> Maybe search for the rationale for its introduction in DWARF. > > > > > >> > > > > > >> In LLVM, we have: > > > > > >> uint8_t BTFEncoding; > > > > > >> switch (Encoding) { > > > > > >> case dwarf::DW_ATE_boolean: > > > > > >> BTFEncoding = BTF::INT_BOOL; > > > > > >> break; > > > > > >> case dwarf::DW_ATE_signed: > > > > > >> case dwarf::DW_ATE_signed_char: > > > > > >> BTFEncoding = BTF::INT_SIGNED; > > > > > >> break; > > > > > >> case dwarf::DW_ATE_unsigned: > > > > > >> case dwarf::DW_ATE_unsigned_char: > > > > > >> BTFEncoding = 0; > > > > > >> break; > > > > > >> > > > > > >> I think DW_ATE_unsigned can be ignored in pahole since > > > > > >> the default encoding = 0. A simple comment is enough. > > > > > >> > > > > > > > > > > > > Yonghong Son, do you have a patch/diff for me? > > > > > > > > > > Looking at error message from log: > > > > > > > > > > LLVM_OBJCOPY=/opt/binutils/bin/objcopy /opt/pahole/bin/pahole -J > > > > > .tmp_vmlinux.btf > > > > > [115] INT DW_ATE_unsigned_1 Error emitting BTF type > > > > > Encountered error while encoding BTF. > > > > > > > > > > Not exactly what is the root cause. Maybe bt->bit_size is not > > > > > encoded correctly. Could you put vmlinux (in the above it is > > > > > .tmp_vmlinux.btf) somewhere, I or somebody else can investigate > > > > > and provide a proper fix. > > > > > > > > > > > > > [ TO: Masahiro ] > > > > > > > > Thanks for taking care Yonghong - hope this is your first name, if not > > > > I am sorry. > > > > In case of mixing my first and last name you will make me female - > > > > Dilek is a Turkish female first name :-). > > > > So, in some cultures you need to be careful. > > > > > > > > Anyway... back to business and facts. > > > > > > > > Out of frustration I killed my last build via `make distclean`. > > > > The whole day I tested diverse combination of GCC-10 and LLVM-12 > > > > together with BTF Kconfigs, selfmade pahole, etc. > > > > > > > > I will do ne run with some little changes: > > > > > > > > #1: Pass LLVM_IAS=1 to make (means use Clang's Integrated ASsembler - > > > > as per Nick this leads to the same error - should be unrelated) > > > > #2: I did: DEBUG_INFO_COMPRESSED y -> n > > > > > > > > #2 I did in case you need vmlinux and I have to upload - I will > > > > compress the resulting vmlinux with ZSTD. > > > > You need vmlinux or .tmp_vmlinux.btf file? > > > > Nick was not allowed from his company to download from a Dropbox link. > > > > So, as an alternative I can offer GoogleDrive... > > > > ...or bomb into your INBOX :-). > > > > > > > > Now, why I CCed Masahiro: > > > > > > > > In case of ERRORs when running `scripts/link-vmlinux.sh` above files > > > > will be removed. > > > > > > > > Last, I found a hack to bypass this - means to keep these files (I > > > > need to check old emails). > > > > > > > > Masahiro, you see a possibility to have a way to keep these files in > > > > case of ERRORs without doing hackery? > > > > > > > > From a previous post in this thread: > > > > > > > > + info BTF .btf.vmlinux.bin.o > > > > + [ != silent_ ] > > > > + printf %-7s %s\n BTF .btf.vmlinux.bin.o > > > > BTF .btf.vmlinux.bin.o > > > > + LLVM_OBJCOPY=llvm-objcopy /opt/pahole/bin/pahole -J .tmp_vmlinux.btf > > > > [2] INT long unsigned int Error emitting BTF type > > > > Encountered error while encoding BTF. > > > > + llvm-objcopy --only-section=.BTF --set-section-flags > > > > .BTF=alloc,readonly --strip-all .tmp_vmlinux.btf .btf.vmlinux.bin.o > > > > ... > > > > + info BTFIDS vmlinux > > > > + [ != silent_ ] > > > > + printf %-7s %s\n BTFIDS vmlinux > > > > BTFIDS vmlinux > > > > + ./tools/bpf/resolve_btfids/resolve_btfids vmlinux > > > > FAILED: load BTF from vmlinux: Invalid argument > > > > + on_exit > > > > + [ 255 -ne 0 ] > > > > + cleanup > > > > + rm -f .btf.vmlinux.bin.o > > > > + rm -f .tmp_System.map > > > > + rm -f .tmp_vmlinux.btf .tmp_vmlinux.kallsyms1 > > > > .tmp_vmlinux.kallsyms1.S .tmp_vmlinux.kallsyms1.o > > > > .tmp_vmlinux.kallsyms2 .tmp_vmlinux.kallsyms2.S .tmp_vmlinux.kallsyms > > > > 2.o > > > > + rm -f System.map > > > > + rm -f vmlinux > > > > + rm -f vmlinux.o > > > > make[3]: *** [Makefile:1166: vmlinux] Error 255 > > > > > > > > ^^^ Look here. > > > > > > > > > > With this diff: > > > > > > $ git diff scripts/link-vmlinux.sh > > > diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh > > > index eef40fa9485d..40f1b6aae553 100755 > > > --- a/scripts/link-vmlinux.sh > > > +++ b/scripts/link-vmlinux.sh > > > @@ -330,7 +330,7 @@ vmlinux_link vmlinux "${kallsymso}" ${btf_vmlinux_bin_o} > > > # fill in BTF IDs > > > if [ -n "${CONFIG_DEBUG_INFO_BTF}" -a -n "${CONFIG_BPF}" ]; then > > > info BTFIDS vmlinux > > > - ${RESOLVE_BTFIDS} vmlinux > > > + ##${RESOLVE_BTFIDS} vmlinux > > > fi > > > > > > if [ -n "${CONFIG_BUILDTIME_TABLE_SORT}" ]; then > > > > > > This files are kept - not removed: > > > > > > $ LC_ALL=C ll .*btf* vmlinux vmlinux.o > > > -rwxr-xr-x 1 dileks dileks 31M Feb 6 06:37 .btf.vmlinux.bin.o > > > -rwxr-xr-x 1 dileks dileks 348M Feb 6 06:37 .tmp_vmlinux.btf > > > -rwxr-xr-x 1 dileks dileks 348M Feb 6 06:37 vmlinux > > > -rw-r--r-- 1 dileks dileks 344M Feb 6 06:37 vmlinux.o > > > > > > Pleas let me know where to upload - Dropbox or GoogleDrive or > > > elsewhere and give me a link. > > > > > > > > > WOW, ZSTD is great :-). > > > > $ zstd -19 -T0 -v vmlinux > > *** zstd command line interface 64-bits v1.4.8, by Yann Collet *** > > Note: 2 physical core(s) detected > > vmlinux : 22.71% (364466016 => 82784801 bytes, vmlinux.zst) > > > > $ du -m vmlinux* > > 348 vmlinux > > 79 vmlinux.zst > > > > Dropbox link: > https://www.dropbox.com/sh/kvyh8ps7na0r1h5/AABfyNfDZ2bESse_bo4h05fFa?dl=0 > > I hope this is public available. > Inspecting vmlinux with llvm-dwarf: $ /opt/llvm-toolchain/bin/llvm-dwarfdump vmlinux | grep DW_AT_name | grep DW_ATE_ | sort | uniq DW_AT_name ("DW_ATE_signed_1") DW_AT_name ("DW_ATE_signed_16") DW_AT_name ("DW_ATE_signed_32") DW_AT_name ("DW_ATE_signed_64") DW_AT_name ("DW_ATE_signed_8") DW_AT_name ("DW_ATE_unsigned_1") DW_AT_name ("DW_ATE_unsigned_128") DW_AT_name ("DW_ATE_unsigned_16") DW_AT_name ("DW_ATE_unsigned_24") DW_AT_name ("DW_ATE_unsigned_32") DW_AT_name ("DW_ATE_unsigned_40") DW_AT_name ("DW_ATE_unsigned_64") DW_AT_name ("DW_ATE_unsigned_8") - Sedat -