简体   繁体   English

如何在Rubinius中进行线程转储?

[英]How can I do a thread dump in rubinius?

I want to do a thread dump of my rubinius app to help investigate an apparent deadlock issue. 我想对rubinius应用程序进行线程转储,以帮助调查明显的死锁问题。 My app is using rbx-3.21, and I'd prefer not to change that if possible. 我的应用程序使用的是rbx-3.21,如果可能的话,我不希望更改它。

I've tried doing a pure ruby solution like the one described here , but the thread backtraces don't work properly - they all appear the same as the thread performing the stack dump. 我试图做一个像这里描述的那样的纯红宝石解决方案,但是线程回溯无法正常工作-它们的外观都与执行堆栈转储的线程相同。 The result looks something like this: 结果看起来像这样:

Thread-1uvk
common/service.rb:192:in `dump_threads'
  common/service.rb:190:in `dump_threads'
  common/service.rb:90:in `prepare_status'

Thread-1uvs
common/service.rb:192:in `dump_threads'
  common/service.rb:190:in `dump_threads'
  common/service.rb:90:in `prepare_status'

....etc

You should take a look at the Rubinius Book which documents some of the new tools. 您应该看一下Rubinius Book,它记录了一些新工具。 Specifically, check this out: https://book.rubinius.com/manuscript/inspectability.html 具体来说,请查看以下内容: https : //book.rubinius.com/manuscript/inspectability.html

I generally run my code using the example given at the bottom of that page: 我通常使用该页面底部给出的示例运行代码:

rbx -Xsystem.diagnostics.target='./diagnostics-$PID.json' -Xsystem.profiler.target=diagnostics some_script.rb

This will write statistics, including a thread profile, to the json file. 这会将统计信息(包括线程配置文件)写入json文件。

If that isn't enough information, stop on by the Gitter room where many Rubinius users hang out and ask for help. 如果这还不够,请在Gitter会议室停下来,许多Rubinius用户在那里闲逛并寻求帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM