Skip to contentSkip to conversation

qconfig: Improve the documentation

PATCH Superseded Massimo Pegorer 2 participants 4 messages Oct 3 – Oct 18

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 qconfig: Improve the documentation

Specify where the database is created and under what name. Add text value lookup examples, including quoting, escaping and regular expression cases. Update other examples, or just their output, in the section documenting -f option usage. Trivial fixes.

---
Changes in v2:
- Reword and add details.
- Update examples about -f options, or their output.
- Link to v1: https://patch.msgid.link/[email protected]

To: [email protected]
To: Simon Glass <[email protected]>
Cc: Tom Rini <[email protected]>

---
 doc/develop/qconfig.rst | 40 +++++++++++++++++++++++++++++++---------
 1 file changed, 31 insertions(+), 9 deletions(-)
doc/develop/qconfig.rst +31 -9
index a18f32470ca..8a1827e2701 100644
@@ -24,11 +24,14 @@ You may need to install 'python3-asteval' for the 'asteval' module.
 How does it work?
 -----------------
 
+The tool must be run at the top of the source directory.
+
 When building a database (`-b`), this tool runs configuration and builds
 include/autoconf.mk for every defconfig.  The config options defined in Kconfig
-appear in the .config file (unless they are hidden because of unmet dependency.)
+appear in the .config file (unless they are hidden because of unmet dependency).
 On the other hand, the config options defined by board headers are seen
-in include/autoconf.mk.
+in include/autoconf.mk.  The tool stores the database in a file named qconfig.db
+at the top of the source directory.
 
 When resyncing defconfigs (`-s`) the .config is synced by "make savedefconfig"
 and the defconfig is updated with it.
@@ -81,22 +84,41 @@ Each term is CONFIG name, with or without a tilde (~) prefix. The tool searches
 for boards which match the CONFIG name, or do not match if tilde is used. For
 example, to find boards which enabled CONFIG_SCSI but not CONFIG_BLK::
 
-    tools/qconfig.py -f SCSI ~BLK
-    3 matches
-    pg_wcom_seli8_defconfig highbank_defconfig pg_wcom_expu1_defconfig
+    ./tools/qconfig.py -f PCIE1 ~PCIE2
+    10 matches
+    MPC8548CDS_36BIT MPC8548CDS MPC8548CDS_legacy kmcent2
+    ls1012afrwy_tfa_SECURE_BOOT ls1012afrwy_tfa ls1012aqds_tfa_SECURE_BOOT
+    ls1012aqds_tfa ls1012ardb_tfa_SECURE_BOOT ls1012ardb_tfa
 
 It is also possible to search for particular values. For example, this finds all
 boards with an empty string for `CONFIG_DEFAULT_FDT_FILE`::
 
     ./tools/qconfig.py -f DEFAULT_FDT_FILE=\"\"
-    1092 matches
+    1229 matches
     ...
 
 This finds boards which have a value for SYS_MAXARGS other than 64::
 
     ./tools/qconfig.py -f ~SYS_MAXARGS=64
-    cfg CONFIG_SYS_MAXARGS
-    281 matches
+    296 matches
+    ...
+
+String values can be searched for, too, including regular expressions, but
+taking care of needed quoting and escaping. The values stored in the database
+are the ones from the Kconfig files, before expansion. Moreover, since they are
+stored with their double quotes, the quotes must be part of the pattern.
+Enclosing the pattern with single quotes makes the shell pass the double quotes
+and backslashes through unchanged. For example::
+
+    ./tools/qconfig.py -f TPL_LDSCRIPT='"arch/arm/cpu/u-boot-spl.lds"'
+    0 matches
+
+    ./tools/qconfig.py -f TPL_LDSCRIPT='"arch/.*/cpu/u-boot-spl.lds"'
+    22 matches
+    ...
+
+    ./tools/qconfig.py -f TPL_LDSCRIPT='"arch/\$\(ARCH\)/cpu/u-boot-spl.lds"'
+    22 matches
     ...
 
 
@@ -245,4 +267,4 @@ Available options
 
 To see the complete list of supported options, run::
 
-  tools/qconfig.py -h
+    ./tools/qconfig.py -h

---
base-commit: bd2f5794b7e24c62042abb1921f9c2039b920e02
change-id: 20261003-qconfigdoc-fe844c4f241f

