* [PATCH][1/3] Completely out of line spinlocks / generic
@ 2004-08-30 4:43 Zwane Mwaikambo
2004-08-30 5:02 ` Zwane Mwaikambo
0 siblings, 1 reply; 3+ messages in thread
From: Zwane Mwaikambo @ 2004-08-30 4:43 UTC (permalink / raw)
To: Linux Kernel; +Cc: Andrew Morton, Linus Torvalds, Matt Mackall, Andi Kleen
drivers/oprofile/timer_int.c | 2 +-
include/asm-generic/vmlinux.lds.h | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
Signed-off-by: Zwane Mwaikambo <zwane@fsmlabs.com>
Index: linux-2.6.9-rc1-mm1/include/asm-generic/vmlinux.lds.h
===================================================================
RCS file: /home/cvsroot/linux-2.6.9-rc1-mm1/include/asm-generic/vmlinux.lds.h,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 vmlinux.lds.h
--- linux-2.6.9-rc1-mm1/include/asm-generic/vmlinux.lds.h 26 Aug 2004 13:13:09 -0000 1.1.1.1
+++ linux-2.6.9-rc1-mm1/include/asm-generic/vmlinux.lds.h 28 Aug 2004 20:00:47 -0000
@@ -80,3 +80,8 @@
VMLINUX_SYMBOL(__sched_text_start) = .; \
*(.sched.text) \
VMLINUX_SYMBOL(__sched_text_end) = .;
+
+#define SPINLOCK_TEXT \
+ VMLINUX_SYMBOL(__spinlock_text_start) = .; \
+ *(.spinlock.text) \
+ VMLINUX_SYMBOL(__spinlock_text_end) = .;
Index: linux-2.6.9-rc1-mm1/drivers/oprofile/timer_int.c
===================================================================
RCS file: /home/cvsroot/linux-2.6.9-rc1-mm1/drivers/oprofile/timer_int.c,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 timer_int.c
--- linux-2.6.9-rc1-mm1/drivers/oprofile/timer_int.c 26 Aug 2004 13:13:41 -0000 1.1.1.1
+++ linux-2.6.9-rc1-mm1/drivers/oprofile/timer_int.c 28 Aug 2004 20:00:47 -0000
@@ -19,7 +19,7 @@ static int timer_notify(struct notifier_
{
struct pt_regs * regs = (struct pt_regs *)data;
int cpu = smp_processor_id();
- unsigned long eip = instruction_pointer(regs);
+ unsigned long eip = profile_pc(regs);
oprofile_add_sample(eip, !user_mode(regs), 0, cpu);
return 0;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][1/3] Completely out of line spinlocks / generic
2004-08-30 4:43 [PATCH][1/3] Completely out of line spinlocks / generic Zwane Mwaikambo
@ 2004-08-30 5:02 ` Zwane Mwaikambo
2004-09-01 1:26 ` Anton Blanchard
0 siblings, 1 reply; 3+ messages in thread
From: Zwane Mwaikambo @ 2004-08-30 5:02 UTC (permalink / raw)
To: Linux Kernel; +Cc: Anton Blanchard, John Levon, Philippe Elie
On Mon, 30 Aug 2004, Zwane Mwaikambo wrote:
> Index: linux-2.6.9-rc1-mm1/drivers/oprofile/timer_int.c
> ===================================================================
> RCS file: /home/cvsroot/linux-2.6.9-rc1-mm1/drivers/oprofile/timer_int.c,v
> retrieving revision 1.1.1.1
> diff -u -p -B -r1.1.1.1 timer_int.c
> --- linux-2.6.9-rc1-mm1/drivers/oprofile/timer_int.c 26 Aug 2004 13:13:41 -0000 1.1.1.1
> +++ linux-2.6.9-rc1-mm1/drivers/oprofile/timer_int.c 28 Aug 2004 20:00:47 -0000
> @@ -19,7 +19,7 @@ static int timer_notify(struct notifier_
> {
> struct pt_regs * regs = (struct pt_regs *)data;
> int cpu = smp_processor_id();
> - unsigned long eip = instruction_pointer(regs);
> + unsigned long eip = profile_pc(regs);
>
> oprofile_add_sample(eip, !user_mode(regs), 0, cpu);
> return 0;
Looking at the PPC oprofile code, how does contention get reported?
get_pc() looks like it may be returning _raw_spin_*
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][1/3] Completely out of line spinlocks / generic
2004-08-30 5:02 ` Zwane Mwaikambo
@ 2004-09-01 1:26 ` Anton Blanchard
0 siblings, 0 replies; 3+ messages in thread
From: Anton Blanchard @ 2004-09-01 1:26 UTC (permalink / raw)
To: Zwane Mwaikambo; +Cc: Linux Kernel, John Levon, Philippe Elie
> Looking at the PPC oprofile code, how does contention get reported?
> get_pc() looks like it may be returning _raw_spin_*
Yep unfortunately we end up with ticks in the out of line spinlock
functions. We could recognise this in the profile code and walk up the
stack, I think sparc64 has been doing that.
I have a similar problem with hardware performance counters but its much
more difficult there. Since we dont have an NMI you get the profile tick
when interrupts are reenabled. At that point we may be out of the spin
lock so backtracing is impossible.
Anton
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-09-01 1:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-30 4:43 [PATCH][1/3] Completely out of line spinlocks / generic Zwane Mwaikambo
2004-08-30 5:02 ` Zwane Mwaikambo
2004-09-01 1:26 ` Anton Blanchard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox