Linux Dotnet 程序堆栈监控

# 查看进程
dotnet-stack ps
#显示如下
 2014067  dotnet  /usr/share/dotnet/dotnet  k=1 --LogLevel=4 
 2014087  dotnet  /usr/share/dotnet/dotnet --LogLevel=4 
 2014089  dotnet  /usr/share/dotnet/dotnet --LogLevel=4 


# 根据PID查看这个进程每个线程的堆栈
dotnet-stack report -p 2014067

# 显示如下
Thread (0x1EBBAC):
  [Native Frames]
  System.Private.CoreLib!System.Threading.Thread.Sleep(int32)
  DoServer.MainLoop()
  DoServer.Program.Main(class System.String[])

Thread (0x1EBD72):
  [Native Frames]
  System.Private.CoreLib!System.Threading.WaitHandle.WaitOneNoCheck(int32)
  System.Private.CoreLib!System.Threading.TimerQueue.TimerThread()

Thread (0x1EBD77):
  [Native Frames]
  System.Private.CoreLib!System.Threading.WaitHandle.WaitOneNoCheck(int32)
  System.Private.CoreLib!System.Threading.PortableThreadPool+GateThread.GateThreadStart()

安装参考

dotnet-stack 诊断工具 - .NET CLI - .NET | Microsoft Learn

你可能感兴趣的:(工作,Linux,服务器,java,开发语言)