• Anton Blanchard's avatar
    [PATCH] ppc64: Add option for oprofile to backtrace through spinlocks · 0c8af7c7
    Anton Blanchard authored
    Now that spinlocks are always out of line, oprofile needs to backtrace
    through them.  The following patch adds this but also adds the ability to
    turn it off (via the backtrace_spinlocks option in oprofilefs).
    
    The backout option is included because the backtracing here is best effort.
     On ppc64 the performance monitor exception is not an NMI, we get them only
    when interrupts are enabled.  This means we can receive a profile hit that
    is inside a spinlock when our PC is somewhere completely
    
    In this patch we check to make sure the PC of the performance monitor
    exception as well as the current PC is inside the spinlock region.  If so
    then we find the callers PC.  If this is not true we play it safe and leave
    the tick inside the lock region.
    
    Also, now that we execute the SLB handler in real mode we have to adjust
    the address range that we consider as valid real mode addresses.  Otherwise
    the SLB miss handler will end up as unknown kernel profile hits.
    Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    0c8af7c7
common.c 4.51 KB