Search code examples
clionwindows-subsystem-for-linuxperf

Profiler in CLion 2022.2.4 over WSL 2


I am wanting to run a CPU profiler on my C++ code via CLion. The profiler in CLion only used to be available for Linux (using perf) and macOS (using DTrace), but as of CLion 2021.2, the profiler is supposed to be available for WSL (also using perf) and I am using CLion 2022.2.4. CLion's docs have also been updated to reflect this change, listing WSL under the supported OSs, but there is no additional information for it, so I would assume the steps would be identical to those of Linux.

perf is only available for WSL on WSL 2, but I am using WSL 2 and have successfully installed perf. I have configured a CLion toolchain for this same WSL instance, and have successfully managed to use another WSL-only feature (Valgrind MemCheck) through it.

However, with Valgrind, all Valgrind-related IDE features (settings, run configurations, notifications...) were available to me before I even installed WSL, whereas the equivelant features for profiling don't seem to be available even after completely configuring WSL 2. How can I access the profiler for WSL?


Solution

  • By default, CLion has a plugin called Copyright enabled, but it appears I must have disabled it. There is a bug which causes profiler-related features to only show with this plugin enabled, and enabling it fixed the issue.