[erlang-questions] how can I access test_server_loc in the process dict ofanother process?

Steve Kirsch steve.kirsch@REDACTED
Thu Apr 30 18:41:46 CEST 2009


Thanks, I had missed that.

trace can do lots of things, but it won't tell you line numbers unless
I'm mistaken (assuming you've inserted them).

but i do agree that line numbers might be useless for profiling in many
cases, but it can be very very useful.

-----Original Message-----
From: mats cronqvist [mailto:masse@REDACTED] 
Sent: Thursday, April 30, 2009 2:44 AM
To: Steve Kirsch
Cc: Erlang
Subject: Re: how can I access test_server_loc in the process dict
ofanother process?

"Steve Kirsch" <steve.kirsch@REDACTED> writes:

> I wrote a simple statistical profiler that basically snapshots a 
> spawned MFA every 10 msec for 100 samples using process_info(Pid,
> current_function)
>
> that's pretty cool.
>
> But way cooler is to include:
>
> -compile({parse_transform,ct_line}). 
>
> 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.

  process_info(Pid,dictionary).

  allow me to point out that what you're trying to accomplish can be
  done (without recompiling/parse transforms) through tracing.

  mats



More information about the erlang-questions mailing list