Workaround for Errata 4504: PMC0 doesn't seem to set SIARLOG when
an exception occurs. Instead, log the PC for when we took the actual
exception.



Index: 2.6.21/arch/powerpc/oprofile/op_model_pa6t.c
===================================================================
--- 2.6.21.orig/arch/powerpc/oprofile/op_model_pa6t.c
+++ 2.6.21/arch/powerpc/oprofile/op_model_pa6t.c
@@ -215,6 +215,9 @@ static void pa6t_handle_interrupt(struct
                        if (oprofile_running && ctr[i].enabled) {
                                if (mmcr0 & PA6T_MMCR0_SIARLOG)
                                        oprofile_add_ext_sample(pc, regs, i, 
is_kernel);
+                               else if (i < 2)
+                                       /* PMC0/1 might not set SIARLOG, just 
log PC at time of fault */
+                                       oprofile_add_ext_sample(regs->nip, 
regs, i, is_kernel);
                                ctr_write(i, reset_value[i]);
                        } else {
                                ctr_write(i, 0UL);

--

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to