aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools/src/eprof.erl
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2010-06-09 16:36:56 +0200
committerBjörn-Egil Dahlberg <[email protected]>2010-06-09 16:37:24 +0200
commit7b2c17955337b6c171e43c4eddb44508a8667bb8 (patch)
treed4a8c839c86081958b092a67193f60d1f482e85e /lib/tools/src/eprof.erl
parentb630e2762b06b14f8c0d40c5d0075156cace001d (diff)
downloadotp-7b2c17955337b6c171e43c4eddb44508a8667bb8.tar.gz
otp-7b2c17955337b6c171e43c4eddb44508a8667bb8.tar.bz2
otp-7b2c17955337b6c171e43c4eddb44508a8667bb8.zip
Dialyzer cleanup for eprof
Diffstat (limited to 'lib/tools/src/eprof.erl')
-rw-r--r--lib/tools/src/eprof.erl22
1 files changed, 6 insertions, 16 deletions
diff --git a/lib/tools/src/eprof.erl b/lib/tools/src/eprof.erl
index 6a0bd9ff9c..bb082a4c66 100644
--- a/lib/tools/src/eprof.erl
+++ b/lib/tools/src/eprof.erl
@@ -348,12 +348,12 @@ set_process_trace(Flag, Pids) ->
set_process_trace(_, [], _) -> true;
set_process_trace(Flag, [Pid|Pids], Options) when is_pid(Pid) ->
try
- erlang:trace(Pid, Flag, Options)
+ erlang:trace(Pid, Flag, Options),
+ set_process_trace(Flag, Pids, Options)
catch
_:_ ->
false
- end,
- set_process_trace(Flag, Pids, Options);
+ end;
set_process_trace(Flag, [Name|Pids], Options) when is_atom(Name) ->
case whereis(Name) of
undefined ->
@@ -466,10 +466,10 @@ print_bp_mfa(Mfas, {_Tn, Tus}, Fd, Opts) ->
erlang:max(length("TIME"), TimeW),
erlang:max(length("uS / CALLS"), TpCW)
},
- print(Fd, Ws, ["FUNCTION", "CALLS", " %", "TIME", "uS / CALLS"]),
- print(Fd, Ws, ["--------", "-----", "---", "----", "----------"]),
+ format(Fd, Ws, ["FUNCTION", "CALLS", " %", "TIME", "uS / CALLS"]),
+ format(Fd, Ws, ["--------", "-----", "---", "----", "----------"]),
- lists:foreach(fun (String) -> print(Fd, Ws, String) end, Strs),
+ lists:foreach(fun (String) -> format(Fd, Ws, String) end, Strs),
ok.
s({M,F,A}) -> s("~w:~w/~w",[M,F,A]);
@@ -477,16 +477,6 @@ s(Term) -> s("~p", [Term]).
s(Format, Terms) -> lists:flatten(io_lib:format(Format, Terms)).
-print(Fd, [_,_,_] = Strings) ->
- print(Fd, "~.44s ~14s ~14s~n", Strings);
-print(Fd, [_,_,_,_] = Strings) ->
- print(Fd, "~.44s ~14s ~14s ~7s ~n", Strings);
-print(Fd, Strings) ->
- print(Fd, "~.44s ~14s ~14s ~7s [~7s]~n", Strings).
-print(Fd, Format, Strings) ->
- format(Fd, Format, Strings).
-
-
format(Fd, {MfaW, CountW, PercW, TimeW, TpCW}, Strings) ->
format(Fd, s("~~.~ps ~~~ps ~~~ps ~~~ps [~~~ps]~~n", [MfaW, CountW, PercW, TimeW, TpCW]), Strings);
format(undefined, Format, Strings) ->