WSL2でPMUを有効にする方法は?

WSL2でPMUを有効にする方法は?

Windows11では、LinuxホストとしてWSL2を使用しています。
これで、WSL2でこれを実行したいがperf失敗し、次のエラーが発生します。

# uname -a
Linux testhost 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

# dmesg | grep -i perf
[    0.039284] Performance Events: unsupported p6 CPU model 154 no PMU driver, software events only.
[    0.204569]     Performance counters on

WindowsのUSRNAME / .wslconfigに次の行を追加しました。

hardwarePerformanceCounters=true

Powershell で管理者権限で次のコマンドを実行します。

PS C:\Users\aa> wsl --update
Checking updates
Updating WSL2 subsystem to version: 2.0.14.
PS C:\Users\aa> dism /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Deploying service and management tool.
Version: 10.0.22621.1

Image version: 10.0.22621.1848

Done started one or more functions
[==========================100.0%==========================]
Done

しかし、WSL2 LinuxはPMUハードウェアを確保できませんでした。

ここでWSL2に関する質問を投稿できるかどうかはわかりません。そうでない場合は申し訳ありません。

ベストアンサー1

おすすめ記事