From patchwork Wed Apr 2 15:43:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 27642 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 86D7A20341 for ; Wed, 2 Apr 2014 15:44:30 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id i8sf827392qcq.8 for ; Wed, 02 Apr 2014 08:44:30 -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=kw4mgmygK30+p6u9rm+i8RHvfyifhPF+9IqCZoo1Iqk=; b=Fz8pDG4mmnjlS/5uMpqWpFXkojN9S51MXfzSgCuJK6XBTf95hbPX3lqz3szsaLkHY/ 7MIXSZSu/MOo4ZEJA8zK2/na18qTUOu0KaoccM2JuKj8OqVcTQ2G+zrKQFmjHZFG8yoC u1oZ0HUIo/yHQMWicTyxjQXN0ch7/0nHEnAVln4JIje4blFZshiNLu2j5KcuAucx4H8t Xd0MZGpbn4qjZwoe0yhcAS7KidnfzEt//9ZuN1z6R5RUnyiAwys6y2yvV5GPCBaggQpp wtSHjTHMvYcEjYlh8fTV5F67g4saTYp+Fc/T+eUXSr8btlrL5gg1kwyLAcslpsGZub5F crUg== X-Gm-Message-State: ALoCoQmxoQEnkiEES3z23FV5zezwUaUBKKsKU1Aa27EXqLan8G0hwUV60U2nzrWOHkM6GsCvglGN X-Received: by 10.236.113.43 with SMTP id z31mr395567yhg.33.1396453470289; Wed, 02 Apr 2014 08:44:30 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.93.33 with SMTP id c30ls392909qge.9.gmail; Wed, 02 Apr 2014 08:44:30 -0700 (PDT) X-Received: by 10.52.12.36 with SMTP id v4mr1372999vdb.20.1396453470196; Wed, 02 Apr 2014 08:44:30 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id 10si619329vcu.186.2014.04.02.08.44.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Apr 2014 08:44:30 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id ld13so557138vcb.5 for ; Wed, 02 Apr 2014 08:44:30 -0700 (PDT) X-Received: by 10.52.95.135 with SMTP id dk7mr1298015vdb.32.1396453470116; Wed, 02 Apr 2014 08:44:30 -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.12.8 with SMTP id v8csp334262vcv; Wed, 2 Apr 2014 08:44:29 -0700 (PDT) X-Received: by 10.194.7.196 with SMTP id l4mr1860240wja.92.1396453469282; Wed, 02 Apr 2014 08:44:29 -0700 (PDT) Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by mx.google.com with ESMTPS id n1si1058529wjz.124.2014.04.02.08.44.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Apr 2014 08:44:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.171 is neither permitted nor denied by best guess record for domain of daniel.thompson@linaro.org) client-ip=209.85.212.171; Received: by mail-wi0-f171.google.com with SMTP id q5so7429511wiv.4 for ; Wed, 02 Apr 2014 08:44:28 -0700 (PDT) X-Received: by 10.180.149.240 with SMTP id ud16mr3032796wib.23.1396453468560; Wed, 02 Apr 2014 08:44:28 -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 dg7sm3450581wjc.4.2014.04.02.08.44.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Apr 2014 08:44:27 -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, Greg Kroah-Hartman , Jiri Slaby , Steven Rostedt , Frederic Weisbecker , Ingo Molnar , John Stultz , Anton Vorontsov , Colin Cross , kernel-team@android.com Subject: [RFC v2 09/10] kdb: Improve usability of help text when running in kiosk mode Date: Wed, 2 Apr 2014 16:43:59 +0100 Message-Id: <1396453440-16445-10-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1396453440-16445-1-git-send-email-daniel.thompson@linaro.org> References: <1396453440-16445-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: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: , Currently 'help' in kiosk mode results in help text being issued for many commands the user cannot actually run. Filter the help list when kiosk mode is engaged to ensure help is fully relevant. Filtering the list is also greatly simplifies scanning for commands that may have been accidentally classified as safe. Signed-off-by: Daniel Thompson --- kernel/debug/kdb/kdb_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index 808bf55..77b6e61 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c @@ -2401,6 +2401,9 @@ static int kdb_help(int argc, const char **argv) return 0; if (!kt->cmd_name) continue; + if (kdb_kiosk && + !(kt->cmd_flags & (KDB_SAFE | KDB_SAFE_NO_ARGS))) + continue; if (strlen(kt->cmd_usage) > 20) space = "\n "; kdb_printf("%-15.15s %-20s%s%s\n", kt->cmd_name,