From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751853AbbJNDK5 (ORCPT ); Tue, 13 Oct 2015 23:10:57 -0400 Received: from mail.kernel.org ([198.145.29.136]:57771 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750852AbbJNDKy (ORCPT ); Tue, 13 Oct 2015 23:10:54 -0400 Date: Wed, 14 Oct 2015 00:10:43 -0300 From: Arnaldo Carvalho de Melo To: Yunlong Song Cc: Ramkumar Ramachandra , Sriram Raghunathan , Peter Zijlstra , Adrian Hunter , Jiri Olsa , Namhyung Kim , David Ahern , Linux Kernel Mailing List , Wang Nan , Ingo Molnar Subject: Re: [PATCH 1/1] perf:Adding --list-opts to usage string Message-ID: <20151014031043.GA3775@kernel.org> References: <1444282190-13605-1-git-send-email-sriram.r@nokia.com> <20151013145728.GT14409@kernel.org> <561DBDF1.1020503@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <561DBDF1.1020503@huawei.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 [] [] -T, --transaction hardware transaction statistics -e, --event event selector. use 'perf list' to list available events --filter event filter -i, --no-inherit child tasks do not inherit counters -p, --pid stat events on existing process id -t, --tid stat events on existing thread id -a, --all-cpus system-wide collection from all CPUs -I, --interval-print 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 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