[ejabberd] dbg:trace problem

Kaiduan Xie kaiduanx at gmail.com
Fri Jul 3 05:18:42 MSD 2009


Badlop,

You are right, starting ejabberd with shell can make the trace work.

So why trace does not work when attaching a debug shell to a running
ejabberd? I think this is the way to do a trace for a live system.

I even tried saving the trace to a file. I can see the trace was saved
to the file, but the file can not be interpreted with
dbg:trace_client().

kaiduanx at vmxserver:~/xmpp/ejabberd-2.0.3/tools$ ./ejabberdctl start
kaiduanx at vmxserver:~/xmpp/ejabberd-2.0.3/tools$ ./ejabberdctl debug
Erlang (BEAM) emulator version 5.6.5 [source] [async-threads:0] [hipe]
[kernel-poll:false]

Eshell V5.6.5  (abort with ^G)
(ejabberd at 192.168.1.4)1> appmon:start().
{ok,<0.299.0>}
(ejabberd at 192.168.1.4)2> dbg:tracer(port, dbg:trace_port(file,
"ejabberd.trace2")).
{ok,<0.308.0>}
(ejabberd at 192.168.1.4)3> dbg:tpl('_', '_', '_', dbg:fun2ms(fun(_) ->
trace_return() end)).
Error: fun containing the local function call 'trace_return/0' (called
in body) cannot be translated into match_spec
** exception error: no function clause matching
dbg:do_tp({'_','_','_'},{error,transform_error},[local])
(ejabberd at 192.168.1.4)4> dbg:tpl('_', '_', '_', dbg:fun2ms(fun(_) ->
return_trace() end)).
{ok,[{matched,'ejabberd at 192.168.1.4',14652},{saved,1}]}
(ejabberd at 192.168.1.4)5> dbg:p(list_to_pid("<0.255.0>"), [m]).
{ok,[{matched,'ejabberd at 192.168.1.4',1}]}
(ejabberd at 192.168.1.4)6> dbg:flush_trace_port().
ok
(ejabberd at 192.168.1.4)7> dbg:trace_client(file, "ejabberd.trace2").
<0.331.0>
(ejabberd at 192.168.1.4)8> dbg:trace_client(file, "ejabberd.trace2").
<0.333.0>
(ejabberd at 192.168.1.4)9> dbg:flush_trace_port().
kaiduanx at vmxserver:~/xmpp/ejabberd-2.0.3/tools$ ls -l ejabberd.trace2
-rwxr-xr-x 1 kaiduanx kaiduanx 2210 2009-07-02 21:09 ejabberd.trace2

ok
(ejabberd at 192.168.1.4)10> dbg:trace_client(file, "ejabberd.trace2").
<0.336.0>

kaiduanx at vmxserver:~/xmpp/ejabberd-2.0.3/tools$ ls -l ejabberd.trace2
-rwxr-xr-x 1 kaiduanx kaiduanx 2210 2009-07-02 21:09 ejabberd.trace2

Thanks,

kaiduan

On Thu, Jul 2, 2009 at 3:06 PM, Badlop<badlop at gmail.com> wrote:
> 2009/7/1 Kaiduan Xie <kaiduanx at gmail.com>:
>> but shell did not show anything.
>
> Instead of:
>  ./ejabberdctl start
>  ./ejabberdctl debug
>
> try this:
>  ./ejabberdctl live
>
>
> It would be nice if there's some way to get it working also in debug
> as you pointed.
>
>
> ---
> Badlop
> ProcessOne
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd
>


More information about the ejabberd mailing list