lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4CFC493D.6010605@hitachi.com>
Date:	Mon, 06 Dec 2010 11:23:57 +0900
From:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To:	Akihiro Nagai <akihiro.nagai.hw@...achi.com>
Cc:	linux-kernel@...r.kernel.org,
	Peter Zijlstra <peterz@...radead.org>,
	Paul Mackerras <paulus@...ba.org>, Ingo Molnar <mingo@...e.hu>,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
Subject: Re: [PATCH -tip  1/7] perf: add OPT_CALLBACK_DEFAULT_NOOPT

(2010/12/03 12:58), Akihiro Nagai wrote:
> Add new macro OPT_CALLBACK_DEFAULT_NOOPT for parse_options.
> It enables to pass the default value (opt->defval) to the callback function
> processing options require no argument.
> 
> Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@...achi.com>

This could be useful for perf probe too. :)

Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>

> Cc: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Paul Mackerras <paulus@...ba.org>
> Cc: Ingo Molnar <mingo@...e.hu>
> Cc: Arnaldo Carvalho de Melo <acme@...stprotocols.net>
> Cc: linux-kernel@...r.kernel.org
> ---
> 
>  tools/perf/util/parse-options.h |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/tools/perf/util/parse-options.h b/tools/perf/util/parse-options.h
> index c7d72dc..abc31a1 100644
> --- a/tools/perf/util/parse-options.h
> +++ b/tools/perf/util/parse-options.h
> @@ -119,6 +119,10 @@ struct option {
>  	{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), (a), .help = (h), .callback = (f), .flags = PARSE_OPT_NOARG }
>  #define OPT_CALLBACK_DEFAULT(s, l, v, a, h, f, d) \
>  	{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), (a), .help = (h), .callback = (f), .defval = (intptr_t)d, .flags = PARSE_OPT_LASTARG_DEFAULT }
> +#define OPT_CALLBACK_DEFAULT_NOOPT(s, l, v, a, h, f, d) \
> +	{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l),\
> +	.value = (v), (a), .help = (h), .callback = (f), .defval = (intptr_t)d,\
> +	.flags = PARSE_OPT_LASTARG_DEFAULT | PARSE_OPT_NOARG}
>  
>  /* parse_options() will filter out the processed options and leave the
>   * non-option argments in argv[].
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


-- 
Masami HIRAMATSU
2nd Dept. Linux Technology Center
Hitachi, Ltd., Systems Development Laboratory
E-mail: masami.hiramatsu.pt@...achi.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