Tracing for Elixir
Switch branches/tags
Clone or download
Latest commit 76bbe50 Apr 24, 2017


Dbg provides functions for tracing events in the BEAM VM.

Many events, including function calls and return, exception raising, sending and receiving messages, spawning, exiting, linking, scheduling and garbage collection can be traced across a cluster of nodes using Dbg.

Try it out

Clone the repo:

git clone
cd dbg
mix compile
iex -S mix

To see the messages sent by the shell process:


Clear all trace flags for current process:


To trace a call, add the :call trace flag to a process:

Dbg.trace(self(), :call)

Then add the function to traced calls:

Call the function to see a trace message:

Cancel tracing for


And clear the trace flags for self():


To reset all tracing:


Read The Docs

Dbg allows much more sophisticated tracing. To get the docs:

mix deps.get
MIX_ENV=docs mix docs

Install As Dependency

As a dependency to a file:

def application() do
  [applications: [:dbg]]

def deps() do
  [{:dbg, github: "fishcakez/dbg"}]

Compatibility With Erlang

Dbg is a wrapper around OTP's :dbg module from the :runtime_tools application. :dbg functions will work as normal and can be combined with Dbg function calls.


Copyright 2014 James Fish

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.