From patchwork Wed Apr 30 15:40:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 29430 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 114D1203F3 for ; Wed, 30 Apr 2014 15:41:09 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id i7sf9780659oag.8 for ; Wed, 30 Apr 2014 08:41: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=M1RPQFuq9eghZBetXmyAP/7ltzhmD+tOqgAKRACTYjY=; b=KR+QaqQuOfCSqrcJrUQMTMIeWOThH/xwWekKdBmiDWFp2Oh0wVMA/ErfOtZcCH+zkN CP93CSre9o00qu8KgSrkF/FJLoqbNaC5j3JuZChSw2YsHQMpEO835T6I0JjpoBzVhyGv CRmNyhpcu+NH2SJ+6yRU1VPyQ9zB31vHSYbAd900kETJrZgbz1ABI7oXWCfrShavwxv9 zDGr4w8paFHupY06/pk4e2U9bs9uKpi9e5x3xjX8kQJvsF+qAeRIQGv1BQs/M52SlN55 Uq2stc80myuicqdQt0h5CjF/ISAShZh31/XucuUJ4myo7lenF9aFv/YslQ1PxFQHhK42 hqyQ== X-Gm-Message-State: ALoCoQl0GeT+08HNrxydOQdpRwE7jmNJA1NRPTRmXHwUAb/R6WanLAjH11Z80EcmZkKZzwtK6B0B X-Received: by 10.43.161.202 with SMTP id mh10mr2221718icc.23.1398872468781; Wed, 30 Apr 2014 08:41:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.83.115 with SMTP id i106ls641426qgd.97.gmail; Wed, 30 Apr 2014 08:41:08 -0700 (PDT) X-Received: by 10.58.107.65 with SMTP id ha1mr4484265veb.1.1398872468591; Wed, 30 Apr 2014 08:41:08 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id i3si5403323vca.77.2014.04.30.08.41.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Apr 2014 08:41:08 -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.220.181; Received: by mail-vc0-f181.google.com with SMTP id hy4so2454511vcb.12 for ; Wed, 30 Apr 2014 08:41:08 -0700 (PDT) X-Received: by 10.58.187.165 with SMTP id ft5mr681671vec.47.1398872468521; Wed, 30 Apr 2014 08:41:08 -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 ib8csp289250vcb; Wed, 30 Apr 2014 08:41:08 -0700 (PDT) X-Received: by 10.194.103.36 with SMTP id ft4mr2741963wjb.66.1398872467690; Wed, 30 Apr 2014 08:41:07 -0700 (PDT) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by mx.google.com with ESMTPS id ft5si590233wib.63.2014.04.30.08.41.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Apr 2014 08:41:07 -0700 (PDT) Received-SPF: none (google.com: daniel.thompson@linaro.org does not designate permitted sender hosts) client-ip=209.85.212.170; Received: by mail-wi0-f170.google.com with SMTP id f8so1129656wiw.1 for ; Wed, 30 Apr 2014 08:41:07 -0700 (PDT) X-Received: by 10.180.7.133 with SMTP id j5mr4233476wia.55.1398872467188; Wed, 30 Apr 2014 08:41:07 -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 hp5sm36719389wjb.0.2014.04.30.08.41.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Apr 2014 08:41:06 -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: Wed, 30 Apr 2014 16:40:26 +0100 Message-Id: <1398872427-18435-3-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1398872427-18435-1-git-send-email-daniel.thompson@linaro.org> References: <1398781841-15152-1-git-send-email-daniel.thompson@linaro.org> <1398872427-18435-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 | 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);