Skip to content

Using dtrace with erlang on FreeBSD 10.0

Shayan Pooya edited this page Feb 18, 2014 · 12 revisions
  1. Before making, first we have to load dtrace:

    kldload dtraceall

And add it to loader.conf so that it is loaded automatically after reboots:

cat >> /boot/loader.conf
  1. Install gcc (Using pkgng for gcc will save you some time, but it can be installed from the port tree too. Simply skip this step to let gcc be installed from the port tree as one of the dependencies of Erlang).

pkg install gcc dialog4ports

  1. Now go to the port tree:

$ cd /usr/ports/lang/erlang

and configure erlang:

$ sudo make config

Select dtrace and gcc (it will save you some compilation time if you install gcc from pkgng separately

  1. Now make and install

$ sudo make

$ sudo make install

  1. Start erlang:

% erl

WARNING: number of probes fixed does not match the number of defined probes (1004 != 1098, respectively)

WARNING: some probes might not fire or your program might crash

Erlang R16B02 (erts-5.10.3) [source] [64-bit] [smp:2:2] [async-threads:10] [kernel-poll:false] [dtrace]

Eshell V5.10.3 (abort with ^G)

1>

We see that it has dtrace as one of the options written in the list.

  1. List the dtrace probes for erlang and make sure they are enabled:

# dtrace -l | grep erlang | wc -l

  1. Some resources:

    http://blog.licenser.net/blog/2013/01/28/erlang-and-more-dtrace/

    https://github.com/argv0/dtrace-erlang-bashochat-12142011.git

    http://basho.com/bashochats-001-erlang-and-dtrace-storm-and-distributed-rpc/

    http://www.youtube.com/watch?v=4Si-7nAic2c

Clone this wiki locally