diff mbox

[2/3] kdb: Implement interrupts command

Message ID 1398781841-15152-3-git-send-email-daniel.thompson@linaro.org
State New
Headers show

Commit Message

Daniel Thompson April 29, 2014, 2:30 p.m. UTC
The contents of /proc/interrupts is useful to diagnose problems during
boot up or when the system becomes unresponsive (or at least it can be if
failure is causes by interrupt problems). This command is also seen in
out-of-tree debug systems such as Android's FIQ debugger.

This change allows the file to be displayed from kdb.

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
---
 fs/proc/interrupts.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Daniel Thompson April 29, 2014, 2:35 p.m. UTC | #1
On 29/04/14 15:30, Daniel Thompson wrote:
> The contents of /proc/interrupts is useful to diagnose problems during
> boot up or when the system becomes unresponsive (or at least it can be if
> failure is causes by interrupt problems). This command is also seen in
> out-of-tree debug systems such as Android's FIQ debugger.
> 
> This change allows the file to be displayed from kdb.

Oops... two different PATCH 2/3 sent to the Linaro lists.

This was the bad one. Please ignore this patch and this thread.


Daniel.
diff mbox

Patch

diff --git a/fs/proc/interrupts.c b/fs/proc/interrupts.c
index a352d57..1f8eeaf 100644
--- a/fs/proc/interrupts.c
+++ b/fs/proc/interrupts.c
@@ -4,6 +4,7 @@ 
 #include <linux/irqnr.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
+#include <linux/kdb.h>
 
 /*
  * /proc/interrupts
@@ -45,9 +46,18 @@  static const struct file_operations proc_interrupts_operations = {
 	.release	= seq_release,
 };
 
+#ifdef CONFIG_KGDB_KDB
+static int kdb_interrupts(int argc, const char **argv)
+{
+	return kdb_print_seq_file(&int_seq_ops);
+}
+#endif
+
 static int __init proc_interrupts_init(void)
 {
 	proc_create("interrupts", 0, NULL, &proc_interrupts_operations);
+	kdb_register("interrupts", kdb_interrupts, "",
+		     "Show /proc/interrupts", 3);
 	return 0;
 }
 fs_initcall(proc_interrupts_init);