4
%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
4
%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
8
8
%% compliance with the License. You should have received a copy of the
9
9
%% Erlang Public License along with this software. If not, it can be
10
10
%% retrieved online at http://www.erlang.org/.
12
12
%% Software distributed under the License is distributed on an "AS IS"
13
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
%% the License for the specific language governing rights and limitations
15
15
%% under the License.
945
945
dhandler(Trace, Out) when element(1, Trace) == trace, tuple_size(Trace) >= 3 ->
946
946
dhandler1(Trace, tuple_size(Trace), Out);
947
947
dhandler(Trace, Out) when element(1, Trace) == trace_ts, tuple_size(Trace) >= 4 ->
948
dhandler1(Trace, tuple_size(Trace)-1, Out);
948
dhandler1(Trace, tuple_size(Trace)-1, element(tuple_size(Trace),Trace), Out);
949
949
dhandler(Trace, Out) when element(1, Trace) == drop, tuple_size(Trace) =:= 2 ->
950
950
io:format(Out, "*** Dropped ~p messages.~n", [element(2,Trace)]),
980
980
dhandler1(Trace, Size, Out) ->
982
981
From = element(2, Trace),
983
982
case element(3, Trace) of
985
984
case element(4, Trace) of
987
Message -> io:format(Out, "(~p) << ~p~n", [From,Message])
987
io:format(Out, "(~p) << ~p~n", [From,Message])
990
990
Message = element(4, Trace),
991
case element(5, Trace) of
992
%%%! This causes messages to disappear when used by ttb (observer). Tests
993
%%%! so far show that there is no difference in results with dbg even if I
994
%%%! comment it out, so I hope this is only some old code which isn't
995
%%%! needed anymore... /siri
997
To -> io:format(Out, "(~p) ~p ! ~p~n", [From,To,Message])
991
To = element(5, Trace),
992
io:format(Out, "(~p) ~p ! ~p~n", [From,To,Message]);
1000
994
case element(4, Trace) of
1001
995
MFA when Size == 5 ->
1025
dhandler1(Trace, Size, TS, Out) ->
1026
From = element(2, Trace),
1027
case element(3, Trace) of
1029
case element(4, Trace) of
1032
io:format(Out, "(~p) << ~p (Timestamp: ~p)~n", [From,Message,TS])
1035
Message = element(4, Trace),
1036
To = element(5, Trace),
1037
io:format(Out, "(~p) ~p ! ~p (Timestamp: ~p)~n", [From,To,Message,TS]);
1039
case element(4, Trace) of
1040
MFA when Size == 5 ->
1041
Message = element(5, Trace),
1042
io:format(Out, "(~p) call ~s (~p) (Timestamp: ~p)~n", [From,ffunc(MFA),Message,TS]);
1044
io:format(Out, "(~p) call ~s (Timestamp: ~p)~n", [From,ffunc(MFA),TS])
1046
return -> %% To be deleted...
1047
case element(4, Trace) of
1048
MFA when Size == 5 ->
1049
Ret = element(5, Trace),
1050
io:format(Out, "(~p) old_ret ~s -> ~p (Timestamp: ~p)~n", [From,ffunc(MFA),Ret,TS]);
1052
io:format(Out, "(~p) old_ret ~s (Timestamp: ~p)~n", [From,ffunc(MFA),TS])
1055
MFA = element(4, Trace),
1056
Ret = element(5, Trace),
1057
io:format(Out, "(~p) returned from ~s -> ~p (Timestamp: ~p)~n", [From,ffunc(MFA),Ret,TS]);
1059
MFA = element(4, Trace),
1060
io:format(Out, "(~p) returning to ~s (Timestamp: ~p)~n", [From,ffunc(MFA),TS]);
1061
spawn when Size == 5 ->
1062
Pid = element(4, Trace),
1063
MFA = element(5, Trace),
1064
io:format(Out, "(~p) spawn ~p as ~s (Timestamp: ~p)~n", [From,Pid,ffunc(MFA),TS]);
1066
io:format(Out, "(~p) ~p ~s (Timestamp: ~p)~n", [From,Op,ftup(Trace,4,Size),TS])
1033
1072
%%% These f* functions returns non-flat strings