Skip to content
Snippets Groups Projects
  1. Feb 17, 2023
  2. Feb 11, 2023
  3. Feb 09, 2023
  4. Feb 07, 2023
  5. Feb 03, 2023
    • Tonghao Zhang's avatar
      bpftool: profile online CPUs instead of possible · 377c16fa
      Tonghao Zhang authored
      
      The number of online cpu may be not equal to possible cpu.
      "bpftool prog profile" can not create pmu event on possible
      but on online cpu.
      
      $ dmidecode -s system-product-name
      PowerEdge R620
      $ cat /sys/devices/system/cpu/possible
      0-47
      $ cat /sys/devices/system/cpu/online
      0-31
      
      Disable cpu dynamically:
      $ echo 0 > /sys/devices/system/cpu/cpuX/online
      
      If one cpu is offline, perf_event_open will return ENODEV.
      To fix this issue:
      * check value returned and skip offline cpu.
      * close pmu_fd immediately on error path, avoid fd leaking.
      
      Fixes: 47c09d6a ("bpftool: Introduce "prog profile" command")
      Signed-off-by: default avatarTonghao Zhang <tong@infragraf.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: Martin KaFai Lau <martin.lau@linux.dev>
      Cc: Song Liu <song@kernel.org>
      Cc: Yonghong Song <yhs@fb.com>
      Cc: John Fastabend <john.fastabend@gmail.com>
      Cc: KP Singh <kpsingh@kernel.org>
      Cc: Stanislav Fomichev <sdf@google.com>
      Cc: Hao Luo <haoluo@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
      Link: https://lore.kernel.org/r/20230202131701.29519-1-tong@infragraf.org
      
      
      Signed-off-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
      377c16fa
  6. Jan 25, 2023
  7. Jan 13, 2023
  8. Jan 11, 2023
  9. Jan 10, 2023
  10. Dec 22, 2022
    • Anton Protopopov's avatar
      bpftool: Fix linkage with statically built libllvm · 55171f29
      Anton Protopopov authored
      
      Since the commit eb9d1acf ("bpftool: Add LLVM as default library for
      disassembling JIT-ed programs") we might link the bpftool program with the
      libllvm library. This works fine when a shared libllvm library is available,
      but fails if we want to link bpftool with a statically built LLVM:
      
        [...]
        /usr/bin/ld: /usr/local/lib/libLLVMSupport.a(CrashRecoveryContext.cpp.o): in function `llvm::CrashRecoveryContextCleanup::~CrashRecoveryContextCleanup()':
        CrashRecoveryContext.cpp:(.text._ZN4llvm27CrashRecoveryContextCleanupD0Ev+0x17): undefined reference to `operator delete(void*, unsigned long)'
        /usr/bin/ld: /usr/local/lib/libLLVMSupport.a(CrashRecoveryContext.cpp.o): in function `llvm::CrashRecoveryContext::~CrashRecoveryContext()':
        CrashRecoveryContext.cpp:(.text._ZN4llvm20CrashRecoveryContextD2Ev+0xc8): undefined reference to `operator delete(void*, unsigned long)'
        [...]
      
      So in the case of static libllvm we need to explicitly link bpftool with
      required libraries, namely, libstdc++ and those provided by the `llvm-config
      --system-libs` command. We can distinguish between the shared and static cases
      by using the `llvm-config --shared-mode` command.
      
      Fixes: eb9d1acf ("bpftool: Add LLVM as default library for disassembling JIT-ed programs")
      Signed-off-by: default avatarAnton Protopopov <aspsk@isovalent.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarStanislav Fomichev <sdf@google.com>
      Link: https://lore.kernel.org/bpf/20221222102627.1643709-1-aspsk@isovalent.com
      55171f29
  11. Dec 21, 2022
  12. Dec 15, 2022
  13. Dec 06, 2022
  14. Nov 21, 2022
  15. Nov 16, 2022
  16. Nov 10, 2022
  17. Nov 02, 2022
  18. Oct 27, 2022
  19. Oct 26, 2022
  20. Oct 25, 2022
  21. Oct 21, 2022
  22. Oct 01, 2022
  23. Sep 30, 2022
Loading