Re: [mm patch] oprofile: backtrace operation does not initialized

From: Philippe Elie
Date: Wed Dec 08 2004 - 18:57:19 EST


On Thu, 09 Dec 2004 at 09:31 +0000, Greg Banks wrote:

> On Wed, Dec 08, 2004 at 04:00:55PM +0000, John Levon wrote:
> > On Wed, Dec 08, 2004 at 06:30:51PM +0900, Akinobu Mita wrote:
> >
> > > When I forced the oprofile to use timer interrupt with specifying
> > > "timer=1" module parameter. "oprofile_operations->backtrace" did
> > > not initialized on i386.
> > >
> > > Please apply this patch, or make oprofile initialize the backtrace
> > > operation in case of using timer interrupt in your preferable way.
> >
> > I don't like this patch. The arches should just set the backtrace
> > always, then try to init the hardware. oprofile_init() should then force
> > the timer ops as needed.
> >
> > Greg?
>
> Agreed, that's a cleaner approach. The attached patch (untested)
> implements that. Akinobu-san, can you please test the patch?

> +++ linux/drivers/oprofile/oprof.c 2004-12-09 09:25:02.%N +1100
> @@ -155,13 +155,11 @@ static int __init oprofile_init(void)
> {
> int err = 0;
>
> - /* this is our fallback case */
> - oprofile_timer_init(&oprofile_ops);
> + oprofile_arch_init(&oprofile_ops);

oprofile_arch_init() --> nmi_init() which setup oprofile_ops->setup/shutdown
etc.

> if (timer) {
> printk(KERN_INFO "oprofile: using timer interrupt.\n");
> - } else {
> - oprofile_arch_init(&oprofile_ops);
> + oprofile_timer_init(&oprofile_ops);
> }

oprofile_timer_init doesn't reset op->setup/shutdown, I don't like the idea to
reset them in oprofile_timer_init() it's error prone. John any idea ?

--
Philippe Elie

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