rpms/kernel/F-9 linux-2.6-sysrq-add-show-backtrace-on-all-cpus-function.patch, NONE, 1.1 kernel.spec, 1.713, 1.714

Chuck Ebbert (cebbert) fedora-extras-commits at redhat.com
Sat Jul 19 22:10:31 UTC 2008


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-9
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16909

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-sysrq-add-show-backtrace-on-all-cpus-function.patch 
Log Message:
* Fri Jul 19 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.25.11-95
- Add sysrq-l to show backtraces on all CPUs.


linux-2.6-sysrq-add-show-backtrace-on-all-cpus-function.patch:

--- NEW FILE linux-2.6-sysrq-add-show-backtrace-on-all-cpus-function.patch ---
From: Linux Kernel Mailing List <linux-kernel at vger.kernel.org>
To: git-commits-head at vger.kernel.org
Subject: sysrq: add show-backtrace-on-all-cpus function
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Git-Commit: 5045bcae0fb466a1dbb6af0036e56901fd7aafb7
X-Git-Parent: 6e574195b75543bc6a6240306313988b1952470c
X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00
	autolearn=ham version=3.2.3
X-Spam-Checker-Version: 	SpamAssassin 3.2.3 (2007-08-08) on hera.kernel.org
Sender: git-commits-head-owner at vger.kernel.org
Precedence: bulk
List-ID: <git-commits-head.vger.kernel.org>
X-Mailing-List: 	git-commits-head at vger.kernel.org
X-RedHat-Spam-Score: -3.865 
X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254
X-Scanned-By: MIMEDefang 2.63 on 172.16.48.32

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5045bcae0fb466a1dbb6af0036e56901fd7aafb7
Commit:     5045bcae0fb466a1dbb6af0036e56901fd7aafb7
Parent:     6e574195b75543bc6a6240306313988b1952470c
Author:     Rik van Riel <riel at redhat.com>
AuthorDate: Tue Apr 29 00:59:21 2008 -0700
Committer:  Linus Torvalds <torvalds at linux-foundation.org>
CommitDate: Tue Apr 29 08:06:03 2008 -0700

    sysrq: add show-backtrace-on-all-cpus function
    
    SysRQ-P is not always useful on SMP systems, since it usually ends up showing
    the backtrace of a CPU that is doing just fine, instead of the backtrace of
    the CPU that is having problems.
    
    This patch adds SysRQ show-all-cpus(L), which shows the backtrace of every
    active CPU in the system.  It skips idle CPUs because some SMP systems are
    just too large and we already know what the backtrace of the idle task looks
    like.
    
    [akpm at linux-foundation.org: coding-style fixes]
    Signed-off-by: Rik van Riel <riel at redhat.com>
    Randy Dunlap <randy.dunlap at oracle.com>
    Cc: <lwoodman at redhat.com>
    Cc: Ingo Molnar <mingo at elte.hu>
    Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
---
 Documentation/sysrq.txt |    2 ++
 drivers/char/sysrq.c    |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/Documentation/sysrq.txt b/Documentation/sysrq.txt
index 10c8f69..5ce0952 100644
--- a/Documentation/sysrq.txt
+++ b/Documentation/sysrq.txt
@@ -85,6 +85,8 @@ On all -  write a character to /proc/sysrq-trigger.  e.g.:
 'k'     - Secure Access Key (SAK) Kills all programs on the current virtual
           console. NOTE: See important comments below in SAK section.
 
+'l'     - Shows a stack backtrace for all active CPUs.
+
 'm'     - Will dump current memory info to your console.
 
 'n'	- Used to make RT tasks nice-able
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c
index 1ade193..9e9bad8 100644
--- a/drivers/char/sysrq.c
+++ b/drivers/char/sysrq.c
@@ -196,6 +196,48 @@ static struct sysrq_key_op sysrq_showlocks_op = {
 #define sysrq_showlocks_op (*(struct sysrq_key_op *)0)
 #endif
 
+#ifdef CONFIG_SMP
+static DEFINE_SPINLOCK(show_lock);
+
+static void showacpu(void *dummy)
+{
+	unsigned long flags;
+
+	/* Idle CPUs have no interesting backtrace. */
+	if (idle_cpu(smp_processor_id()))
+		return;
+
+	spin_lock_irqsave(&show_lock, flags);
+	printk(KERN_INFO "CPU%d:\n", smp_processor_id());
+	show_stack(NULL, NULL);
+	spin_unlock_irqrestore(&show_lock, flags);
+}
+
+static void sysrq_showregs_othercpus(struct work_struct *dummy)
+{
+	smp_call_function(showacpu, NULL, 0, 0);
+}
+
+static DECLARE_WORK(sysrq_showallcpus, sysrq_showregs_othercpus);
+
+static void sysrq_handle_showallcpus(int key, struct tty_struct *tty)
+{
+	struct pt_regs *regs = get_irq_regs();
+	if (regs) {
+		printk(KERN_INFO "CPU%d:\n", smp_processor_id());
+		show_regs(regs);
+	}
+	schedule_work(&sysrq_showallcpus);
+}
+
+static struct sysrq_key_op sysrq_showallcpus_op = {
+	.handler	= sysrq_handle_showallcpus,
+	.help_msg	= "aLlcpus",
+	.action_msg	= "Show backtrace of all active CPUs",
+	.enable_mask	= SYSRQ_ENABLE_DUMP,
+};
+#endif
+
 static void sysrq_handle_showregs(int key, struct tty_struct *tty)
 {
 	struct pt_regs *regs = get_irq_regs();
@@ -340,7 +382,11 @@ static struct sysrq_key_op *sysrq_key_table[36] = {
 	&sysrq_kill_op,			/* i */
 	NULL,				/* j */
 	&sysrq_SAK_op,			/* k */
+#ifdef CONFIG_SMP
+	&sysrq_showallcpus_op,		/* l */
+#else
 	NULL,				/* l */
+#endif
 	&sysrq_showmem_op,		/* m */
 	&sysrq_unrt_op,			/* n */
 	/* o: This will often be registered as 'Off' at init time */


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-9/kernel.spec,v
retrieving revision 1.713
retrieving revision 1.714
diff -u -r1.713 -r1.714
--- kernel.spec	17 Jul 2008 18:13:46 -0000	1.713
+++ kernel.spec	19 Jul 2008 22:09:35 -0000	1.714
@@ -629,6 +629,7 @@
 Patch510: linux-2.6-silence-noise.patch
 Patch570: linux-2.6-selinux-mprotect-checks.patch
 Patch580: linux-2.6-sparc-selinux-mprotect-checks.patch
+Patch590: linux-2.6-sysrq-add-show-backtrace-on-all-cpus-function.patch
 Patch610: linux-2.6-defaults-fat-utf8.patch
 Patch611: linux-2.6-reiserfs-discard-prealloc.patch
 
@@ -1199,6 +1200,9 @@
 # Fix SELinux for sparc
 ApplyPatch linux-2.6-sparc-selinux-mprotect-checks.patch
 
+# add sysrq-l (show all cpus backtrace)
+ApplyPatch linux-2.6-sysrq-add-show-backtrace-on-all-cpus-function.patch
+
 # Changes to upstream defaults.
 # Use UTF-8 by default on VFAT.
 ApplyPatch linux-2.6-defaults-fat-utf8.patch
@@ -1881,10 +1885,13 @@
 %kernel_variant_files -a /%{image_install_path}/xen*-%{KVERREL}.xen -e /etc/ld.so.conf.d/kernelcap-%{KVERREL}.xen.conf %{with_xen} xen
 
 %changelog
-* Thu Jul 17 2008 Dave Jones <davej at redhat.com>
+* Fri Jul 19 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.25.11-95
+- Add sysrq-l to show backtraces on all CPUs.
+
+* Thu Jul 17 2008 Dave Jones <davej at redhat.com> 2.6.25.11-94
 - Fix SHIRQ debug trace in tulip driver. (#454575)
 
-* Tue Jul 15 2008 John W. Linville <linville at redhat.com>
+* Tue Jul 15 2008 John W. Linville <linville at redhat.com> 2.6.25.11-93
 - Upstream wireless updates from 2008-07-14
   (http://marc.info/?l=linux-wireless&m=121606436000705&w=2)
 




More information about the fedora-extras-commits mailing list