public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Jack Steiner <steiner@sgi.com>
To: linux-ia64@vger.kernel.org
Subject: [PATCH] - kernel profiler & spinlock_contention
Date: Wed, 26 Nov 2003 15:23:10 +0000	[thread overview]
Message-ID: <marc-linux-ia64-106986108616188@msgid-missing> (raw)

Profiling is more useful if addresses in spinlock_contention
were attributed to the caller of spinlock_contention.



diff -Naur linux_base/arch/ia64/kernel/head.S linux/arch/ia64/kernel/head.S
--- linux_base/arch/ia64/kernel/head.S	Tue Nov 25 10:03:46 2003
+++ linux/arch/ia64/kernel/head.S	Tue Nov 25 15:21:58 2003
@@ -888,6 +888,8 @@
 	cmp4.eq p14,p0=r30,r0
 (p14)	br.cond.sptk.few b6	// lock is now free, try to acquire
 	br.cond.sptk.few .wait
+	.global ia64_spinlock_contention_pre3_4_end    // for kernprof
+ia64_spinlock_contention_pre3_4_end:
 END(ia64_spinlock_contention_pre3_4)
 
 #else



diff -Naur linux_base/arch/ia64/kernel/time.c linux/arch/ia64/kernel/time.c
--- linux_base/arch/ia64/kernel/time.c	Tue Nov 25 10:03:46 2003
+++ linux/arch/ia64/kernel/time.c	Tue Nov 25 10:07:21 2003
@@ -202,6 +202,9 @@
 {
 	unsigned long ip, slot;
 	extern cpumask_t prof_cpu_mask;
+#ifdef CONFIG_SMP
+	extern char ia64_spinlock_contention_pre3_4[], ia64_spinlock_contention_pre3_4_end[];
+#endif
 
 	profile_hook(regs);
 
@@ -216,7 +219,14 @@
 	 * bits 2 and 3 rather than bits 0 and 1.
 	 */
 	slot = ip & 3;
-	ip = (ip & ~3UL) + 4*slot;
+	ip = (ip & ~3UL);
+#ifdef CONFIG_SMP
+	if (ip >= (unsigned long)ia64_spinlock_contention_pre3_4 &&
+			ip < (unsigned long)ia64_spinlock_contention_pre3_4_end)
+		ip = regs->r28;
+	else
+#endif
+	ip += 4*slot;
 
 	/*
 	 * Only measure the CPUs specified by /proc/irq/prof_cpu_mask.
-- 
Thanks

Jack Steiner (steiner@sgi.com)          651-683-5302
Principal Engineer                      SGI - Silicon Graphics, Inc.



             reply	other threads:[~2003-11-26 15:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-26 15:23 Jack Steiner [this message]
2003-11-26 17:31 ` [PATCH] - kernel profiler & spinlock_contention David Mosberger
2003-11-26 19:02 ` Jack Steiner
2003-11-26 19:15 ` David Mosberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-ia64-106986108616188@msgid-missing \
    --to=steiner@sgi.com \
    --cc=linux-ia64@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox