[PATCH] powerpc: Add oprofile calltrace support
[powerpc.git] / arch / powerpc / oprofile / op_model_power4.c
index 659a021..38db2ef 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/oprofile.h>
 #include <linux/init.h>
 #include <linux/smp.h>
+#include <asm/firmware.h>
 #include <asm/ptrace.h>
 #include <asm/system.h>
 #include <asm/processor.h>
@@ -232,7 +233,7 @@ static unsigned long get_pc(struct pt_regs *regs)
        mmcra = mfspr(SPRN_MMCRA);
 
        /* Were we in the hypervisor? */
-       if (platform_is_lpar() && (mmcra & MMCRA_SIHV))
+       if (firmware_has_feature(FW_FEATURE_LPAR) && (mmcra & MMCRA_SIHV))
                /* function descriptor madness */
                return *((unsigned long *)hypervisor_bucket);
 
@@ -292,7 +293,7 @@ static void power4_handle_interrupt(struct pt_regs *regs,
                val = ctr_read(i);
                if (val < 0) {
                        if (oprofile_running && ctr[i].enabled) {
-                               oprofile_add_pc(pc, is_kernel, i);
+                               oprofile_add_ext_sample(pc, regs, i, is_kernel);
                                ctr_write(i, reset_value[i]);
                        } else {
                                ctr_write(i, 0);