aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Thompson <daniel.thompson@linaro.org>2014-04-28 16:42:44 +0100
committerDaniel Thompson <daniel.thompson@linaro.org>2014-08-18 10:44:55 +0100
commitde35b8666db90bfb44e9341541e56cf6d1096c07 (patch)
treea80cac26fc7fbebe5093a29d01eb3e139bf8f526
parent3497a5d8147ea0c71396a8dae16f9b425dfda84d (diff)
downloadlinux-de35b8666db90bfb44e9341541e56cf6d1096c07.tar.gz
proc: Provide access to /proc/interrupts from kdb
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>
-rw-r--r--fs/proc/interrupts.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/proc/interrupts.c b/fs/proc/interrupts.c
index a352d5703b41..d8b64f074ee7 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,16 @@ static const struct file_operations proc_interrupts_operations = {
.release = seq_release,
};
+static int kdb_interrupts(int argc, const char **argv)
+{
+ return kdb_print_seq_file(&int_seq_ops);
+}
+
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);