From: Yunlong Song <yunlong.song@huawei.com>
To: <a.p.zijlstra@chello.nl>, <paulus@samba.org>, <mingo@redhat.com>,
<acme@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <wangnan0@huawei.com>,
<namhyung@kernel.org>, <artagnon@gmail.com>, <sriram.r@nokia.com>,
<adrian.hunter@intel.com>, <jolsa@kernel.org>,
<dsahern@gmail.com>
Subject: [PATCH v2 3/3] perf help: Change the usage's stdout to stderr for consistency
Date: Thu, 15 Oct 2015 15:39:52 +0800 [thread overview]
Message-ID: <1444894792-2338-4-git-send-email-yunlong.song@huawei.com> (raw)
In-Reply-To: <1444894792-2338-1-git-send-email-yunlong.song@huawei.com>
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@huawei.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
prev parent reply other threads:[~2015-10-15 7:35 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1444282190-13605-1-git-send-email-sriram.r@nokia.com>
2015-10-13 14:57 ` [PATCH 1/1] perf:Adding --list-opts to usage string Arnaldo Carvalho de Melo
2015-10-13 15:24 ` Ramkumar Ramachandra
2015-10-14 2:29 ` Yunlong Song
2015-10-14 3:10 ` Arnaldo Carvalho de Melo
2015-10-14 3:42 ` Namhyung Kim
2015-10-14 13:31 ` Yunlong Song
[not found] ` <CA+JHD92p0QUJGrqKTMYD8FUKj5tS9MUV_njsvoFwaHhsQevn_Q@mail.gmail.com>
2015-10-14 17:10 ` [PATCH 1/1] perf :redirection of usage strings to stdout Sriram Raghunathan
2015-10-15 7:22 ` Sriram Raghunathan
2015-10-15 7:11 ` [PATCH 1/1] perf:Adding --list-opts to usage string Yunlong Song
2015-10-14 13:44 ` [PATCH] perf help: Add options description to 'perf -h' Yunlong Song
2015-10-15 7:39 ` [PATCH v2 0/3] perf help: Make perf's help consistent with other builtins Yunlong Song
2015-10-15 7:39 ` [PATCH v2 1/3] perf help: Add options description to 'perf -h' Yunlong Song
2015-10-19 15:29 ` Namhyung Kim
2015-10-20 2:13 ` Yunlong Song
2015-10-21 1:57 ` Namhyung Kim
2015-10-15 7:39 ` [PATCH v2 2/3] perf help: Change 'usage' to 'Usage' for consistency Yunlong Song
2015-10-20 7:48 ` [tip:perf/core] " tip-bot for Yunlong Song
2015-10-15 7:39 ` Yunlong Song [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1444894792-2338-4-git-send-email-yunlong.song@huawei.com \
--to=yunlong.song@huawei.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=artagnon@gmail.com \
--cc=dsahern@gmail.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=paulus@samba.org \
--cc=sriram.r@nokia.com \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®