From patchwork Tue Apr 29 14:30:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 29359 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 53630203F4 for ; Tue, 29 Apr 2014 14:31:19 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id rp18sf1406450iec.9 for ; Tue, 29 Apr 2014 07:31:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=W1b2nMozffb+T0cK+EH5XvQpKN4jb2ta3v3j/nLkqDo=; b=WxwcktnSSeuy/L5T7dt7Ql/MFwNCS47a7uokWlJ8eXw0kxlN5Gk4J4tp5eZT3Aajjd wNCu6Bv3upAhA/QM5kLC//c3gmmN9bGQA8cXCp43mDpbly0upojl/YXGncuTafq31M9i 0IZI5E/VEdPciYPQkRrJzdBYeikrai7qz6q/MRP1ylUb39hRYbV8um1IoL2/Cq8edHoo PbeY/385422vgOJkuOL8zIDYOxJ1BygUkdW3HHsNQ03qgNzUG6PBTH1XRn95r62oxvRZ LSKFWXCNUv3duB1yaOL7UhzkdVKzazK/zV1wGP62ZMbONCiHkQlDbSa6EG3VOo+LpZMV y2SA== X-Gm-Message-State: ALoCoQkE835JlBnIsj+sQmKOfhqIPx9EldDDgBELsuF0A+XHyw59bFbrolW2D76BRz9QpBVIswKR X-Received: by 10.42.185.1 with SMTP id cm1mr14973363icb.10.1398781874600; Tue, 29 Apr 2014 07:31:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.101.4 with SMTP id t4ls107694qge.1.gmail; Tue, 29 Apr 2014 07:31:14 -0700 (PDT) X-Received: by 10.52.137.74 with SMTP id qg10mr386677vdb.61.1398781874472; Tue, 29 Apr 2014 07:31:14 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id vd8si4542394vdc.16.2014.04.29.07.31.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Apr 2014 07:31:14 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id db11so361713veb.35 for ; Tue, 29 Apr 2014 07:31:14 -0700 (PDT) X-Received: by 10.58.179.115 with SMTP id df19mr467034vec.41.1398781874407; Tue, 29 Apr 2014 07:31:14 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp202447vcb; Tue, 29 Apr 2014 07:31:13 -0700 (PDT) X-Received: by 10.180.14.233 with SMTP id s9mr492042wic.53.1398781873531; Tue, 29 Apr 2014 07:31:13 -0700 (PDT) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by mx.google.com with ESMTPS id t6si8296819wjq.55.2014.04.29.07.31.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Apr 2014 07:31:13 -0700 (PDT) Received-SPF: none (google.com: daniel.thompson@linaro.org does not designate permitted sender hosts) client-ip=209.85.212.177; Received: by mail-wi0-f177.google.com with SMTP id cc10so543448wib.16 for ; Tue, 29 Apr 2014 07:31:13 -0700 (PDT) X-Received: by 10.180.93.101 with SMTP id ct5mr562607wib.23.1398781873030; Tue, 29 Apr 2014 07:31:13 -0700 (PDT) Received: from sundance.lan (cpc4-aztw19-0-0-cust157.18-1.cable.virginm.net. [82.33.25.158]) by mx.google.com with ESMTPSA id uc3sm5389589wib.10.2014.04.29.07.31.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Apr 2014 07:31:12 -0700 (PDT) From: Daniel Thompson To: kgdb-bugreport@lists.sourceforge.net, Jason Wessel Cc: patches@linaro.org, linaro-kernel@lists.linaro.org, Daniel Thompson , linux-kernel@vger.kernel.org, Paul Gortmaker , Andrew Morton , Mike Travis , Dimitri Sivanich , Hedi Berriche , John Stultz , Anton Vorontsov , Colin Cross , kernel-team@android.com Subject: [PATCH 2/3] proc: Provide access to /proc/interrupts from kdb Date: Tue, 29 Apr 2014 15:30:40 +0100 Message-Id: <1398781841-15152-4-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1398781841-15152-1-git-send-email-daniel.thompson@linaro.org> References: <1398781841-15152-1-git-send-email-daniel.thompson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.thompson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- fs/proc/interrupts.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 #include #include +#include /* * /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);