summaryrefslogtreecommitdiffstats
path: root/scripts/lib/abi/helpers.py
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2025-02-10 11:18:15 +0100
committerJonathan Corbet <corbet@lwn.net>2025-02-10 11:19:57 -0700
commit0d5fd96880d9135a4b35fb5523896b21b13dde78 (patch)
treef1d100be93393620ba7e08ae6a14316b85155604 /scripts/lib/abi/helpers.py
parent6649b4217089c5d17dc210946baf9c9537c7fb5d (diff)
downloadlinux-stable-0d5fd96880d9135a4b35fb5523896b21b13dde78.tar.gz
linux-stable-0d5fd96880d9135a4b35fb5523896b21b13dde78.tar.bz2
linux-stable-0d5fd96880d9135a4b35fb5523896b21b13dde78.zip
scripts/get_abi.py: add support for undefined ABIs
The undefined logic is complex and has lots of magic on it. Implement it, using the same algorithm we have at get_abi.pl. Yet, some tweaks to optimize performance and to make the code simpler were added here: - at the perl version, the tree graph had loops, so we had to use BFS to traverse it. On this version, the graph is a tree, so, it simplifies the what group for sysfs aliases; - the logic which splits regular expressions into subgroups was re-written to make it faster; - it may optionally use multiple processes to search for symbol matches; - it has some additional debug levels. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/1529c255845d117696d5af57d8dc05554663afdf.1739182025.git.mchehab+huawei@kernel.org
Diffstat (limited to 'scripts/lib/abi/helpers.py')
-rw-r--r--scripts/lib/abi/helpers.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/scripts/lib/abi/helpers.py b/scripts/lib/abi/helpers.py
index 84a253ed5058..639b23e4ca33 100644
--- a/scripts/lib/abi/helpers.py
+++ b/scripts/lib/abi/helpers.py
@@ -16,13 +16,23 @@ class AbiDebug:
WHAT_PARSING = 1
WHAT_OPEN = 2
DUMP_ABI_STRUCTS = 4
+ UNDEFINED = 8
+ REGEX = 16
+ SUBGROUP_MAP = 32
+ SUBGROUP_DICT = 64
+ SUBGROUP_SIZE = 128
+ GRAPH = 256
DEBUG_HELP = """
-Print debug information according with the level(s),
-which is given by the following bitmask:
-
1 - enable debug parsing logic
2 - enable debug messages on file open
4 - enable debug for ABI parse data
+8 - enable extra debug information to identify troubles
+ with ABI symbols found at the local machine that
+ weren't found on ABI documentation (used only for
+ undefined subcommand)
+16 - enable debug for what to regex conversion
+32 - enable debug for symbol regex subgroups
+64 - enable debug for sysfs graph tree variable
"""