Re: [PATCH] Add kernel support for oprofile callgraphs on AVR32

From: Haavard Skinnemoen
Date: Wed Sep 03 2008 - 07:03:21 EST


"Voss, Nikolaus" <N.Voss@xxxxxxxxxxx> wrote:
> Hi,
>
> > Hmm. This appears to be the third backtracer added to avr32, the first
> > two being dump_stack() and friends in arch/avr32/kernel/process.c, and
> > save_stack_trace() in arch/avr32/kernel/stacktrace.c.
> >
> > Would be nice if some of this could be consolidated.
>
> I considered using one of them, in fact I also have a version with an
> extended stacktrace.c. But due to the small size of the kernel stacktracer
> (only a few lines), I found it cleaner to create a separate version. The
> overall size is smaller and it cannot potentially mess up other things.
> Cf. e.g. the x86 tracer which is of the generic type, but comparatively big
> and hard to follow through the places.

Good point.

> > > + /* Assume we have frame pointers in user mode process */
> >
> > What happens if we don't? I assume it will stop when it detects that
> > the frame pointer isn't monotonically increasing or when it gets a
> > fault?
>
> Right. This might lead to false information in oprofile, this case is
> described in the oprofile docs.

Ok.

I've applied it to the avr32 tree along with a couple of trivial
checkpatch fixes. There's one remaining warning:

WARNING: externs should be avoided in .c files
#125: FILE: arch/avr32/oprofile/op_model_avr32.c:25:
+void avr32_backtrace(struct pt_regs * const regs, unsigned int depth);

total: 0 errors, 1 warnings, 102 lines checked

We should probably add a header file somewhere, but I'm too lazy to do
it right now.

Haavard
--
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/