1 -module(beam_stats_process).
3 -include("include/beam_stats_process.hrl").
28 -spec of_pid(pid()) ->
31 Dict = pid_info_exn(Pid, dictionary),
34 , registered_name = pid_info_opt(Pid, registered_name)
35 , raw_initial_call = pid_info_exn(Pid, initial_call)
36 , otp_initial_call = hope_kv_list:get(Dict, '$initial_call')
37 , otp_ancestors = hope_kv_list:get(Dict, '$ancestors')
38 , status = pid_info_exn(Pid, status)
39 , memory = pid_info_exn(Pid, memory)
40 , total_heap_size = pid_info_exn(Pid, total_heap_size)
41 , stack_size = pid_info_exn(Pid, stack_size)
42 , message_queue_len = pid_info_exn(Pid, message_queue_len)
45 pid_info_exn(Pid, Key) ->
46 {some, Value} = pid_info_opt(Pid, Key),
49 pid_info_opt(Pid, Key) ->
50 case {Key, erlang:process_info(Pid, Key)}
51 of {registered_name, []} -> none
52 ; {_ , {Key, Value}} -> {some, Value}