diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2011-05-05 16:08:28 +1000 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2011-05-05 16:08:28 +1000 |
commit | dfbfd90f8c38859bda6762fdb9bc0ee2e90975a6 (patch) | |
tree | cf9a2f9646df7ec6bad762d91ffda3d37b56258f /src | |
parent | Do not accept XML with undefined prefixes (EJAB-680) (diff) |
Take into consideration internal queue length when sorting processes queues
Diffstat (limited to 'src')
-rw-r--r-- | src/p1_prof.erl | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/p1_prof.erl b/src/p1_prof.erl index dfa9323a..ff4e94fc 100644 --- a/src/p1_prof.erl +++ b/src/p1_prof.erl @@ -156,10 +156,10 @@ queue(N) -> dump(N, lists:reverse(lists:ukeysort(1, all_pids(queue)))). memory(N) -> - dump(N, lists:reverse(lists:ukeysort(2, all_pids(memory)))). + dump(N, lists:reverse(lists:ukeysort(3, all_pids(memory)))). reds(N) -> - dump(N, lists:reverse(lists:ukeysort(3, all_pids(reductions)))). + dump(N, lists:reverse(lists:ukeysort(4, all_pids(reductions)))). trace(Pid) -> erlang:trace(Pid, true, [send, 'receive']), @@ -299,10 +299,17 @@ all_pids(Type) -> registered_name]) of [{_, Len}, {_, Memory}, {_, Reds}, {_, Dict}, {_, CurFun}, {_, RegName}] -> - if Type == queue andalso Len == 0 -> + IntQLen = case lists:keysearch('$internal_queue_len', 1, Dict) of + {value, {_, N}} -> + N; + _ -> + 0 + end, + if Type == queue andalso Len == 0 andalso IntQLen == 0 -> Acc; true -> - [{Len, Memory, Reds, Dict, CurFun, P, RegName}|Acc] + MaxLen = lists:max([Len, IntQLen]), + [{MaxLen, Len, Memory, Reds, Dict, CurFun, P, RegName}|Acc] end; _ -> Acc @@ -311,7 +318,7 @@ all_pids(Type) -> dump(N, Rs) -> lists:foreach( - fun({MsgQLen, Memory, Reds, Dict, CurFun, Pid, RegName}) -> + fun({_, MsgQLen, Memory, Reds, Dict, CurFun, Pid, RegName}) -> PidStr = pid_to_list(Pid), [_, Maj, Min] = string:tokens( string:substr( |