Sysinternals / ProcMon-for-Linux

Procmon is a Linux reimagining of the classic Procmon tool from the Sysinternals suite of tools for Windows. Procmon provides a convenient and efficient way for Linux developers to trace the syscall activity on the system.
MIT License
4k stars 259 forks source link

Can not build on Fedora 35 #81

Closed kushaldas closed 2 years ago

kushaldas commented 3 years ago
[ 50%] Building CXX object _deps/bcc-build/src/cc/frontends/b/CMakeFiles/b_frontend.dir/type_check.cc.o
[ 53%] Building CXX object _deps/bcc-build/src/cc/frontends/b/CMakeFiles/b_frontend.dir/parser.yy.cc.o
[ 53%] Building CXX object _deps/bcc-build/src/cc/frontends/b/CMakeFiles/b_frontend.dir/lexer.ll.cc.o
[ 53%] Linking CXX static library libb_frontend.a
[ 53%] Built target b_frontend
[ 53%] Building CXX object _deps/bcc-build/src/cc/CMakeFiles/bcc-static.dir/bcc_common.cc.o
[ 53%] Building CXX object _deps/bcc-build/src/cc/CMakeFiles/bcc-static.dir/bpf_module.cc.o
[ 57%] Building CXX object _deps/bcc-build/src/cc/CMakeFiles/bcc-static.dir/bcc_btf.cc.o
/home/kdas/code/Procmon-for-Linux/build/_deps/bcc-src/src/cc/bcc_btf.cc: In member function ‘int ebpf::BTF::get_btf_info(const char*, void**, unsigned int*, unsigned int*, void**, unsigned int*, unsigned int*)’:
/home/kdas/code/Procmon-for-Linux/build/_deps/bcc-src/src/cc/bcc_btf.cc:315:33: warning: ‘int btf_ext__reloc_func_info(const btf*, const btf_ext*, const char*, __u32, void**, __u32*)’ is deprecated: btf_ext__reloc_func_info was never meant as a public API and has wrong assumptions embedded in it; it will be removed in the future libbpf versions [-Wdeprecated-declarations]
  315 |   ret = btf_ext__reloc_func_info(btf_, btf_ext_, fname, 0,
      |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
  316 |         func_info, func_info_cnt);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/kdas/code/Procmon-for-Linux/build/_deps/bcc-src/src/cc/bcc_libbpf_inc.h:9,
                 from /home/kdas/code/Procmon-for-Linux/build/_deps/bcc-src/src/cc/bcc_btf.cc:22:
