All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Martin KaFai Lau <kafai@fb.com>
Cc: netdev@vger.kernel.org, Alexei Starovoitov <ast@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	kernel-team@fb.com, Wang Nan <wangnan0@huawei.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH bpf-next v5 00/10] BTF: BPF Type Format
Date: Tue, 12 Jun 2018 17:31:24 -0300	[thread overview]
Message-ID: <20180612203124.GB22039@kernel.org> (raw)
In-Reply-To: <20180607200701.bvsjzoq56rnggwfd@kafai-mbp>

Em Thu, Jun 07, 2018 at 01:07:01PM -0700, Martin KaFai Lau escreveu:
> On Thu, Jun 07, 2018 at 04:30:29PM -0300, Arnaldo Carvalho de Melo wrote:
> > So this must be available in a newer llvm version? Which one?

> I should have put in the details in my last email or
> in the commit message, my bad.
 
> 1. The tools/testing/selftests/bpf/Makefile has the CLANG_FLAGS and
>    LLC_FLAGS needed to compile the bpf prog.  It requires a new
>    "-mattr=dwarf" llc option which was added to the future
>    llvm 7.0.
 
>    Hence, I have been using the llvm's master in github which
>    also has the llvm-objcopy.
 
> 2. The kernel's btf part only focus on the BPF map.
>    Hence, the testing bpf program should have the map's key
>    and map's value.  e.g. tools/testing/selftests/bpf/test_btf_haskv.c

So, with llvm and clang HEAD I get:

[root@jouet bpf]# pahole -J hello.o
[root@jouet bpf]# file hello.o
hello.o: ELF 64-bit LSB relocatable, *unknown arch 0xf7* version 1 (SYSV), with debug_info, not stripped
[root@jouet bpf]# llvm-readelf -s hello.o
There are 26 section headers, starting at offset 0xe30:

Section Headers:
  [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            0000000000000000 000000 000000 00      0   0  0
  [ 1] .text             PROGBITS        0000000000000000 000040 000000 00  AX  0   0  4
  [ 2] syscalls:sys_enter_openat PROGBITS 0000000000000000 000040 000088 00  AX  0   0  8
  [ 3] license           PROGBITS        0000000000000000 0000c8 000004 00  WA  0   0  1
  [ 4] version           PROGBITS        0000000000000000 0000cc 000004 00  WA  0   0  4
  [ 5] maps              PROGBITS        0000000000000000 0000d0 000010 00  WA  0   0  4
  [ 6] .rodata.str1.1    PROGBITS        0000000000000000 0000e0 00000e 01 AMS  0   0  1
  [ 7] .debug_str        PROGBITS        0000000000000000 0000ee 00010e 01  MS  0   0  1
  [ 8] .debug_loc        PROGBITS        0000000000000000 0001fc 000023 00      0   0  1
  [ 9] .debug_abbrev     PROGBITS        0000000000000000 00021f 0000e3 00      0   0  1
  [10] .debug_info       PROGBITS        0000000000000000 000302 00015e 00      0   0  1
  [11] .debug_ranges     PROGBITS        0000000000000000 000460 000030 00      0   0  1
  [12] .debug_macinfo    PROGBITS        0000000000000000 000490 000001 00      0   0  1
  [13] .debug_pubnames   PROGBITS        0000000000000000 000491 00006e 00      0   0  1
  [14] .debug_pubtypes   PROGBITS        0000000000000000 0004ff 00005a 00      0   0  1
  [15] .debug_frame      PROGBITS        0000000000000000 000560 000028 00      0   0  8
  [16] .debug_line       PROGBITS        0000000000000000 000588 00006e 00      0   0  1
  [17] .symtab           SYMTAB          0000000000000000 0005f8 000318 18     24  29  8
  [18] .relsyscalls:sys_enter_openat REL 0000000000000000 000910 000010 10     17   2  8
  [19] .rel.debug_info   REL             0000000000000000 000920 0001e0 10     17  10  8
  [20] .rel.debug_pubnames REL           0000000000000000 000b00 000010 10     17  13  8
  [21] .rel.debug_pubtypes REL           0000000000000000 000b10 000010 10     17  14  8
  [22] .rel.debug_frame  REL             0000000000000000 000b20 000020 10     17  15  8
  [23] .rel.debug_line   REL             0000000000000000 000b40 000010 10     17  16  8
  [24] .strtab           STRTAB          0000000000000000 000b50 00018e 00      0   0  1
  [25] .BTF              PROGBITS        0000000000000000 000cde 00014e 00      0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), l (large)
  I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
  O (extra OS processing required) o (OS specific), p (processor specific)
