Erlang VM:调度程序运行时信息

发布于 2024-12-18 05:14:05 字数 128 浏览 2 评论 0原文

我正在寻找一种方法来检索有关程序执行期间如何完成调度的信息:哪些进程位于哪个调度程序中,如果它们发生变化,每个调度程序中哪个进程处于活动状态,每个调度程序是否在一个核心中运行等等...

有什么想法或相关文档/文章/任何东西吗?

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

与酒说心事 2024-12-25 05:14:05

我建议您查看以下跟踪/分析选项:

erlang: system_profile/2

它具有用于监视调度程序和运行队列(runnable_procs)活动的选项。
调度程序选项将报告

{profile, scheduler, Id, State, NoScheds, Ts}

状态将告诉您它是否处于活动状态。 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

{profile, scheduler, Id, State, NoScheds, Ts}

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.

风尘浪孓 2024-12-25 05:14:05

如果您有支持 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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文