/home/kdas/code/Procmon-for-Linux/build/_deps/bcc-src/src/cc/libbpf/src/btf.h:80:5: note: declared here
   80 | int btf_ext__reloc_func_info(const struct btf *btf,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~
/home/kdas/code/Procmon-for-Linux/build/_deps/bcc-src/src/cc/bcc_btf.cc:322:33: warning: ‘int btf_ext__reloc_line_info(const btf*, const btf_ext*, const char*, __u32, void**, __u32*)’ is deprecated: btf_ext__reloc_line_info was never meant as a public API and has wrong assumptions embedded in it; it will be removed in the future libbpf versions [-Wdeprecated-declarations]
  322 |   ret = btf_ext__reloc_line_info(btf_, btf_ext_, fname, 0,
      |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
  323 |         line_info, line_info_cnt);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/kdas/code/Procmon-for-Linux/build/_deps/bcc-src/src/cc/bcc_libbpf_inc.h:9,
                 from /home/kdas/code/Procmon-for-Linux/build/_deps/bcc-src/src/cc/bcc_btf.cc:22:
/home/kdas/code/Procmon-for-Linux/build/_deps/bcc-src/src/cc/libbpf/src/btf.h:85:5: note: declared here
   85 | int btf_ext__reloc_line_info(const struct btf *btf,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~
[ 57%] Building CXX object _deps/bcc-build/src/cc/CMakeFiles/bcc-static.dir/exported_files.cc.o
[ 57%] Building CXX object _deps/bcc-build/src/cc/CMakeFiles/bcc-static.dir/bcc_debug.cc.o
/home/kdas/code/Procmon-for-Linux/build/_deps/bcc-src/src/cc/bcc_debug.cc: In member function ‘void ebpf::SourceDebugger::dump()’:
/home/kdas/code/Procmon-for-Linux/build/_deps/bcc-src/src/cc/bcc_debug.cc:132:53: error: no matching function for call to ‘llvm::MCContext::MCContext(std::unique_ptr<llvm::MCAsmInfo>::pointer, std::unique_ptr<llvm::MCRegisterInfo>::pointer, llvm::MCObjectFileInfo*, std::nullptr_t)’
  132 |   MCContext Ctx(MAI.get(), MRI.get(), &MOFI, nullptr);
      |                                                     ^
In file included from /home/kdas/code/Procmon-for-Linux/build/_deps/bcc-src/src/cc/bcc_debug.cc:26:
/usr/include/llvm/MC/MCContext.h:398:14: note: candidate: ‘llvm::MCContext::MCContext(const llvm::Triple&, const llvm::MCAsmInfo*, const llvm::MCRegisterInfo*, const llvm::MCSubtargetInfo*, const llvm::SourceMgr*, const llvm::MCTargetOptions*, bool)’
  398 |     explicit MCContext(const Triple &TheTriple, const MCAsmInfo *MAI,
      |              ^~~~~~~~~
/usr/include/llvm/MC/MCContext.h:398:38: note:   no known conversion for argument 1 from ‘std::unique_ptr<llvm::MCAsmInfo>::pointer’ {aka ‘llvm::MCAsmInfo*’} to ‘const llvm::Triple&’
  398 |     explicit MCContext(const Triple &TheTriple, const MCAsmInfo *MAI,
      |                        ~~~~~~~~~~~~~~^~~~~~~~~
/home/kdas/code/Procmon-for-Linux/build/_deps/bcc-src/src/cc/bcc_debug.cc:133:8: error: ‘class llvm::MCObjectFileInfo’ has no member named ‘InitMCObjectFileInfo’; did you mean ‘initMCObjectFileInfo’?
  133 |   MOFI.InitMCObjectFileInfo(TheTriple, false, Ctx, false);
      |        ^~~~~~~~~~~~~~~~~~~~
      |        initMCObjectFileInfo
make[2]: *** [_deps/bcc-build/src/cc/CMakeFiles/bcc-static.dir/build.make:132: _deps/bcc-build/src/cc/CMakeFiles/bcc-static.dir/bcc_debug.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1017: _deps/bcc-build/src/cc/CMakeFiles/bcc-static.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
MarioHewardt commented 3 years ago

Related issue #70 .

malcolmmccaffery commented 2 years ago

I built on Fedora 34 with these steps(these are probably not optimal and installed more packages then necessary)

sudo dnf -y install bison flex git sudo dnf -y install libedit-devel sudo dnf -y install clang sudo dnf -y install clang-tools-extra sudo dnf -y install clang-libs sudo dnf -y install netperf sudo dnf -y install iperf3 sudo dnf -y install luajit luajit-devel sudo dnf -y install libclang sudo dnf -y install llvm sudo dnf -y groupinstall "Development Tools" "Development Libraries"

git clone https://github.com/Microsoft/Procmon-for-Linux cd Procmon-for-Linux mkdir build cd build cmake .. -DENABLE_LLVM_SHARED=ON make

malcolmmccaffery commented 2 years ago

I will add this helps it build fine on Fedora, but it doesn't work for me, it launches and shows the UI but doesn't monitor anything. The console has the following output

[malcolm@ip-172-31-28-158 build]$ sudo ./procmon
In file included from <built-in>:2:
In file included from /virtual/include/bcc/bpf.h:12:
In file included from include/linux/types.h:6:
In file included from include/uapi/linux/types.h:14:
In file included from include/uapi/linux/posix_types.h:5:
In file included from include/linux/stddef.h:5:
In file included from include/uapi/linux/stddef.h:2:
In file included from include/linux/compiler_types.h:80:
include/linux/compiler-clang.h:41:9: warning: '__HAVE_BUILTIN_BSWAP32__' macro redefined [-Wmacro-redefined]
#define __HAVE_BUILTIN_BSWAP32__
        ^
<command line>:4:9: note: previous definition is here
#define __HAVE_BUILTIN_BSWAP32__ 1
        ^
In file included from <built-in>:2:
In file included from /virtual/include/bcc/bpf.h:12:
In file included from include/linux/types.h:6:
In file included from include/uapi/linux/types.h:14:
In file included from include/uapi/linux/posix_types.h:5:
In file included from include/linux/stddef.h:5:
In file included from include/uapi/linux/stddef.h:2:
In file included from include/linux/compiler_types.h:80:
include/linux/compiler-clang.h:42:9: warning: '__HAVE_BUILTIN_BSWAP64__' macro redefined [-Wmacro-redefined]
#define __HAVE_BUILTIN_BSWAP64__
        ^
<command line>:5:9: note: previous definition is here
#define __HAVE_BUILTIN_BSWAP64__ 1
        ^
In file included from <built-in>:2:
In file included from /virtual/include/bcc/bpf.h:12:
In file included from include/linux/types.h:6:
In file included from include/uapi/linux/types.h:14:
In file included from include/uapi/linux/posix_types.h:5:
In file included from include/linux/stddef.h:5:
In file included from include/uapi/linux/stddef.h:2:
In file included from include/linux/compiler_types.h:80:
include/linux/compiler-clang.h:43:9: warning: '__HAVE_BUILTIN_BSWAP16__' macro redefined [-Wmacro-redefined]
#define __HAVE_BUILTIN_BSWAP16__
        ^
<command line>:3:9: note: previous definition is here
#define __HAVE_BUILTIN_BSWAP16__ 1
        ^
3 warnings generated.
bpf: Failed to load program: Invalid argument
fd 9 is not pointing to valid bpf_map
processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0

bpf: Failed to load program: Invalid argument
fd 9 is not pointing to valid bpf_map
processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
MarioHewardt commented 2 years ago

Thanks for the report. We have an umbrella issue (#70) that tracks the work we need to do to get procmon running on other distros besides the currently supported ones (Ubuntu 18.04 and 20.04).