[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1444894792-2338-4-git-send-email-yunlong.song@huawei.com>
Date: Thu, 15 Oct 2015 15:39:52 +0800
From: Yunlong Song <yunlong.song@...wei.com>
To: <a.p.zijlstra@...llo.nl>, <paulus@...ba.org>, <mingo@...hat.com>,
<acme@...nel.org>
CC: <linux-kernel@...r.kernel.org>, <wangnan0@...wei.com>,
<namhyung@...nel.org>, <artagnon@...il.com>, <sriram.r@...ia.com>,
<adrian.hunter@...el.com>, <jolsa@...nel.org>, <dsahern@...il.com>
Subject: [PATCH v2 3/3] perf help: Change the usage's stdout to stderr for consistency
The builtins use stderr everywhere to show the usage info when the opts
or cmds are incorrectly used, for consistency, change perf's stdout to
stderr to show its usage info when it is incorrectly (including no
command) used.
Signed-off-by: Yunlong Song <yunlong.song@...wei.com>
---
tools/perf/builtin-help.c | 9 +++++----
tools/perf/perf.c | 2 +-
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index 09b0368..8cee457 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -287,10 +287,11 @@ void list_common_cmds_help(void)
longest = strlen(common_cmds[i].name);
}
- puts(" The most commonly used perf commands are:");
+ fputs(" The most commonly used perf commands are:\n", stderr);
for (i = 0; i < ARRAY_SIZE(common_cmds); i++) {
- printf(" %-*s ", longest, common_cmds[i].name);
- puts(common_cmds[i].help);
+ fprintf(stderr, " %-*s ", longest, common_cmds[i].name);
+ fputs(common_cmds[i].help, stderr);
+ fputc('\n', stderr);
}
}
@@ -472,7 +473,7 @@ int cmd_help(int argc, const char **argv, const char *prefix __maybe_unused)
if (!argv[0]) {
usage_with_options_return(perf_usage, perf_options);
list_common_cmds_help();
- printf("\n %s\n\n", perf_more_info_string);
+ fprintf(stderr, "\n %s\n\n", perf_more_info_string);
return 0;
}
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 3bcaa10d..54ef361 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -584,7 +584,7 @@ int main(int argc, const char **argv)
/* The user didn't specify a command; give them help */
usage_with_options_return(perf_usage, perf_options);
list_common_cmds_help();
- printf("\n %s\n\n", perf_more_info_string);
+ fprintf(stderr, "\n %s\n\n", perf_more_info_string);
goto out;
}
cmd = argv[0];
--
1.8.5.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists