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

ProcMon-for-Linux doesn't work in WSL2 #82

Closed ThomsonTan closed 2 years ago

ThomsonTan commented 2 years ago

Built ProcMon-for-Linux in WSL2 (with Ubuntu 20.04 distro) on Windows 11, but it doesn't run with below error.

./procmon
terminate called after throwing an instance of 'std::experimental::filesystem::v1::__cxx11::filesystem_error'
  what():  filesystem error: directory iterator cannot open directory: No such file or directory [/sys/kernel/debug/tracing/events/syscalls]
Aborted

Below issue might be related. https://github.com/Sysinternals/ProcMon-for-Linux/issues/74

MarioHewardt commented 2 years ago

Can you try mounting /sys/kernel/debug? I.e., 'sudo mount -t debugfs nodev /sys/kernel/debug'.

ThomsonTan commented 2 years ago

Thanks @MarioHewardt. I mounted /sys/kernel/debug successfully, but then got another error as below.

modprobe: FATAL: Module kheaders not found in directory /lib/modules/5.10.60.1-microsoft-standard-WSL2 Unable to find kernel headers. Try rebuilding kernel with CONFIG_IKHEADERS=m (module) or installing the kernel development package for your running kernel version. chdir(/lib/modules/5.10.60.1-microsoft-standard-WSL2/build): No such file or directory

The config of the inbox WSL kernel shows CONFIG_IKHEADERS is not enabled.

zcat /proc/config.gz  | grep CONFIG_IKHEADERS
# CONFIG_IKHEADERS is not set
MarioHewardt commented 2 years ago

You may need to build a new kernel. Have a look at - https://gist.github.com/MarioHewardt/5759641727aae880b29c8f715ba4d30f and see if that helps.