Re: [PATCH 1/2] x86: make save_stack_address()!CONFIG_FRAME_POINTER friendly

From: Oleg Nesterov
Date: Thu Jun 03 2010 - 17:01:24 EST


On 06/03, Frederic Weisbecker wrote:
>
> On Thu, Jun 03, 2010 at 10:31:55PM +0200, Oleg Nesterov wrote:
> >
> > Do you mean it makes sense to add the helper which depends on
> > FRAME_POINTER ?
>
> Having in asm/stacktrace.h:
>
> #ifdef CONFIG_FRAME_POINTER
> static inline int reliable_frame_pointer(int reliable)
> {
> return reliable;
> }
> #else
> static inline int reliable_frame_pointer(int reliable)
> {
> return 1;
> }
> #endif
>
> But if we have only one user I'm not sure it's worth it.

Me too ;) let's ignore this.

> > Frederic, Arjan. Honestly, I have no opinion if this change makes
> > things better or worse for, say, lockdep.
> >
> > But note that this only affects the !CONFIG_FRAME_POINTER case.
> > Looking into Kconfig's I don't even understand how the bug reporters
> > managed to set CONFIG_STACKTRACE without !CONFIG_FRAME_POINTER.
> >
> > So, should I redo this patch to fix /proc/pid/stack ? Say, we
> > can change the meaning of stack_trace-<skip, if it is < 0, then
> > save_stack_address() ignores reliable. Yes, this is hack.
>
>
> No, people may want to ignore reliable and also to skip
> entries.

Yes, but currently stack_trace->skip is always >= 0. So I think
this should work

skip > 0 - skip that much entries, consider reliable
skip == 0 - don't skip, consider reliable
skip < 0 - skip nothing

But yes, I do not like this idea too much. I was going to use this
hack if this patch is nacked.

> I think your patches as is are the right way to go: by default provide
> as much information as we can.
>
> And those who care about reliability can use their own stack ops, which
> is what perf does for example. If needed we can still add a new
> save_stack_trace_reliable() in the future.

Great. Thanks!

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/