Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bpftool sync 2024-05-29 #147

Merged
merged 8 commits into from
May 29, 2024

Commits on May 29, 2024

  1. mirror: Add automatic .mailmap updates to the sync-up process

    Make sure we keep the file up-to-date with regards to the version in the
    Linux repository.
    
    Reuse libbpf's commit libbpf/libbpf@e05542003381 ("sync: Commit .mailmap
    changes from script when sync-ing repo").
    
    Signed-off-by: Quentin Monnet <[email protected]>
    qmonnet committed May 29, 2024
    Configuration menu
    Copy the full SHA
    6b8ffbc View commit details
    Browse the repository at this point in the history
  2. sync: Update libbpf submodule

    Pull latest libbpf from mirror.
    Libbpf version: 1.5.0
    Libbpf commit:  9b789075a993e8235aac301126e58ff7b380da5f
    
    Signed-off-by: Quentin Monnet <[email protected]>
    qmonnet committed May 29, 2024
    Configuration menu
    Copy the full SHA
    ecc820a View commit details
    Browse the repository at this point in the history
  3. tools headers: Synchronize linux/bits.h with the kernel sources

    To pick up the changes in this cset:
    
       3c7a8e190bc58081 ("uapi: introduce uapi-friendly macros for GENMASK")
    
    That just causes perf to rebuild. Its just some macros going to an uapi
    header that we now have to grab a copy into tools/ as well.
    
    This addresses this perf build warning:
    
      Warning: Kernel ABI header differences:
        diff -u tools/include/linux/bits.h include/linux/bits.h
    
    Cc: Adrian Hunter <[email protected]>
    Cc: Ian Rogers <[email protected]>
    Cc: Jiri Olsa <[email protected]>
    Cc: Kan Liang <[email protected]>
    Cc: Namhyung Kim <[email protected]>
    Cc: Paolo Bonzini <[email protected]>
    Link: https://lore.kernel.org/lkml/ZiwJsFOBez0MS4r9@x1
    Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
    acmel authored and qmonnet committed May 29, 2024
    Configuration menu
    Copy the full SHA
    bc2d04f View commit details
    Browse the repository at this point in the history
  4. bpftool: Introduce btf c dump sorting

    Sort bpftool c dump output; aiming to simplify vmlinux.h diffing and
    forcing more natural type definitions ordering.
    
    Definitions are sorted first by their BTF kind ranks, then by their base
    type name and by their own name.
    
    Type ranks
    
    Assign ranks to btf kinds (defined in function btf_type_rank) to set
    next order:
    1. Anonymous enums/enums64
    2. Named enums/enums64
    3. Trivial types typedefs (ints, then floats)
    4. Structs/Unions
    5. Function prototypes
    6. Forward declarations
    
    Type rank is set to maximum for unnamed reference types, structs and
    unions to avoid emitting those types early. They will be emitted as
    part of the type chain starting with named type.
    
    Lexicographical ordering
    
    Each type is assigned a sort_name and own_name.
    sort_name is the resolved name of the final base type for reference
    types (typedef, pointer, array etc). Sorting by sort_name allows to
    group typedefs of the same base type. sort_name for non-reference type
    is the same as own_name. own_name is a direct name of particular type,
    is used as final sorting step.
    
    Signed-off-by: Mykyta Yatsenko <[email protected]>
    Signed-off-by: Andrii Nakryiko <[email protected]>
    Tested-by: Andrii Nakryiko <[email protected]>
    Reviewed-by: Quentin Monnet <[email protected]>
    Acked-by: Andrii Nakryiko <[email protected]>
    Link: https://lore.kernel.org/bpf/[email protected]
    Signed-off-by: Alexei Starovoitov <[email protected]>
    mykyta5 authored and qmonnet committed May 29, 2024
    Configuration menu
    Copy the full SHA
    0716338 View commit details
    Browse the repository at this point in the history
  5. bpftool: Fix make dependencies for vmlinux.h

    With pre-generated vmlinux.h there is no dependency on neither vmlinux
    nor bootstrap bpftool. Define dependencies separately for both modes.
    This avoids needless rebuilds in some corner cases.
    
    Suggested-by: Jan Stancek <[email protected]>
    Signed-off-by: Artem Savkov <[email protected]>
    Signed-off-by: Andrii Nakryiko <[email protected]>
    Acked-by: Quentin Monnet <[email protected]>
    Link: https://lore.kernel.org/bpf/[email protected]
    Signed-off-by: Alexei Starovoitov <[email protected]>
    sm00th authored and qmonnet committed May 29, 2024
    Configuration menu
    Copy the full SHA
    05e05e4 View commit details
    Browse the repository at this point in the history
  6. bpftool: Un-const bpf_func_info to fix it for llvm 17 and newer

    LLVM 17 started treating const structs as constants:
    
    * llvm/llvm-project@0b2d5b967d98
    
    Combined with pointer laundering via ptr_to_u64, which takes a const ptr,
    but in reality treats the underlying memory as mutable, this makes clang
    always pass zero to btf__type_by_id, which breaks full name resolution.
    
    Disassembly before (LLVM 16) and after (LLVM 17):
    
        -    8b 75 cc                 mov    -0x34(%rbp),%esi
        -    e8 47 8d 02 00           call   3f5b0 <btf__type_by_id>
        +    31 f6                    xor    %esi,%esi
        +    e8 a9 8c 02 00           call   3f510 <btf__type_by_id>
    
    It's a bigger project to fix this properly (and a question whether LLVM
    itself should detect this), but for right now let's just fix bpftool.
    
    For more information, see this thread in bpf mailing list:
    
    * https://lore.kernel.org/bpf/CABWYdi0ymezpYsQsPv7qzpx2fWuTkoD1-wG1eT-9x-TSREFrQg@mail.gmail.com/T/
    
    Fixes: b662000aff84 ("bpftool: Adding support for BTF program names")
    Signed-off-by: Ivan Babrou <[email protected]>
    Signed-off-by: Andrii Nakryiko <[email protected]>
    Acked-by: Nick Desaulniers <[email protected]>
    Acked-by: Yonghong Song <[email protected]>
    Link: https://lore.kernel.org/bpf/[email protected]
    bobrik authored and qmonnet committed May 29, 2024
    Configuration menu
    Copy the full SHA
    e6759da View commit details
    Browse the repository at this point in the history
  7. net: Add additional bit to support clockid_t timestamp type

    tstamp_type is now set based on actual clockid_t compressed
    into 2 bits.
    
    To make the design scalable for future needs this commit bring in
    the change to extend the tstamp_type:1 to tstamp_type:2 to support
    other clockid_t timestamp.
    
    We now support CLOCK_TAI as part of tstamp_type as part of this
    commit with existing support CLOCK_MONOTONIC and CLOCK_REALTIME.
    
    Signed-off-by: Abhishek Chauhan <[email protected]>
    Reviewed-by: Willem de Bruijn <[email protected]>
    Reviewed-by: Martin KaFai Lau <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Martin KaFai Lau <[email protected]>
    Abhishek Chauhan authored and qmonnet committed May 29, 2024
    Configuration menu
    Copy the full SHA
    33eab1f View commit details
    Browse the repository at this point in the history
  8. sync: Pull latest bpftool changes from kernel

    Syncing latest bpftool commits from kernel repository.
    Baseline bpf-next commit:   009367099eb61a4fc2af44d4eb06b6b4de7de6db
    Checkpoint bpf-next commit: eb4e7726279a344c82e3c23be396bcfd0a4d5669
    Baseline bpf commit:        3e9bc0472b910d4115e16e9c2d684c7757cb6c60
    Checkpoint bpf commit:      9dfdb706e164ae869b1d97f83ebf8523b2809714
    
    Abhishek Chauhan (1):
      net: Add additional bit to support clockid_t timestamp type
    
    Arnaldo Carvalho de Melo (1):
      tools headers: Synchronize linux/bits.h with the kernel sources
    
    Artem Savkov (1):
      bpftool: Fix make dependencies for vmlinux.h
    
    Ivan Babrou (1):
      bpftool: Un-const bpf_func_info to fix it for llvm 17 and newer
    
    Mykyta Yatsenko (1):
      bpftool: Introduce btf c dump sorting
    
     bash-completion/bpftool                |   3 +
     docs/bpftool-btf.rst                   |   6 +-
     include/uapi/asm-generic/bitsperlong.h |   4 +
     include/uapi/linux/bpf.h               |  15 ++-
     src/Makefile                           |   3 +-
     src/btf.c                              | 138 ++++++++++++++++++++++++-
     src/common.c                           |   2 +-
     7 files changed, 157 insertions(+), 14 deletions(-)
    
    Signed-off-by: Quentin Monnet <[email protected]>
    qmonnet committed May 29, 2024
    Configuration menu
    Copy the full SHA
    19c600a View commit details
    Browse the repository at this point in the history