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


Groups > linux.kernel > #1594364 > unrolled thread

Re: [PATCH 02/23] perf buildid-cache: Add -q/--quiet option

Started byArnaldo Carvalho de Melo <acme@kernel.org>
First post2017-03-07 16:40 +0100
Last post2017-03-07 18:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 02/23] perf buildid-cache: Add -q/--quiet option Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-07 16:40 +0100
    Re: [PATCH 02/23] perf buildid-cache: Add -q/--quiet option Namhyung Kim <namhyung@kernel.org> - 2017-03-07 18:30 +0100

#1594364 — Re: [PATCH 02/23] perf buildid-cache: Add -q/--quiet option

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2017-03-07 16:40 +0100
SubjectRe: [PATCH 02/23] perf buildid-cache: Add -q/--quiet option
Message-ID<tipnt-152-35@gated-at.bofh.it>
Em Wed, Mar 08, 2017 at 12:08:30AM +0900, Namhyung Kim escreveu:
> The -q/--quiet option is to suppress any message.  Sometimes users just
> want to run the command and it can be used for that case.

<SNIP>

> +++ b/tools/perf/builtin-buildid-cache.c
> @@ -311,6 +311,7 @@ int cmd_buildid_cache(int argc, const char **argv,
>  	OPT_INCR('v', "verbose", &verbose, "be more verbose"),
> +	OPT_BOOLEAN('q', "quiet", &quiet, "Do not show any message"),
>  	OPT_END()
>  	};
>  	const char * const buildid_cache_usage[] = {
> @@ -326,6 +327,9 @@ int cmd_buildid_cache(int argc, const char **argv,
>  
> +	if (quiet)
> +		perf_quiet_option();
> +

Hey, I see that this is done lots of times, can't we use that parent
option stuff? Or some fallback we can have in perf's main() for thing
like this?

- Arnaldo

[toc] | [next] | [standalone]


#1594451

FromNamhyung Kim <namhyung@kernel.org>
Date2017-03-07 18:30 +0100
Message-ID<tir5T-2l6-7@gated-at.bofh.it>
In reply to#1594364
Hi Arnaldo,

On Wed, Mar 8, 2017 at 12:28 AM, Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
> Em Wed, Mar 08, 2017 at 12:08:30AM +0900, Namhyung Kim escreveu:
>> The -q/--quiet option is to suppress any message.  Sometimes users just
>> want to run the command and it can be used for that case.
>
> <SNIP>
>
>> +++ b/tools/perf/builtin-buildid-cache.c
>> @@ -311,6 +311,7 @@ int cmd_buildid_cache(int argc, const char **argv,
>>       OPT_INCR('v', "verbose", &verbose, "be more verbose"),
>> +     OPT_BOOLEAN('q', "quiet", &quiet, "Do not show any message"),
>>       OPT_END()
>>       };
>>       const char * const buildid_cache_usage[] = {
>> @@ -326,6 +327,9 @@ int cmd_buildid_cache(int argc, const char **argv,
>>
>> +     if (quiet)
>> +             perf_quiet_option();
>> +
>
> Hey, I see that this is done lots of times, can't we use that parent
> option stuff? Or some fallback we can have in perf's main() for thing
> like this?

I thought about it.  But perf main option handling is different from
command options.  Also it needs to be called after option parsing
is done to overwrite 'verbose' properly.

Thanks,
Namhyung

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web