lkml.org 
[lkml]   [2018]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 3/3] perf: Support perf -vv

* Jin Yao <yao.jin@linux.intel.com> wrote:

> +++ b/tools/perf/perf.c
> @@ -64,6 +64,7 @@ static struct cmd_struct commands[] = {
> { "top", cmd_top, 0 },
> { "annotate", cmd_annotate, 0 },
> { "version", cmd_version, 0 },
> + { "version2", cmd_version2, 0 },
> { "script", cmd_script, 0 },
> { "sched", cmd_sched, 0 },
> #ifdef HAVE_LIBELF_SUPPORT
> @@ -190,6 +191,11 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
> break;
> }
>
> + if (!strcmp(cmd, "-vv")) {
> + (*argv)[0] = "--version2";
> + break;
> + }

That is just lazy hackery, please use the regular option library to add options
and document them!

Also, '--version2' is a sloppy name, the right solution is to do what Git does, it
has a --build-options sub-option to 'perf version':

triton:~/tip> git version -h
usage: git version [<options>]

--build-options also print build options


triton:~/tip> git version --build-options
git version 2.14.1
sizeof-long: 8

This should be done for perf as well, and _then_ maybe can we add a helper alias
that maps '-vv' to 'version --build-options'.

Thanks,

Ingo

\
 
 \ /
  Last update: 2018-03-27 08:03    [W:0.162 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site