Best regards,

Signature · 1 line
Massimo Pegorer <[email protected]>
#1 lore raw

Hi Massimo,

Quoted 14 lines · Massimo Pegorer

qconfig: Improve the documentation

Specify where the database is created and under what name. Add text value lookup examples, including quoting, escaping and regular expression cases. Update other examples, or just their output, in the section documenting -f option usage. Trivial fixes.

doc/develop/qconfig.rst | 40 +++++++++++++++++++++++++++++++---------

 1 file changed, 31 insertions(+), 9 deletions(-)

doc/develop/qconfig.rst Each term is CONFIG name, with or without a tilde (~) prefix. The tool searches · line 86

Quoted 6 lines
doc/develop/qconfig.rst +3 -3
@@ -81,22 +84,41 @@ Each term is CONFIG name, with or without a tilde (~) prefix. The tool searches
-    tools/qconfig.py -f SCSI ~BLK
-    3 matches
-    pg_wcom_seli8_defconfig highbank_defconfig pg_wcom_expu1_defconfig
+    ./tools/qconfig.py -f PCIE1 ~PCIE2
+    10 matches
+    MPC8548CDS_36BIT MPC8548CDS MPC8548CDS_legacy kmcent2

The sentence above still says 'to find boards which enabled CONFIG_SCSI but not CONFIG_BLK', which no longer matches the example. Please can you update it to refer to CONFIG_PCIE1 and CONFIG_PCIE2?

doc/develop/qconfig.rst Each term is CONFIG name, with or without a tilde (~) prefix. The tool searches · line 87

Quoted 6 lines
doc/develop/qconfig.rst +4 -0
@@ -81,22 +84,41 @@ Each term is CONFIG name, with or without a tilde (~) prefix. The tool searches
+String values can be searched for, too, including regular expressions, but
+taking care of needed quoting and escaping. The values stored in the database
+are the ones from the Kconfig files, before expansion. Moreover, since they are
+stored with their double quotes, the quotes must be part of the pattern.

This is much clearer, thanks. One point I might have missed earlier:
the pattern must match the whole value, since defconfig_matches() uses fullmatch(). Otherwise a reader might expect something like '"arch/.*' to work. Please can you add a sentence about this?

Regards,
Simon

#2 lore raw

Hi Simon,

Il giorno ven 9 ott 2026 alle ore 09:20 Simon Glass ha scritto:

Quoted 16 lines

Hi Massimo,

Quoted 11 lines · Massimo Pegorer

qconfig: Improve the documentation

Specify where the database is created and under what name. Add text value lookup examples, including quoting, escaping and regular expression cases. Update other examples, or just their output, in the section documenting -f option usage. Trivial fixes.

doc/develop/qconfig.rst | 40 +++++++++++++++++++++++++++++++---------

 1 file changed, 31 insertions(+), 9 deletions(-)
Quoted 12 lines

doc/develop/qconfig.rst Each term is CONFIG name, with or without a tilde (~) prefix. The tool searches · line 86

Quoted 8 lines
doc/develop/qconfig.rst +3 -3
@@ -81,22 +84,41 @@ Each term is CONFIG name, with or without a tilde (~) prefix. The tool searches
-    tools/qconfig.py -f SCSI ~BLK
-    3 matches
-    pg_wcom_seli8_defconfig highbank_defconfig pg_wcom_expu1_defconfig
+    ./tools/qconfig.py -f PCIE1 ~PCIE2
+    10 matches
+    MPC8548CDS_36BIT MPC8548CDS MPC8548CDS_legacy kmcent2

The sentence above still says 'to find boards which enabled CONFIG_SCSI but not CONFIG_BLK', which no longer matches the example. Please can you update it to refer to CONFIG_PCIE1 and CONFIG_PCIE2?

Ouch! Sure, I will fix in v3, sorry.

Quoted 12 lines

doc/develop/qconfig.rst Each term is CONFIG name, with or without a tilde (~) prefix. The tool searches · line 87

Quoted 7 lines
doc/develop/qconfig.rst +4 -0
@@ -81,22 +84,41 @@ Each term is CONFIG name, with or without a tilde (~) prefix. The tool searches
+String values can be searched for, too, including regular expressions, but
+taking care of needed quoting and escaping. The values stored in the database
+are the ones from the Kconfig files, before expansion. Moreover, since they are
+stored with their double quotes, the quotes must be part of the pattern.

