[erlang-questions] how can I access test_server_loc in the process dict of another process?
Thu Apr 30 09:17:57 CEST 2009
I wrote a simple statistical profiler that basically snapshots a spawned
MFA every 10 msec for 100 samples using process_info(Pid,
that's pretty cool.
But way cooler is to include:
in the module I want to statistically profile.
This essentially pushes your M, F, line number in the process dictionary
(under key test_server_loc) each time you execute a line of code
(replacing it if in the same function so you get a call stack more or
less to a max depth of 10).
That's way cool.
So I'd like to access that key (test_server_loc) from my statistical
profiler which is running in another process.
How can I access that key? there isn't a get(test_server_loc, Pid) BIF.
P.S. Here's my statistical profiler and test function... this all works
% statistical profiler. Spawns the MFA and then takes 100 samples, 10
sprof(M, F, A)->
case process_info(Pid, current_function) of
undefined -> x
sprof(?MODULE, sprof_test, ).
More information about the erlang-questions