Re: 2.6.22.6 + oprofile oops

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linux kernel Mailing List <linux-kernel@...>, oprofile Mailing List <oprofile-list@...>
Cc: Sami Farin <safari-kernel@...>, Andi Kleen <ak@...>
Date: Thursday, October 11, 2007 - 10:36 am

On Sat, 29 Sep 2007 at 20:05 +0000, Sami Farin wrote:

...

On the per cpu buffer writer side oprofile_add_sample() use profile_pc()
to get the eip, profile_pc() can return ~0lu, but an eip == ~0lu is a
magic value = ESCAPE_CODE. The per cpu reader side in buffer_sync.c use
this value to know that the associated data is a task pointer but here
the associated data is a counter number.

This has already been reported two years ago by Jesse Barnes on the same
sort of box, pentium D. This is not reproducible on a duo core nor I was
able to on a P4 box two years ago, I dunno why. Anyway profile_pc() is
broken() on both i386/x86_64, w/o frame pointer. For i386:

000000b0 <_spin_lock_bh>:
  b0:   53                      push   %ebx /* break profile_pc() */
  b1:   89 c3                   mov    %eax,%ebx

On x86_64 it's broken with or w/o frame pointer.

I understand the motivation to get the eip calling a spinlock function,
but that's a cheat and it has a price. Beside that, the trouble is also
on oprofile side, magic value are evil. This bug exists since at least
2.6.13.

Sami can you try the attached patch, the chunk in buffer_sync.c is
here only to avoid oopsing if another problem exists somewhere.


-- 
Phe
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.22.6 + oprofile oops, Sami Farin, (Sat Sep 22, 7:23 am)
Re: 2.6.22.6 + oprofile oops, Andi Kleen, (Mon Oct 1, 6:29 am)
Re: 2.6.22.6 + oprofile oops, Ingo Molnar, (Mon Oct 1, 10:47 am)
Re: 2.6.22.6 + oprofile oops, Sami Farin, (Mon Oct 1, 9:22 am)
Re: 2.6.22.6 + oprofile oops, Sami Farin, (Sat Sep 29, 1:05 pm)
Re: 2.6.22.6 + oprofile oops, Philippe Elie, (Thu Oct 11, 10:36 am)
Re: 2.6.22.6 + oprofile oops, Sami Farin, (Thu Oct 11, 2:09 pm)