[erlang-questions] Simple question: how to read a trace using trace_client

Siri Hansen <>
Tue May 22 09:14:23 CEST 2012


Hi Richard!

You need to specify the complete WrapFileSpec in the call to
dbg:trace_client, like this:

dbg:trace_client(file,{"/tmp/trace_output",
wrap,atom_to_list(node()),10000000,20}).

Regards
/siri

2012/5/21 Richard Evans <>

> I am trying to trace some function-calls, redirect the trace to a file,
> and then, later, read that file to see the messages.
>
> To trace, I am doing:
>
> dbg:start().
>
> % to redirect to a file "trace_output"
> PortFun = dbg:trace_port(file,{"/tmp/trace_output",
> wrap,atom_to_list(node()),10000000,20}).
> dbg:tracer(port, PortFun).
>
> dbg:tp(lobby, handle_client_message, 2, []).
> dbg:p(all, c).
>
> % now I execute the program for a certain period of time and watch the
> trace_output file build up
>
> % finishing the trace
> dbg:stop_clear().
>
>
>
> This successfully produces a binary file. The longer I run the program,
> the larger it gets. This seems right.
>
> The bit that I don't get is how to read the binary file.
>
> I tried using trace_client:
>
> A=dbg:trace_client(file, "/tmp/trace_output").
>
>
> This returns me the PID of the trace_client process.
>
> But I don't know what to do with this PID!
>
> What I want to see is the list of function-calls in the file. But all I
> have is the PID.
>
> What do I do now?
>
> yours puzzledly,
> Richard
>
>
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120522/8698956f/attachment.html>


More information about the erlang-questions mailing list