diff options
author | Siri Hansen <[email protected]> | 2013-06-04 10:57:52 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2013-06-04 10:57:52 +0200 |
commit | c2151dec9f14707ccaba72cb065824ee61c064a5 (patch) | |
tree | d39a451059aa3b618165b72d1c4fa0711fb050d0 /lib/runtime_tools/src/observer_backend.erl | |
parent | 9b04c2649ce98c32335c05e90d501c2e66bb2f0e (diff) | |
parent | 2cf4e22e4916d802d03de5f532bf86e9e8d8934b (diff) | |
download | otp-c2151dec9f14707ccaba72cb065824ee61c064a5.tar.gz otp-c2151dec9f14707ccaba72cb065824ee61c064a5.tar.bz2 otp-c2151dec9f14707ccaba72cb065824ee61c064a5.zip |
Merge branch 'siri/cdv/memory-info/OTP-10604' into maint
* siri/cdv/memory-info/OTP-10604:
[observer] Add mbcs_pool to allocator info in system window
[observer] Add mbcs_pool to allocator summary in crashdump_viewer
observer: Improve initial call info
observer: Add allocator info to gui
[observer] Present Memory for each process in crashdump_viewer
[observer] Add allocator summary in crashdump_viewer
Diffstat (limited to 'lib/runtime_tools/src/observer_backend.erl')
-rw-r--r-- | lib/runtime_tools/src/observer_backend.erl | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/lib/runtime_tools/src/observer_backend.erl b/lib/runtime_tools/src/observer_backend.erl index d1d291d5cb..670e216d97 100644 --- a/lib/runtime_tools/src/observer_backend.erl +++ b/lib/runtime_tools/src/observer_backend.erl @@ -49,6 +49,10 @@ vsn() -> %% observer backend %% sys_info() -> + MemInfo = try erlang:memory() of + Mem -> Mem + catch _:_ -> [] + end, {{_,Input},{_,Output}} = erlang:statistics(io), [{process_count, erlang:system_info(process_count)}, {process_limit, erlang:system_info(process_limit)}, @@ -68,9 +72,16 @@ sys_info() -> {threads, erlang:system_info(threads)}, {thread_pool_size, erlang:system_info(thread_pool_size)}, {wordsize_internal, erlang:system_info({wordsize, internal})}, - {wordsize_external, erlang:system_info({wordsize, external})} | - erlang:memory() - ]. + {wordsize_external, erlang:system_info({wordsize, external})}, + {alloc_info, alloc_info()} + | MemInfo]. + +alloc_info() -> + {_,_,AllocTypes,_} = erlang:system_info(allocator), + try erlang:system_info({allocator_sizes,AllocTypes}) of + Allocators -> Allocators + catch _:_ -> [] + end. get_table(Parent, Table, Module) -> spawn(fun() -> @@ -274,7 +285,7 @@ etop_collect([P|Ps], Acc) -> [{registered_name,Reg},{initial_call,Initial},{memory,Mem}, {reductions,Reds},{current_function,Current},{message_queue_len,Qlen}] -> Name = case Reg of - [] -> Initial; + [] -> initial_call(Initial, P); _ -> Reg end, Info = #etop_proc_info{pid=P,mem=Mem,reds=Reds,name=Name, @@ -283,6 +294,11 @@ etop_collect([P|Ps], Acc) -> end; etop_collect([], Acc) -> Acc. +initial_call({proc_lib, init_p, _}, Pid) -> + proc_lib:translate_initial_call(Pid); +initial_call(Initial, _Pid) -> + Initial. + %% %% ttb backend %% |