From: Yunlong Song <yunlong.song@huawei.com>
To: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Cc: Sriram Raghunathan <sriram.r@nokia.com>,
Wang Nan <wangnan0@huawei.com>,
Ramkumar Ramachandra <artagnon@gmail.com>,
Namhyung Kim <namhyung@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
David Ahern <dsahern@gmail.com>,
Adrian Hunter <adrian.hunter@intel.com>,
"Arnaldo Carvalho de Melo" <acme@kernel.org>
Subject: Re: [PATCH 1/1] perf:Adding --list-opts to usage string
Date: Thu, 15 Oct 2015 15:11:39 +0800 [thread overview]
Message-ID: <561F51AB.4040302@huawei.com> (raw)
In-Reply-To: <CA+JHD92p0QUJGrqKTMYD8FUKj5tS9MUV_njsvoFwaHhsQevn_Q@mail.gmail.com>
On 2015/10/14 21:40, Arnaldo Carvalho de Melo wrote:
>
> Le 14 oct. 2015 10:33 AM, "Yunlong Song" <yunlong.song@huawei.com <mailto:yunlong.song@huawei.com>> a écrit :
>>
>> On 2015/10/14 11:10, Arnaldo Carvalho de Melo wrote:
>>
>> > One doesn't show what options can be used, the other does, so there is
>> > an inconsistency, this and the fact that 'perf -h' outputs to stdout,
>> > 'perf stat -h' and the other builtins output to stderr. I think all
>> > should output to stdout, just like 'ls --help', what do you think?
>> >
>> > - Arnaldo
>> >
>>
>> I think the reason that options do not show in 'perf -h' but show in
>> other builtins is not the different use of stdout or stderr. I will
>> send a patch to fix this instead.
>
> Sure, I mentioned two problems. The invonsistency in stdout/stderr usage has nothing to do with options being not showed in 'perf -h'. :-)
>>
Sorry, I understand now. I think it makes sense that the builtins use stderr everywhere
to show its usage info when the opts or cmds are incorrectly used. Usually, there is an
error description followed with the usage info, for example:
# ./perf stat -f
Error: unknown switch `f'
Usage: perf stat [<options>] [<command>]
-T, --transaction hardware transaction statistics
-e, --event <event> event selector. use 'perf list' to list available events
--filter <filter>
event filter
-i, --no-inherit child tasks do not inherit counters
<SNIP>
-I, --interval-print <n>
print counts at regular interval in ms (>= 10)
--per-socket aggregate counts per processor socket
--per-core aggregate counts per physical processor core
--per-thread aggregate counts per thread
-D, --delay <n> ms to wait before starting measurement after program start
As shown above, I think the error description and the usage info should output to the same
stderr area as it is now to be clear.
Thus I think it is better to make perf output its usage info to stderr instead of stdout for
consistency. I will resend patches to fix this.
--
Thanks,
Yunlong Song
next prev parent reply other threads:[~2015-10-15 7:17 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 ` Yunlong Song [this message]
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 ` [PATCH v2 3/3] perf help: Change the usage's stdout to stderr " Yunlong Song
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=561F51AB.4040302@huawei.com \
--to=yunlong.song@huawei.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=arnaldo.melo@gmail.com \
--cc=artagnon@gmail.com \
--cc=dsahern@gmail.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.