Tracing the action of consuming messages from mailbox in Erlang

不问归期 提交于 2019-12-22 06:39:08

问题


I went through the documentation of the trace/3 BIF in Erlang. However, one observation I have made is that it cannot be used for tracing the consuming of messages from the mailbox. The flag 'receive' only traces when messages are added to a process's mailbox.

Is there any way one can trace events such as reading from the mailbox using the receive construct? If not, is there any reason why this isn't possible? It seems very strange that one can trace most kind of events in a program and the reading of messages from a mailbox is not traceable.


回答1:


There is no such tool. You can only hope for call tracing of the handling function. It is rather easy in OTP applications since you can hook handle_....



来源:https://stackoverflow.com/questions/13630225/tracing-the-action-of-consuming-messages-from-mailbox-in-erlang

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!