aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPiotr Dorobisz <[email protected]>2011-03-09 11:08:54 +0100
committerHenrik Nord <[email protected]>2011-08-30 15:22:16 +0200
commit7124b6dcc53e521619adfe9c8bc9e0738591c839 (patch)
treeed2f7bd6e28121b5de1b27575ce9c3385ba54789 /lib
parent80a78effcae7d20d86543081ae678bfe3316961f (diff)
downloadotp-7124b6dcc53e521619adfe9c8bc9e0738591c839.tar.gz
otp-7124b6dcc53e521619adfe9c8bc9e0738591c839.tar.bz2
otp-7124b6dcc53e521619adfe9c8bc9e0738591c839.zip
ttb:stop([return]) should imply fetching the data
Diffstat (limited to 'lib')
-rw-r--r--lib/observer/src/ttb.erl12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/observer/src/ttb.erl b/lib/observer/src/ttb.erl
index 7e2f835a08..f52b4f33fa 100644
--- a/lib/observer/src/ttb.erl
+++ b/lib/observer/src/ttb.erl
@@ -469,10 +469,12 @@ stop(Opts) ->
stop_return(Result,Opts).
stop_opts(Opts) ->
- case lists:member(format,Opts) of
- true ->
+ case {lists:member(format,Opts), lists:member(return, Opts)} of
+ {true, _} ->
format; % format implies fetch
- false ->
+ {_, true} ->
+ fetch; % if we specify return, the data should be fetched
+ _ ->
case lists:member(fetch,Opts) of
true -> fetch;
false -> nofetch
@@ -881,7 +883,7 @@ init_collector(Fd,Clients) ->
Collected = get_first(Clients),
collector(Fd,sort(Collected)).
-collector(Fd,[{_,{Client,{Trace,State}}}|Rest]) ->
+collector(Fd,[{_,{Client,{Trace,State}}} |Rest]) ->
Trace1 = update_procinfo(Trace),
State1 = handler1(Trace1,{Fd,State}),
case get_next(Client,State1) of
@@ -917,7 +919,7 @@ update_procinfo(Trace) ->
ProcInfo = get_procinfo(Pid),
setelement(2,Trace,ProcInfo).
-get_procinfo(Pid) when is_pid(Pid) ->
+get_procinfo(Pid) when is_pid(Pid); is_port(Pid) ->
case ets:lookup(?MODULE,Pid) of
[PI] -> PI;
[] -> Pid