> Would it be plausible to somehow, get the (ruby) stack of the running rub=
y process (or a particular thread), periodically? =A0For example, every 10 =
seconds.
>
> One approach might be to have a separate thread with a timer that popped =
and it would get the current stack for a particular thread (not itself).
>
> The overall objective is to have a very light weight (low impact) techniq=
ue for profiling a Rails app as it is running in production. =A0Over the co=
urse of a week, for example, gather enough statistics to understand where t=
he app is spending the most time.
>
> Of course, the other question is: has this already been done? =A0(I could=
n't find anything.)

I don't think it has.  1.9.x provides you a Thread#backtrace so it
should be possible just using that.  I've been meaning to incorporate
it into the
ruby-prof gem, and will put it on the backlog...
https://github.com/danielhoey/ruby-prof might already do it.
-r