Erlang/OTP Forums

Author Message

<  Erlang  ~  how to get information about an erlang process(all kinds)

aniketa
Posted: Tue Dec 23, 2008 12:18 pm Reply with quote
Joined: 10 Nov 2008 Posts: 3 Location: india
hi everyone,
how do we get process information of a process ... i've wriiten a code Shocked but i dont think so its proper in my needs as i want the module written to display the cpu usage by the process , n wat type of process it is , n it shd tell the reason of process termination ..
here is my code .. i m new to erlang so please help me ..
-module(getting_process_info).
-export([start/1]).

-import(lists,[member/2]).

start(Process) ->
Process_set = erlang:processes(),
case member(Process,Process_set) of
true ->
io:format("lucky u [Smile] ~n",[]),
io:format("the process u entered is ~w~n",[Process]),
io:format("Process info ~p~n",[erlang:process_info(Process)]),
io:format("links ~w~n",[erlang:process_info(Process,links)]),
{_,Links} = erlang:process_info(Process,links),
get_link_info(Links);

false ->
io:format("unlucky u Sad ~n",[])
end.

get_link_info([]) -> io:format("~n",[]);

get_link_info([H|T]) ->
io:format("Process info ~p~n",[erlang:process_info(H)]),
get_link_info(T).

wat is cpu_sup used for n how to use the various function ..
View user's profile Send private message Yahoo Messenger

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum