Commit 5af14ab5 authored by Zwane Mwaikambo's avatar Zwane Mwaikambo Committed by Linus Torvalds

[PATCH] OProfile: Use profile_pc in oprofile_add_sample

We should be using profile_pc in oprofile_add_sample so that lock
contention is attibuted to the correct function in profile output.  Also
fix SH7750 support.
Signed-off-by: default avatarZwane Mwaikambo <zwane@fsmlabs.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent d5290d88
......@@ -112,14 +112,9 @@ static struct op_counter_config ctr[NR_CNTRS];
*/
static int sh7750_timer_notify(struct notifier_block *self,
unsigned long val, void *data)
unsigned long val, void *regs)
{
struct pt_regs *regs = data;
unsigned long pc;
pc = instruction_pointer(regs);
oprofile_add_sample(pc, !user_mode(regs), 0, smp_processor_id());
oprofile_add_sample((struct pt_regs *)regs, 0);
return 0;
}
......
......@@ -233,7 +233,7 @@ static void oprofile_end_trace(struct oprofile_cpu_buffer * cpu_buf)
void oprofile_add_sample(struct pt_regs * const regs, unsigned long event)
{
struct oprofile_cpu_buffer * cpu_buf = &cpu_buffer[smp_processor_id()];
unsigned long pc = instruction_pointer(regs);
unsigned long pc = profile_pc(regs);
int is_kernel = !user_mode(regs);
if (!backtrace_depth) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment