一、dotnet-dump
dotnet tool install -g dotnet-dump
ps -ef | grep dotnet
export PATH=$PATH:$HOME/.dotnet/tools
dotnet-dump collect --process-id 31555
#等待最后出输出:Writing full to /root/core_20230701_095230
#分析/root/core_20230701_095230文件
dotnet tool install --global dotnet-symbol
dotnet-dump analyze /root/core_20230701_095230
#输入命令
clrstack -l
二、dotnet-trace
#更多命令见:https://learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-trace
如:
dotnet tool install --global dotnet-trace
dotnet-trace collect --process-id 31555