[U-Boot] [RFC PATCH v1] tools: Add a tool to get an overview of the usage of CONFIG options

Jean-Jacques Hiblot jjhiblot at ti.com
Tue Sep 18 06:57:08 UTC 2018



On 18/09/2018 04:05, Simon Glass wrote:
> HI Jean-Jacques,
>
> On 17 September 2018 at 09:31, Jean-Jacques Hiblot <jjhiblot at ti.com> wrote:
>> scan_configs.py is tool that allow to check how some options are used for
>> a particular subset of platforms.
>> The purpose is to identify the targets that are actually using one or more
>> options of interest.
>> For example, it can tell what targets are still using CONFIG_DM_I2_COMPAT.
>> This is much slower that greping the configs directory but is actually more
>> accurate as it relies on the information found in u-boot.cfg instead.
>> It can also perform diffs between u-boot.cfg and spl/u-boot.cfg (sometimes
>> platforms change the CONFIG options in the header file for the SPL) and
>> diffs between .config and u-boot.cfg. This last is useful to identify
>> options that could be moved to defconfigs.
>>
>> usage: scan_configs.py [-h] [--soc SOC] [--vendor VENDOR] [--arch ARCH]
>>                         [--cpu CPU] [--board BOARD] [--target TARGET]
>>                         [-j JOBS] [-v] [-p] [--keep] [--nobuild]
>>                         [--uboot | --spl | --spldiff | --dotconfdiff]
>>                         OPTION [OPTION ...]
>>
>> all filtering parameters (OPTION, vendor, arch, ...) accept regexp.
>> ex: scan_configs.py .*DM_I2C.* --soc 'omap[2345]|k3' will match
>> CONFIG_DM_I2C and CONFIG_DM_I2C_COMPAT and look for it only for targets
>> using the omap2, omap3, omap4, omap5 or k3 SOCs.
>>
>> Signed-off-by: Jean-Jacques Hiblot <jjhiblot at ti.com>
>>
>> ---
>> I wrote this tool because I was struggling keeping in mind all the
>> platforms that were impacted by a WIP on DM_I2C_COMPAT for TI platforms.
>> You may find it useful too.
>>
>> limitations:
>> - must be executed at the root of the source tree
>> - the source tree must be clean (make mrproper)
>> - only supports CSV format. visualization in terminal sould be added.
>>    But LibreOffice calc is better suited with all its ordering/
>>    filtering capabilities.
>>
>>   tools/scan_configs.py | 379 ++++++++++++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 379 insertions(+)
>>   create mode 100755 tools/scan_configs.py
> This looks useful, but...
>
> Have you looked at moveconfig? It has a way to create a CONFIG
> database which can be queried.
I did know this tool.
It looks indeed like this part of the code could be common.
I'll give a try.

Thanks,
JJ
>
> Regards,
> Simon
>



More information about the U-Boot mailing list