Permalink
Browse files

minor enhancement to output

  • Loading branch information...
1 parent a710a3f commit e769de5ccb5e6b43c6a684a5850dbf9f3f7f0320 masse committed Jan 4, 2007
Showing with 13 additions and 9 deletions.
  1. +7 −2 lib/pan/src/cb_perf.erl
  2. +6 −7 lib/pan/src/panCpu1.erl
View
@@ -17,8 +17,13 @@ requires() -> [{flags, [garbage_collection,procs,running]}, {tps, []}].
doc() -> "populates the cpu time table. "
"not useful on its own. run from pan:perf".
-go([Msg, Line, Out, initial, Tab|_]) when atom(Tab) ->
- go([Msg, Line, Out, #state{tab = Tab}]);
+%%% obsoleted
+%%%go([Msg, Line, Out, initial, Tab|_]) when atom(Tab) ->
+%%% go([Msg, Line, Out, #state{tab = Tab}]);
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+go([Msg, Line, Out, initial|_]) ->
+ panEts:new(?MODULE),
+ go([Msg, Line, Out, #state{tab = ?MODULE}]);
go([end_of_trace, Line, Out, State|_]) ->
State;
go([Msg, Line, Out, State|_]) ->
View
@@ -45,9 +45,8 @@ out({FD, O} = FD_O, [{P, I, Ttot, In, Tgc, Gc}|R]) ->
makem(no_file) -> [];
makem(F) ->
- panEts:new(panCpu1_tmp),
- panScan:file(F, '', {cb, cb_perf, go, [panCpu1_tmp]}),
- strip(summary(panCpu1_tmp)).
+ panScan:file(F, '', cb_perf),
+ strip(summary(cb_perf)).
strip([]) -> [];
strip([E|T]) when tuple(E), size(E) == 6 -> [E|strip(T)];
@@ -76,18 +75,18 @@ tail(Tab, Pid, [H|T]) ->
end|tail(Tab, Pid, T)].
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
collapz(L) ->
- panEts:new(panCpu1, [{keypos, 2}]),
+ panEts:new(?MODULE, [{keypos, 2}]),
keysortr(3, collapse(L)).
-collapse([]) -> ets_t2l(panCpu1);
+collapse([]) -> ets_t2l(?MODULE);
collapse([Obj|R]) ->
case filt(Obj) of
- true -> ets_ins(panCpu1, obj(Obj));
+ true -> ets_ins(?MODULE, obj(Obj));
_ -> ok
end,
collapse(R).
obj({P, I, Tin, In, Tgc, Gc} = Obj) ->
- case ets_lup(panCpu1, I) of
+ case ets_lup(?MODULE, I) of
[] ->
{P, I, add(Tin,Tgc), In, Tgc, Gc};
{N, I, Tin0, In0, Tgc0, Gc0}->

0 comments on commit e769de5

Please sign in to comment.