aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/time.c
diff options
context:
space:
mode:
authorRandolph Chung <tausq@parisc-linux.org>2005-10-21 22:42:18 -0400
committerKyle McMartin <kyle@parisc-linux.org>2005-10-21 22:42:18 -0400
commit5cd55b0edee7f979530c86b23728d461ddeb9f3f (patch)
treea279495f59c8de8bbfdd1bbdfd0b0927160fa669 /arch/parisc/kernel/time.c
parent951a0150135c46c7791d68e0d1112900d99302d7 (diff)
[PARISC] Take into account nullified insn and lock functions for profiling
export profile_pc() symbol - oprofile needs it when built as a module. Signed-off-by: Grant Grundler <grundler@parisc-linux.org> Take into account nullified insn and lock functions for profiling This is needed at the end of functions; it is typical that the return branch nullifies the next insn, which is in the next function. This causes profiling data to show up against the "wrong" function. We also count lock times against the locker. This is consistent with other architectures. Signed-off-by: Randolph Chung <tausq@parisc-linux.org> Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'arch/parisc/kernel/time.c')
-rw-r--r--arch/parisc/kernel/time.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c
index 7ff67f8e9f8c..163cdf39be20 100644
--- a/arch/parisc/kernel/time.c
+++ b/arch/parisc/kernel/time.c
@@ -104,6 +104,24 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
104 return IRQ_HANDLED; 104 return IRQ_HANDLED;
105} 105}
106 106
107
108unsigned long profile_pc(struct pt_regs *regs)
109{
110 unsigned long pc = instruction_pointer(regs);
111
112 if (regs->gr[0] & PSW_N)
113 pc -= 4;
114
115#ifdef CONFIG_SMP
116 if (in_lock_functions(pc))
117 pc = regs->gr[2];
118#endif
119
120 return pc;
121}
122EXPORT_SYMBOL(profile_pc);
123
124
107/*** converted from ia64 ***/ 125/*** converted from ia64 ***/
108/* 126/*
109 * Return the number of micro-seconds that elapsed since the last 127 * Return the number of micro-seconds that elapsed since the last