From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755514AbbB0T0Y (ORCPT ); Fri, 27 Feb 2015 14:26:24 -0500 Received: from mail.kernel.org ([198.145.29.136]:57709 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755364AbbB0TYD (ORCPT ); Fri, 27 Feb 2015 14:24:03 -0500 From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Yunlong Song , Paul Mackerras , Peter Zijlstra , Wang Nan , Arnaldo Carvalho de Melo Subject: [PATCH 11/19] perf list: Avoid confusion of perf output and the next command prompt Date: Fri, 27 Feb 2015 16:23:01 -0300 Message-Id: <1425064989-26440-12-git-send-email-acme@kernel.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1425064989-26440-1-git-send-email-acme@kernel.org> References: <1425064989-26440-1-git-send-email-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yunlong Song Distinguish the output of 'perf list --list-opts' or 'perf --list-cmds' with the next command prompt, which also happens in other cases (e.g. record, report ...). Example: Before this patch: $perf list --list-opts --raw-dump $ <-- the output and the next command prompt are at the same line After this patch: $perf list --list-opts --raw-dump $ <-- the new line Signed-off-by: Yunlong Song Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Wang Nan Link: http://lkml.kernel.org/r/1425032491-20224-6-git-send-email-yunlong.song@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/perf.c | 1 + tools/perf/util/parse-options.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tools/perf/perf.c b/tools/perf/perf.c index f3c66b81c6be..3df2665022be 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c @@ -223,6 +223,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged) struct cmd_struct *p = commands+i; printf("%s ", p->cmd); } + putchar('\n'); exit(0); } else if (!strcmp(cmd, "--debug")) { if (*argc < 2) { diff --git a/tools/perf/util/parse-options.c b/tools/perf/util/parse-options.c index 4ee9a86705ed..b0ef2d813d2f 100644 --- a/tools/perf/util/parse-options.c +++ b/tools/perf/util/parse-options.c @@ -508,12 +508,14 @@ int parse_options_subcommand(int argc, const char **argv, const struct option *o printf("--%s ", options->long_name); options++; } + putchar('\n'); exit(130); case PARSE_OPT_LIST_SUBCMDS: if (subcommands) { for (int i = 0; subcommands[i]; i++) printf("%s ", subcommands[i]); } + putchar('\n'); exit(130); default: /* PARSE_OPT_UNKNOWN */ if (ctx.argv[0][1] == '-') { -- 1.9.3