This is much clearer, thanks. One point I might have missed earlier:
the pattern must match the whole value, since defconfig_matches() uses fullmatch(). Otherwise a reader might expect something like '"arch/.*' to work. Please can you add a sentence about this?

I'm not sure I follow your example: '"arch/.*' will catch any configurations with CONFIG_TPL_LDSCRIPT values starting with arch/ and therefore, from my point of view, it is working as I would expect. The '.*' pattern matches anything including starting and ending double quotes. If you would like to utline that the pattern must match the whole value and not just a part of it, maybe I can reword as follows:

The values stored in the database are the ones from the Kconfig files, before expansion. Moreover, since they are stored with their double quotes, and the pattern must match the whole value, the quotes must be part of the pattern.

Would it be fine for v3 ? If you prefer anything else, let me know. Thanks.

Regards,
Massimo

Quoted 3 lines

Regards,
Simon

#3 lore raw

Hi Simon,

Please, ignore my previous proposal, below. I've just sent a v3 with fix and (hopefully) improved examples, including whole value matching details. Thanks.

Regards,
Massimo

Il giorno gio 15 ott 2026 alle ore 18:17 Massimo Pegorer ha scritto:

Quoted 67 lines

Hi Simon,

Il giorno ven 9 ott 2026 alle ore 09:20 Simon Glass ha scritto:

Quoted 16 lines

Hi Massimo,

Quoted 11 lines · Massimo Pegorer

qconfig: Improve the documentation

Specify where the database is created and under what name. Add text value lookup examples, including quoting, escaping and regular expression cases. Update other examples, or just their output, in the section documenting -f option usage. Trivial fixes.

doc/develop/qconfig.rst | 40 +++++++++++++++++++++++++++++++---------

 1 file changed, 31 insertions(+), 9 deletions(-)
Quoted 12 lines

doc/develop/qconfig.rst Each term is CONFIG name, with or without a tilde (~) prefix. The tool searches · line 86

Quoted 8 lines
doc/develop/qconfig.rst +3 -3
@@ -81,22 +84,41 @@ Each term is CONFIG name, with or without a tilde (~) prefix. The tool searches
-    tools/qconfig.py -f SCSI ~BLK
-    3 matches
-    pg_wcom_seli8_defconfig highbank_defconfig pg_wcom_expu1_defconfig
+    ./tools/qconfig.py -f PCIE1 ~PCIE2
+    10 matches
+    MPC8548CDS_36BIT MPC8548CDS MPC8548CDS_legacy kmcent2

The sentence above still says 'to find boards which enabled CONFIG_SCSI but not CONFIG_BLK', which no longer matches the example. Please can you update it to refer to CONFIG_PCIE1 and CONFIG_PCIE2?

Ouch! Sure, I will fix in v3, sorry.

Quoted 12 lines

doc/develop/qconfig.rst Each term is CONFIG name, with or without a tilde (~) prefix. The tool searches · line 87

Quoted 7 lines
doc/develop/qconfig.rst +4 -0
@@ -81,22 +84,41 @@ Each term is CONFIG name, with or without a tilde (~) prefix. The tool searches
+String values can be searched for, too, including regular expressions, but
+taking care of needed quoting and escaping. The values stored in the database
+are the ones from the Kconfig files, before expansion. Moreover, since they are
+stored with their double quotes, the quotes must be part of the pattern.

This is much clearer, thanks. One point I might have missed earlier:
the pattern must match the whole value, since defconfig_matches() uses fullmatch(). Otherwise a reader might expect something like '"arch/.*' to work. Please can you add a sentence about this?

I'm not sure I follow your example: '"arch/.*' will catch any configurations with CONFIG_TPL_LDSCRIPT values starting with arch/ and therefore, from my point of view, it is working as I would expect. The '.*' pattern matches anything including starting and ending double quotes. If you would like to utline that the pattern must match the whole value and not just a part of it, maybe I can reword as follows:

The values stored in the database are the ones from the Kconfig files, before expansion. Moreover, since they are stored with their double quotes, and the pattern must match the whole value, the quotes must be part of the pattern.

Would it be fine for v3 ? If you prefer anything else, let me know. Thanks.

Regards,
Massimo

Quoted 3 lines

Regards,
Simon