如何在 Erlang 中使用 trace 和 dbg 来调试和跟踪我的程序? [英] How to use trace and dbg in Erlang to debug and trace my program?

查看:46
本文介绍了如何在 Erlang 中使用 trace 和 dbg 来调试和跟踪我的程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试开始使用 erlang:trace/3dbg 模块来跟踪实时生产系统的行为,而无需关闭服务器.

I am trying to start using erlang:trace/3 and the dbg module to trace the behaviour of a live production system without taking the server down.

文档不透明(说得客气一点)而且网上似乎没有任何有用的教程.

The documentation is opaque (to put it mildly) and there don't appear to be any useful tutorials online.

我花了一整天的时间试图通过使用 dbg:cdbg:c 将跟踪应用到 Module:Functioncode>dbg:p 但根本没有成功.

What I spent all day trying to do was capture what was happening in a particular function by trying to apply a trace to Module:Function using dbg:c and dbg:p but with no success at all.

有人对如何在实时 Erlang 系统中使用 trace 有一个简洁的解释吗?

Does anyone have a succinct explanation of how to use trace in a live Erlang system?

推荐答案

如果您更喜欢图形跟踪器,请尝试 erlyberly.它允许您选择要跟踪的函数(目前在所有进程上)并处理 dbg API.

If you would prefer a graphical tracer then try erlyberly. It allows you to select the functions you would like to trace (on all processes at the moment) and deals with the dbg API.

但是它不能防止过载,因此不适用于生产系统.

However it does not protect against overload so is not suitable for production systems.

这篇关于如何在 Erlang 中使用 trace 和 dbg 来调试和跟踪我的程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