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]
Date:	Thu, 26 Nov 2015 16:05:22 +0800
From:	"Wangnan (F)" <wangnan0@...wei.com>
To:	平松雅巳 / HIRAMATU,MASAMI 
	<masami.hiramatsu.pt@...achi.com>,
	"acme@...nel.org" <acme@...nel.org>
CC:	"lizefan@...wei.com" <lizefan@...wei.com>,
	"pi3orama@....com" <pi3orama@....com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Alexei Starovoitov <ast@...nel.org>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Namhyung Kim <namhyung@...nel.org>
Subject: Re: [PATCH 1/2] perf tools: Always give options even it not compiled



On 2015/11/20 18:54, 平松雅巳 / HIRAMATU,MASAMI wrote:
>> From: Wang Nan [mailto:wangnan0@...wei.com]
>>
>> This patch keeps options of perf builtins same in all condition. If the
>> option is disabled because of compiling options, users should be
>> notified.
>>
>> This patch does it by introducing a series of new option macros, flags
>> and field in struct options. For those options disabled by compiling,
>> OPT_NOTBUILT_NOARG, OPT_NOTBUILT_OPTARG and OPT_NOTBUILT can be used
>> to record the help messages and the reason why not built them.
>>
>> Options in 'perf record' and 'perf probe' are fixed by those new macros.
> Hmm, OK, I agree the reason why this is useful. Could you reconsider
> the implementation, because just cloning the code is ugly and not
> maintainable?
>
> It will be better if we can replace OPT_BOOLEAN with;
>
>     OPT_DEPENDS(HAVE_DWARF_SUPPORT, BOOLEAN, '\0', "no-inlines", &probe_conf.no_inlines, ...
>
> This may be done by following macros ;
>
> ----
> #define OPTMSG_HAVE_DWARF_SUPPORT "NO_DWARF"
> #ifdef HAVE_DWARF_SUPPORT
> #define OPTVAL_HAVE_DWARF_SUPPORT 1
> #else
> #define OPTVAL_HAVE_DWARF_SUPPORT 0
> #endif
>
> #define __OPT_DEPENDS(val, msg, opt, ...)	\
> 	{.type = OPTION_NEXT_DEPENDS, .value = (void *)val, .data = msg, }, opt(__VA_ARGS__)
>
> #define _OPT_DEPENDS(val, msg, opt, ...)	\
> 	__OPT_DEPENDS(val, msg, opt, __VA_ARGS__)
>
> #define OPT_DEPENDS(flag, opt, ...)	\
> 	_OPT_DEPENDS(OPTVAL_ ## flag, OPTMSG_ ## flag, OPT_ ## opt, __VA_ARGS__)
> ----
>
> And if the parser find OPTION_NEXT_DEPENDS and .value != NULL, it skips next entry.
>

That would be good, but don't forget we have a options__order() which
reorder the options array. To archive our goal I think we must preprocess
the options array to 'merge' information in the OPTION_NEXT_DEPENDS into
the real option it decorates.

Thank you.

> Thank you,
>


--
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