Erlang VM:调度程序运行时信息
我正在寻找一种方法来检索有关程序执行期间如何完成调度的信息:哪些进程位于哪个调度程序中,如果它们发生变化,每个调度程序中哪个进程处于活动状态,每个调度程序是否在一个核心中运行等等...
有什么想法或相关文档/文章/任何东西吗?
I was searching for a way to retrieve information about how the scheduling is done during a program's execution: which processes are in which scheduler, if they change, what process is active at each scheduler, if each scheduler runs in one core etc...
Any ideas or related documentation/articles/anything?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议您查看以下跟踪/分析选项:
erlang: system_profile/2
它具有用于监视调度程序和运行队列(runnable_procs)活动的选项。
调度程序选项将报告
状态将告诉您它是否处于活动状态。 NoScheds 报告当前活动调度程序的数量(如果我没记错的话)。
runnable_procs 选项会让您知道进程是否被放入或从特定调度程序的运行队列中删除。
I would suggest you take a look on the following tracing/profiling options:
erlang:system_profile/2
It has options for monitoring scheduler and run queue (runnable_procs) activity.
The scheduler option will report
where State will tell you if it is active or not. NoScheds reports the number of currently active schedulers (if I remember correctly).
The runnable_procs option will let you know if a process is put into or removed from a run queue of a particular scheduler.
如果您有支持 DTrace 的系统,则可以使用正在开发的 erlang dtrace 探针来准确查看进程调度事件发生的时间。
例如,我编写了一个简单的单行,它显示发送消息之间经过的纳秒数到进程并安排接收进程执行(对于跨核心时钟差异和进程等,±几纳秒)。
If you have a system that supports DTrace, you can use the erlang dtrace probes being developed to see exactly when process scheduling events occur.
For example, I wrote a simple one-liner that shows you the number of nanoseconds that pass between sending a message to a process and having the recipient process be scheduled for execution (± a few nanoseconds for cross-core clock variance and processes and such).