The basic steps of tracing for function calls are on a non-live node: > dbg:start(). % start dbg > dbg:tracer(). % start a simple tracer process > dbg:tp(Module, Function, Arity, []). % specify MFA you are interested in > dbg:p(all, c). % trace calls (c) of that MFA for all processes. ... trace here > dbg:stop_clear(). % stop tracer and clear effect of tp and p calls. You can trace for multiple fu
(Elixir 向けの内容ですが、Erlang で書かれた recon_trace を紹介しているので、Erlang タグも付けてます) トレース機能、使ってますか? みなさんは Elixir のプログラムをどのようにデバッグしてますか? IEx.pry? それとも、IO.inspect を使った、いわゆる printf デバッグでしょうか? また、もし本番環境で次のような問題が起こったら、どう調査しますか? 特定の条件(ユーザーからの入力)でエラーになるようだが、その条件自体がわからない どこかが性能上のボトルネックになっているようだ ログを追加して、アプリケーションをデプロイし直すのもひとつの方法ですよね。 もちろん、どれも有効な手段です。でも、こんな時、まずは Erlang VM のトレース機能を使うことをお勧めします。それだけで原因がわかるかもしれません。 「すごいE本1」の原著者
This module implements a text based interface to the trace/3 and the trace_pattern/2 BIFs. It makes it possible to trace functions, processes, ports and messages. To quickly get started on tracing function calls you can use the following code in the Erlang shell: 1> dbg:tracer(). %% Start the default trace message receiver {ok,<0.36.0>} 2> dbg:p(all, c). %% Setup call (c) tracing on all processes
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く