This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / arch / ppc64 / oprofile / op_model_power4.c
index 4f8bf02..b2a512c 100644 (file)
@@ -32,13 +32,6 @@ static u32 mmcr0_val;
 static u64 mmcr1_val;
 static u32 mmcra_val;
 
-/*
- * Since we do not have an NMI, backtracing through spinlocks is
- * only a best guess. In light of this, allow it to be disabled at
- * runtime.
- */
-static int backtrace_spinlocks;
-
 static void power4_reg_setup(struct op_counter_config *ctr,
                             struct op_system_config *sys,
                             int num_ctrs)
@@ -66,8 +59,6 @@ static void power4_reg_setup(struct op_counter_config *ctr,
        mmcr1_val = sys->mmcr1;
        mmcra_val = sys->mmcra;
 
-       backtrace_spinlocks = sys->backtrace_spinlocks;
-
        for (i = 0; i < num_counters; ++i)
                reset_value[i] = 0x80000000UL - ctr[i].count;
 
@@ -179,38 +170,19 @@ static void __attribute_used__ kernel_unknown_bucket(void)
 {
 }
 
-static unsigned long check_spinlock_pc(struct pt_regs *regs,
-                                      unsigned long profile_pc)
-{
-       unsigned long pc = instruction_pointer(regs);
-
-       /*
-        * If both the SIAR (sampled instruction) and the perfmon exception
-        * occurred in a spinlock region then we account the sample to the
-        * calling function. This isnt 100% correct, we really need soft
-        * IRQ disable so we always get the perfmon exception at the
-        * point at which the SIAR is set.
-        */
-       if (backtrace_spinlocks && in_lock_functions(pc) &&
-                       in_lock_functions(profile_pc))
-               return regs->link;
-       else
-               return profile_pc;
-}
-
 /*
  * On GQ and newer the MMCRA stores the HV and PR bits at the time
  * the SIAR was sampled. We use that to work out if the SIAR was sampled in
  * the hypervisor, our exception vectors or RTAS.
  */
-static unsigned long get_pc(struct pt_regs *regs)
+static unsigned long get_pc(void)
 {
        unsigned long pc = mfspr(SPRN_SIAR);
        unsigned long mmcra;
 
        /* Cant do much about it */
        if (!mmcra_has_sihv)
-               return check_spinlock_pc(regs, pc);
+               return pc;
 
        mmcra = mfspr(SPRN_MMCRA);
 
@@ -224,6 +196,10 @@ static unsigned long get_pc(struct pt_regs *regs)
        if (mmcra & MMCRA_SIPR)
                return pc;
 
+       /* Were we in our exception vectors? */
+       if (pc < 0x4000UL)
+               return (unsigned long)__va(pc);
+
 #ifdef CONFIG_PPC_PSERIES
        /* Were we in RTAS? */
        if (pc >= rtas.base && pc < (rtas.base + rtas.size))
@@ -231,16 +207,12 @@ static unsigned long get_pc(struct pt_regs *regs)
                return *((unsigned long *)rtas_bucket);
 #endif
 
-       /* Were we in our exception vectors or SLB real mode miss handler? */
-       if (pc < 0x1000000UL)
-               return (unsigned long)__va(pc);
-
        /* Not sure where we were */
        if (pc < KERNELBASE)
                /* function descriptor madness */
                return *((unsigned long *)kernel_unknown_bucket);
 
-       return check_spinlock_pc(regs, pc);
+       return pc;
 }
 
 static int get_kernel(unsigned long pc)
@@ -267,7 +239,7 @@ static void power4_handle_interrupt(struct pt_regs *regs,
        unsigned int cpu = smp_processor_id();
        unsigned int mmcr0;
 
-       pc = get_pc(regs);
+       pc = get_pc();
        is_kernel = get_kernel(pc);
 
        /* set the PMM bit (see comment below) */