Re: [PATCH 1/4] Add support for userspace stacktraces in tracing/iter_ctrl

Török Edwin
2008-10-26T07:04:01Z

On 2008-10-26 06:05, Frédéric Weisbecker wrote:
> Hi Török,
>
> I just read a bit more those two patches about user stack tracing.
> Note that despite the recent changes on the tracing Api
> (ring buffer and other stuff), it still applies well, with some little
> hunks. But it needs some updates to support the last changes.
>
> I adapted the patch and it builds well, but I didn't tested yet.
> However, some parts are "architecture dependent", I guess these
> special pieces would find a better place in the arch directory. So it
> would let a proper and seperated implementation.
>

Hi,

The stacktrace code itself is in the arch directory, did I miss anything
else that should belong there?

arch/x86/kernel/stacktrace.c | 57 +++++++++++++++++++++++++++++++++++
include/linux/stacktrace.h | 8 +++++

> And most arch implement a stacktrace implementation, even if yours
> involve special operations such as copy_from_user, I wonder if the
> already established code couldn't be reused for your needs.
>

I think it would make sense to use oprofile's code of user stacktracing,
there is a backtrace
operation in 'struct oprofile_operations'. Perhaps that could be
extended so that non-oprofile code can call it?
[currently it uses oprofile_add_trace to store the stacktrace]

Best regards,
--Edwin