Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1246273

Re: [PATCH 1/1] perf:Adding --list-opts to usage string

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/1] perf:Adding --list-opts to usage string
Date 2015-10-14 05:20 +0200
Message-ID <qjkLE-2wS-7@gated-at.bofh.it> (permalink)
References <qj9dw-1jL-27@gated-at.bofh.it> <qj9dw-1jL-25@gated-at.bofh.it> <qj9Gz-28L-37@gated-at.bofh.it> <qjjZg-1gq-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Em Wed, Oct 14, 2015 at 10:29:05AM +0800, Yunlong Song escreveu:
> On 2015/10/13 23:24, Ramkumar Ramachandra wrote:
> > Arnaldo Carvalho de Melo wrote:
> >> Em Thu, Oct 08, 2015 at 10:59:50AM +0530, Sriram Raghunathan escreveu:
> >>> Minor change, adding --list-opts to usage string. So that it is
> >>> visible to the user on running perf --help. or just perf
> >>> from command line.
> >>
> >> Ramkumar, Yunlong, are you ok with this?

> > Not sure I understand the motivation, but I suppose it can't hurt to
> > show this detail?

> Agree with Ramkumar, --list-opts is redundant due to the existing [OPTIONS] in
> the perf_usage_string[].

I see, thinking about it now, it seems that this is because 'perf -h'
behaves differently from other tools, i.e.:

$ perf -h

 usage: perf [--version] [--help] [OPTIONS] COMMAND [ARGS]

 The most commonly used perf commands are:
   annotate        Read perf.data (created by perf record) and display annotated code
   archive         Create archive with object files with build-ids found in perf.data file
   bench           General framework for benchmark suites
   buildid-cache   Manage build-id cache.
   buildid-list    List the buildids in a perf.data file
<SNIP>
   test            Runs sanity tests.
   timechart       Tool to visualize total system behavior during a workload
   top             System profiling tool.
   trace           strace inspired tool
   probe           Define new dynamic tracepoints

 See 'perf help COMMAND' for more information on a specific command.

--------------------------

While:

$ perf stat -h

 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
    -p, --pid <pid>       stat events on existing process id
    -t, --tid <tid>       stat events on existing thread id
    -a, --all-cpus        system-wide collection from all CPUs
<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

--------------------------

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
 
> >>>
> >>>  const char perf_usage_string[] =
> >>> -     "perf [--version] [--help] [OPTIONS] COMMAND [ARGS]";
> >>> +     "perf [--version] [--help] [--list-opts] [OPTIONS] COMMAND [ARGS]";
> 
> -- 
> Thanks,
> Yunlong Song
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 1/1] perf:Adding --list-opts to usage string Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-10-13 17:00 +0200
  Re: [PATCH 1/1] perf:Adding --list-opts to usage string Ramkumar Ramachandra <artagnon@gmail.com> - 2015-10-13 17:30 +0200
    Re: [PATCH 1/1] perf:Adding --list-opts to usage string Yunlong Song <yunlong.song@huawei.com> - 2015-10-14 04:30 +0200
      Re: [PATCH 1/1] perf:Adding --list-opts to usage string Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-10-14 05:20 +0200
        Re: [PATCH 1/1] perf:Adding --list-opts to usage string Namhyung Kim <namhyung@kernel.org> - 2015-10-14 05:50 +0200
        Re: [PATCH 1/1] perf:Adding --list-opts to usage string Yunlong Song <yunlong.song@huawei.com> - 2015-10-14 15:40 +0200
          Re: [PATCH 1/1] perf:Adding --list-opts to usage string Yunlong Song <yunlong.song@huawei.com> - 2015-10-15 09:20 +0200
        [PATCH] perf help: Add options description to 'perf -h' Yunlong Song <yunlong.song@huawei.com> - 2015-10-14 15:50 +0200
        [PATCH v2 2/3] perf help: Change 'usage' to 'Usage' for consistency Yunlong Song <yunlong.song@huawei.com> - 2015-10-15 09:40 +0200
        [PATCH v2 1/3] perf help: Add options description to 'perf -h' Yunlong Song <yunlong.song@huawei.com> - 2015-10-15 09:40 +0200
        [PATCH v2 3/3] perf help: Change the usage's stdout to stderr for consistency Yunlong Song <yunlong.song@huawei.com> - 2015-10-15 09:40 +0200
        [PATCH v2 0/3] perf help: Make perf's help consistent with other builtins Yunlong Song <yunlong.song@huawei.com> - 2015-10-15 09:40 +0200

csiph-web