Commit 4eca1f90 authored by Zwane Mwaikambo's avatar Zwane Mwaikambo Committed by Linus Torvalds

[PATCH] out-of-line locks / arm

Signed-off-by: default avatarZwane Mwaikambo <zwane@fsmlabs.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 50658d33
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/leds.h> #include <asm/leds.h>
#include <asm/thread_info.h>
#include <asm/mach/time.h> #include <asm/mach/time.h>
u64 jiffies_64 = INITIAL_JIFFIES; u64 jiffies_64 = INITIAL_JIFFIES;
...@@ -52,6 +52,21 @@ EXPORT_SYMBOL(rtc_lock); ...@@ -52,6 +52,21 @@ EXPORT_SYMBOL(rtc_lock);
/* change this if you have some constant time drift */ /* change this if you have some constant time drift */
#define USECS_PER_JIFFY (1000000/HZ) #define USECS_PER_JIFFY (1000000/HZ)
#ifdef CONFIG_SMP
unsigned long profile_pc(struct pt_regs *regs)
{
unsigned long fp, pc = instruction_pointer(regs);
if (pc >= (unsigned long)&__lock_text_start &&
pc <= (unsigned long)&__lock_text_end) {
fp = thread_saved_fp(current);
pc = pc_pointer(((unsigned long *)fp)[-1]);
}
return pc;
}
EXPORT_SYMBOL(profile_pc);
#endif
/* /*
* hook for setting the RTC's idea of the current time. * hook for setting the RTC's idea of the current time.
......
...@@ -71,6 +71,7 @@ SECTIONS ...@@ -71,6 +71,7 @@ SECTIONS
_text = .; /* Text and read-only data */ _text = .; /* Text and read-only data */
*(.text) *(.text)
SCHED_TEXT SCHED_TEXT
LOCK_TEXT
*(.fixup) *(.fixup)
*(.gnu.warning) *(.gnu.warning)
*(.rodata) *(.rodata)
......
...@@ -343,7 +343,7 @@ static void inline __xsc2_check_ctrs(void) ...@@ -343,7 +343,7 @@ static void inline __xsc2_check_ctrs(void)
static irqreturn_t xscale_pmu_interrupt(int irq, void *arg, struct pt_regs *regs) static irqreturn_t xscale_pmu_interrupt(int irq, void *arg, struct pt_regs *regs)
{ {
unsigned long eip = instruction_pointer(regs); unsigned long pc = profile_pc(regs);
int i, is_kernel = !user_mode(regs); int i, is_kernel = !user_mode(regs);
u32 pmnc; u32 pmnc;
...@@ -357,7 +357,7 @@ static irqreturn_t xscale_pmu_interrupt(int irq, void *arg, struct pt_regs *regs ...@@ -357,7 +357,7 @@ static irqreturn_t xscale_pmu_interrupt(int irq, void *arg, struct pt_regs *regs
continue; continue;
write_counter(i, -(u32)results[i].reset_counter); write_counter(i, -(u32)results[i].reset_counter);
oprofile_add_sample(eip, is_kernel, i, smp_processor_id()); oprofile_add_sample(pc, is_kernel, i, smp_processor_id());
results[i].ovf--; results[i].ovf--;
} }
......
...@@ -130,7 +130,12 @@ static inline int valid_user_regs(struct pt_regs *regs) ...@@ -130,7 +130,12 @@ static inline int valid_user_regs(struct pt_regs *regs)
#define instruction_pointer(regs) \ #define instruction_pointer(regs) \
(pc_pointer((regs)->ARM_pc)) (pc_pointer((regs)->ARM_pc))
#ifdef CONFIG_SMP
extern unsigned long profile_pc(struct pt_regs *regs);
#else
#define profile_pc(regs) instruction_pointer(regs) #define profile_pc(regs) instruction_pointer(regs)
#endif
#ifdef __KERNEL__ #ifdef __KERNEL__
extern void show_regs(struct pt_regs *); extern void show_regs(struct pt_regs *);
......
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