From patchwork Tue Aug 19 14:37:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 35604 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6127B201EF for ; Tue, 19 Aug 2014 14:38:10 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id rp18sf5004238iec.8 for ; Tue, 19 Aug 2014 07:38:09 -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=V+yzzKpLqn4VydrZa5IP8BaLNrRyH2Vt3wt4e81P7Wk=; b=GsNlqjIsAScN5hbXJgZw7x5vtSaoHKBusJwM42fd831t1s+NjzEQRok83sVJikd0Z3 ljtRtWbmlf984NTaUopjQHntRbZL0axamVOVVJbQMoRu4HqB5uLpvhF/RUNx1othrl6T LVrbDbxCv5ymDz+uWCV12HLeqber7SHTuGZ+dRSAv01atNyWVV+F03sW/+YTSciPDqXF WTuQiJO2t9fkMW59O1NAz94DUm8VM8gLwwwKgE3jUd+IQazWgUk58KxTKCJCY147RZPR 1kVB9R2C6gBERG2eoX5p0Nj8pblNFY+ouzl+JrWqSOzqT2H2Lblznc8uiT6ciP/QfCFH LqJw== X-Gm-Message-State: ALoCoQn5pEjATGGX23g4zxZPzyimDE8fWKqdGQV9Qnq7q2dXSmSXO3zSRWnfsiTbnYobDyxGB0vU X-Received: by 10.182.56.200 with SMTP id c8mr23097311obq.7.1408459089933; Tue, 19 Aug 2014 07:38:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.88.6 with SMTP id s6ls2867833qgd.22.gmail; Tue, 19 Aug 2014 07:38:09 -0700 (PDT) X-Received: by 10.220.166.68 with SMTP id l4mr11665425vcy.20.1408459089820; Tue, 19 Aug 2014 07:38:09 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id y20si8840844vcu.71.2014.08.19.07.38.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Aug 2014 07:38:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id hq11so7526787vcb.16 for ; Tue, 19 Aug 2014 07:38:09 -0700 (PDT) X-Received: by 10.52.129.165 with SMTP id nx5mr18861790vdb.25.1408459089754; Tue, 19 Aug 2014 07:38:09 -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.221.37.5 with SMTP id tc5csp244010vcb; Tue, 19 Aug 2014 07:38:09 -0700 (PDT) X-Received: by 10.194.90.4 with SMTP id bs4mr52380979wjb.71.1408459088605; Tue, 19 Aug 2014 07:38:08 -0700 (PDT) Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by mx.google.com with ESMTPS id s5si22723972wiv.46.2014.08.19.07.38.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Aug 2014 07:38:08 -0700 (PDT) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 74.125.82.45 as permitted sender) client-ip=74.125.82.45; Received: by mail-wg0-f45.google.com with SMTP id x12so6413806wgg.28 for ; Tue, 19 Aug 2014 07:38:08 -0700 (PDT) X-Received: by 10.194.87.102 with SMTP id w6mr50134665wjz.24.1408459088018; Tue, 19 Aug 2014 07:38:08 -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 k6sm50920144wjq.5.2014.08.19.07.38.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Aug 2014 07:38:07 -0700 (PDT) From: Daniel Thompson To: Jason Wessel Cc: Daniel Thompson , kgdb-bugreport@lists.sourceforge.net, patches@linaro.org, linaro-kernel@lists.linaro.org, 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 v3 2/3] proc: Provide access to /proc/interrupts from kdb Date: Tue, 19 Aug 2014 15:37:41 +0100 Message-Id: <1408459062-19120-3-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1408459062-19120-1-git-send-email-daniel.thompson@linaro.org> References: <1398872427-18435-1-git-send-email-daniel.thompson@linaro.org> <1408459062-19120-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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) 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 | 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 #include #include +#include /* * /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);