[erlang-questions] Tracing traffic between nodes

David Welton <>
Mon Feb 3 17:53:47 CET 2014


The tricky thing seems to be that - if I'm interpreting things
correctly - there is no information on who we have received something
from.  This looks like it might work with an Erlang remote node:

watch(RemoteNode) ->
    dbg:start(),
    Self = node(),
    {ok, _TPid1} =
        dbg:tracer(process,
                   {fun({trace, _Pid, send, What, {Process, Node}}, _Acc) when
                              Node == Self orelse Node == RemoteNode ->
                            io:format("{~p, ~p} ! ~p~n", [Process, Node, What]);
                       (_, _Acc) ->
                            ok
                    end,
                    []}),
    {ok, RemoteNode} = dbg:n(RemoteNode),
    dbg:p(all, [s]).

But probably not with a C node.

Maybe the best thing is wireshark or something like that, and a bit of
code to dump the erlang messages from that...

-- 
David N. Welton

http://www.welton.it/davidw/

http://www.dedasys.com/


More information about the erlang-questions mailing list