mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Thompson <daniel.thompson@linaro.org>
To: kgdb-bugreport@lists.sourceforge.net,
	Jason Wessel <jason.wessel@windriver.com>
Cc: patches@linaro.org, linaro-kernel@lists.linaro.org,
	Daniel Thompson <daniel.thompson@linaro.org>,
	linux-kernel@vger.kernel.org,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mike Travis <travis@sgi.com>, Dimitri Sivanich <sivanich@sgi.com>,
	Hedi Berriche <hedi@sgi.com>,
	John Stultz <john.stultz@linaro.org>,
	Anton Vorontsov <anton.vorontsov@linaro.org>,
	Colin Cross <ccross@android.com>,
	kernel-team@android.com
Subject: [PATCH 2/3] proc: Provide access to /proc/interrupts from kdb
Date: Wed, 30 Apr 2014 16:40:26 +0100	[thread overview]
Message-ID: <1398872427-18435-3-git-send-email-daniel.thompson@linaro.org> (raw)
In-Reply-To: <1398872427-18435-1-git-send-email-daniel.thompson@linaro.org>

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 | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fs/proc/interrupts.c b/fs/proc/interrupts.c
index a352d57..d8b64f0 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);
-- 
1.9.0


  parent reply	other threads:[~2014-04-30 15:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-29 14:30 [PATCH 0/3] kdb: Infrastructure to display sequence files Daniel Thompson
2014-04-29 14:30 ` [PATCH 1/3] kdb: Add framework " Daniel Thompson
2014-04-29 14:30 ` [PATCH 2/3] proc: Provide access to /proc/interrupts from kdb Daniel Thompson
2014-04-29 14:30 ` [PATCH 3/3] kdb: Implement seq_file command Daniel Thompson
2014-04-30 15:40 ` [PATCH 0/3] kdb: Infrastructure to display sequence files Daniel Thompson
2014-04-30 15:40   ` [PATCH 1/3] kdb: Add framework " Daniel Thompson
2014-04-30 15:40   ` Daniel Thompson [this message]
2014-04-30 15:40   ` [PATCH 3/3] kdb: Implement seq_file command Daniel Thompson
2014-08-19 14:37   ` [PATCH v3 0/3] kdb: Infrastructure to display sequence files Daniel Thompson
2014-08-19 14:37     ` [PATCH v3 1/3] kdb: Add framework " Daniel Thompson
2014-08-19 14:37     ` [PATCH v3 2/3] proc: Provide access to /proc/interrupts from kdb Daniel Thompson
2014-08-19 14:37     ` [PATCH v3 3/3] kdb: Implement seq_file command Daniel Thompson

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=1398872427-18435-3-git-send-email-daniel.thompson@linaro.org \
    --to=daniel.thompson@linaro.org \
    --cc=akpm@linux-foundation.org \
    --cc=anton.vorontsov@linaro.org \
    --cc=ccross@android.com \
    --cc=hedi@sgi.com \
    --cc=jason.wessel@windriver.com \
    --cc=john.stultz@linaro.org \
    --cc=kernel-team@android.com \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=sivanich@sgi.com \
    --cc=travis@sgi.com \
    /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

all inboxes | Powered by JetHome®