[root@jouet bpf]# 
[root@jouet bpf]# pahole hello.o
struct clang version 5.0.1 (tags/RELEASE_501/final) {
	clang version 5.0.1 (tags/RELEASE_501/final) clang version 5.0.1 (tags/RELEASE_501/final); /*     0     4 */
	clang version 5.0.1 (tags/RELEASE_501/final) clang version 5.0.1 (tags/RELEASE_501/final); /*     4     4 */
	clang version 5.0.1 (tags/RELEASE_501/final) clang version 5.0.1 (tags/RELEASE_501/final); /*     8     4 */
	clang version 5.0.1 (tags/RELEASE_501/final) clang version 5.0.1 (tags/RELEASE_501/final); /*    12     4 */

	/* size: 16, cachelines: 1, members: 4 */
	/* last cacheline: 16 bytes */
};
[root@jouet bpf]# 


Ok, I guess I saw this case in the llvm/clang git logs, so this one was
generated with the older clang, will regenerate and add that "-mattr=dwarf"
part.

- Arnaldo

  parent reply	other threads:[~2018-06-12 20:31 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-18 22:55 [PATCH bpf-next v5 00/10] BTF: BPF Type Format Martin KaFai Lau
2018-04-18 22:55 ` [PATCH bpf-next v5 01/10] bpf: btf: Introduce BPF Type Format (BTF) Martin KaFai Lau
2018-04-18 22:55 ` [PATCH bpf-next v5 02/10] bpf: btf: Validate type reference Martin KaFai Lau
2018-04-18 22:55 ` [PATCH bpf-next v5 03/10] bpf: btf: Check members of struct/union Martin KaFai Lau
2018-04-18 22:56 ` [PATCH bpf-next v5 04/10] bpf: btf: Add pretty print capability for data with BTF type info Martin KaFai Lau
2018-04-18 22:56 ` [PATCH bpf-next v5 05/10] bpf: btf: Add BPF_BTF_LOAD command Martin KaFai Lau
2018-04-18 22:56 ` [PATCH bpf-next v5 06/10] bpf: btf: Add BPF_OBJ_GET_INFO_BY_FD support to BTF fd Martin KaFai Lau
2018-04-18 22:56 ` [PATCH bpf-next v5 07/10] bpf: btf: Add pretty print support to the basic arraymap Martin KaFai Lau
2018-04-18 22:56 ` [PATCH bpf-next v5 08/10] bpf: btf: Sync bpf.h and btf.h to tools/ Martin KaFai Lau
2018-04-18 22:56 ` [PATCH bpf-next v5 09/10] bpf: btf: Add BTF support to libbpf Martin KaFai Lau
2018-05-09 22:17   ` libbpf backward compatibility (was: [PATCH bpf-next v5 09/10] bpf: btf: Add BTF support to libbpf) Jakub Kicinski
2018-05-09 22:20     ` Jakub Kicinski
2018-04-18 22:56 ` [PATCH bpf-next v5 10/10] bpf: btf: Add BTF tests Martin KaFai Lau
2018-04-19 19:40 ` [PATCH bpf-next v5 00/10] BTF: BPF Type Format Arnaldo Carvalho de Melo
2018-04-19 20:58   ` Martin KaFai Lau
2018-06-05 21:25   ` Martin KaFai Lau
2018-06-06 12:33     ` Arnaldo Carvalho de Melo
2018-06-07 13:54     ` Arnaldo Carvalho de Melo
2018-06-07 14:03       ` Arnaldo Carvalho de Melo
2018-06-07 19:05         ` Martin KaFai Lau
2018-06-07 19:30           ` Arnaldo Carvalho de Melo
2018-06-07 20:07             ` Martin KaFai Lau
2018-06-07 20:25               ` Arnaldo Carvalho de Melo
2018-06-12 20:31               ` Arnaldo Carvalho de Melo [this message]
2018-06-12 20:41                 ` Arnaldo Carvalho de Melo
2018-06-13 23:26                   ` Martin KaFai Lau
2018-06-14 15:03                     ` Arnaldo Carvalho de Melo
2018-06-14 16:22                       ` Martin KaFai Lau
2018-06-14 17:18                         ` Arnaldo Carvalho de Melo
2018-06-14 17:21                           ` Alexei Starovoitov
2018-06-14 17:41                             ` Arnaldo Carvalho de Melo
2018-06-14 17:47                             ` Arnaldo Carvalho de Melo
2018-06-14 18:00                               ` Arnaldo Carvalho de Melo
2018-06-15  4:56                                 ` Yonghong Song
2018-06-15 14:24                                   ` Arnaldo Carvalho de Melo
2018-06-15 16:06                                     ` Yonghong Song
2018-06-15 11:20             ` Bo YU
2018-04-19 23:57 ` Daniel Borkmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180612203124.GB22039@kernel.org \
    --to=acme@kernel.org \
    --cc=ast@fb.com \
    --cc=daniel@iogearbox.net \
    --cc=jolsa@kernel.org \
    --cc=kafai@fb.com \
    --cc=kernel-team@fb.com \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=wangnan0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.