projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] powerpc: Add oprofile calltrace support
[powerpc.git]
/
arch
/
powerpc
/
oprofile
/
op_model_power4.c
diff --git
a/arch/powerpc/oprofile/op_model_power4.c
b/arch/powerpc/oprofile/op_model_power4.c
index
e3a024e
..
38db2ef
100644
(file)
--- a/
arch/powerpc/oprofile/op_model_power4.c
+++ b/
arch/powerpc/oprofile/op_model_power4.c
@@
-10,11
+10,11
@@
#include <linux/oprofile.h>
#include <linux/init.h>
#include <linux/smp.h>
#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>
#include <asm/cputable.h>
#include <asm/ptrace.h>
#include <asm/system.h>
#include <asm/processor.h>
#include <asm/cputable.h>
-#include <asm/systemcfg.h>
#include <asm/rtas.h>
#include <asm/oprofile_impl.h>
#include <asm/reg.h>
#include <asm/rtas.h>
#include <asm/oprofile_impl.h>
#include <asm/reg.h>
@@
-233,7
+233,7
@@
static unsigned long get_pc(struct pt_regs *regs)
mmcra = mfspr(SPRN_MMCRA);
/* Were we in the hypervisor? */
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);
/* function descriptor madness */
return *((unsigned long *)hypervisor_bucket);
@@
-253,7
+253,7
@@
static unsigned long get_pc(struct pt_regs *regs)
return (unsigned long)__va(pc);
/* Not sure where we were */
return (unsigned long)__va(pc);
/* Not sure where we were */
- if (
pc < KERNELBASE
)
+ if (
!is_kernel_addr(pc)
)
/* function descriptor madness */
return *((unsigned long *)kernel_unknown_bucket);
/* function descriptor madness */
return *((unsigned long *)kernel_unknown_bucket);
@@
-265,7
+265,7
@@
static int get_kernel(unsigned long pc)
int is_kernel;
if (!mmcra_has_sihv) {
int is_kernel;
if (!mmcra_has_sihv) {
- is_kernel =
(pc >= KERNELBASE
);
+ is_kernel =
is_kernel_addr(pc
);
} else {
unsigned long mmcra = mfspr(SPRN_MMCRA);
is_kernel = ((mmcra & MMCRA_SIPR) == 0);
} else {
unsigned long mmcra = mfspr(SPRN_MMCRA);
is_kernel = ((mmcra & MMCRA_SIPR) == 0);
@@
-293,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) {
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);
ctr_write(i, reset_value[i]);
} else {
ctr_write(i, 0);