0d5fd968 | 10-Feb-2025 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
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 opti
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
show more ...
|
6649b421 | 10-Feb-2025 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
scripts/lib/abi/abi_parser.py: make it backward-compatible with Python 3.6
Despite being introduced on Python 3.6, the original implementation was too limited: it doesn't accept anything but the arg
scripts/lib/abi/abi_parser.py: make it backward-compatible with Python 3.6
Despite being introduced on Python 3.6, the original implementation was too limited: it doesn't accept anything but the argument.
Even on python 3.10.12, support was still limited, as more complex operations cause SyntaxError:
Exception occurred: File ".../linux/Documentation/sphinx/kernel_abi.py", line 48, in <module> from get_abi import AbiParser File ".../linux/scripts/lib/abi/abi_parser.py", line 525 msg += f"{part}\n{"-" * len(part)}\n\n" ^ SyntaxError: f-string: expecting '}'
Replace f-strings by normal string concatenation when it doesn't work on Python 3.6.
Reported-by: Akira Yokosawa <akiyks@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/41d2f85df134a46db46fed73a0f9697a3d2ae9ba.1739182025.git.mchehab+huawei@kernel.org
show more ...
|
dc525a76 | 10-Feb-2025 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
scripts/lib/abi/abi_parser.py: Rename title name for ABI files
This makes them look better when generating cross-references.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-
scripts/lib/abi/abi_parser.py: Rename title name for ABI files
This makes them look better when generating cross-references.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/e44574cb2796861d6acbce839068ed3ef385d16c.1739182025.git.mchehab+huawei@kernel.org
show more ...
|
c9408169 | 10-Feb-2025 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
docs: sphinx/automarkup: add cross-references for ABI
Now that all ABI files are handled together, we can add a feature at automarkup for it to generate cross-references for ABI symbols.
The cross-
docs: sphinx/automarkup: add cross-references for ABI
Now that all ABI files are handled together, we can add a feature at automarkup for it to generate cross-references for ABI symbols.
The cross-reference logic can produce references for all existing files, except for README (as this is not parsed).
For symbols, they need to be an exact match of what it is described at the docs, which is not always true due to wildcards.
If symbols at /sys /proc and /config are identical, a cross-reference will be used.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/0b97a51b68b1c20127ad4a6a55658557fe0848d0.1739182025.git.mchehab+huawei@kernel.org
show more ...
|
5d7871d7 | 10-Feb-2025 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
docs: sphinx/kernel_abi: parse ABI files only once
Right now, the logic parses ABI files on 4 steps, one for each directory. While this is fine in principle, by doing that, not all symbol cross-refe
docs: sphinx/kernel_abi: parse ABI files only once
Right now, the logic parses ABI files on 4 steps, one for each directory. While this is fine in principle, by doing that, not all symbol cross-references will be created.
Change the logic to do the parsing only once in order to get a global dictionary to be used when creating ABI cross-references.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/5205c53838b6ea25f4cdd4cc1e3d17c0141e75a6.1739182025.git.mchehab+huawei@kernel.org
show more ...
|
98a4324a | 10-Feb-2025 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
scripts/get_abi.pl: add support to parse ABI README file
The Documentation/ABI/README file is currently outside the documentation tree. Yet, it may still provide some useful information. Add it to t
scripts/get_abi.pl: add support to parse ABI README file
The Documentation/ABI/README file is currently outside the documentation tree. Yet, it may still provide some useful information. Add it to the documentation parsing.
As a plus, this avoids a warning when detecting missing cross-references.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/f1285dedfe4d0eb0f0af34f6a68bee6fde36dd7d.1739182025.git.mchehab+huawei@kernel.org
show more ...
|
2a21d80d | 10-Feb-2025 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
scripts/get_abi.pl: Add filtering capabilities to rest output
This way, Sphinx ABI extension can parse symbols only once, while keep displaying results in separate files.
Signed-off-by: Mauro Carva
scripts/get_abi.pl: Add filtering capabilities to rest output
This way, Sphinx ABI extension can parse symbols only once, while keep displaying results in separate files.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/41e108e816e46434aa596e5c0d25d227cb9f0fe5.1739182025.git.mchehab+huawei@kernel.org
show more ...
|
aea5e52d | 10-Feb-2025 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
docs: sphinx/kernel_abi: reduce buffer usage for ABI messages
Instead of producing a big message with all ABI contents and then parse as a whole, simplify the code by handling each ABI symbol in sep
docs: sphinx/kernel_abi: reduce buffer usage for ABI messages
Instead of producing a big message with all ABI contents and then parse as a whole, simplify the code by handling each ABI symbol in separate. As an additional benefit, there's no need to place file/line nubers inlined at the data and use a regex to convert them.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/15be22955e3c6df49d7256c8fd24f62b397ad0ff.1739182025.git.mchehab+huawei@kernel.org
show more ...
|
ee34f830 | 10-Feb-2025 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
docs: sphinx/kernel_abi: use AbiParser directly
Instead of running get_abi.py script, import AbiParser class and handle messages directly there using an interactor. This shold save some memory, as t
docs: sphinx/kernel_abi: use AbiParser directly
Instead of running get_abi.py script, import AbiParser class and handle messages directly there using an interactor. This shold save some memory, as there's no need to exec python inside the Sphinx python extension.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/8dbc244dcda97112c1b694e2512a5d600e62873b.1739182025.git.mchehab+huawei@kernel.org
show more ...
|
9bec7870 | 10-Feb-2025 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
scripts/lib/abi/abi_parser.py: use an interactor for ReST output
Instead of printing all results line per line, use an interactor to return each variable as a separate message.
This won't change mu
scripts/lib/abi/abi_parser.py: use an interactor for ReST output
Instead of printing all results line per line, use an interactor to return each variable as a separate message.
This won't change much when using it via command line, but it will help Sphinx integration by providing an interactor that could be used there to handle ABI symbol by symbol.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/e3c94b8cdfd5e955aa19a703921f364a89089634.1739182025.git.mchehab+huawei@kernel.org
show more ...
|
c67c3fbd | 10-Feb-2025 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
scripts/lib/abi/abi_parser.py: optimize parse_abi() function
Instead of using glob, use a recursive function to parse all files.
Such change reduces the total excecution time by 15% with my SSD dis
scripts/lib/abi/abi_parser.py: optimize parse_abi() function
Instead of using glob, use a recursive function to parse all files.
Such change reduces the total excecution time by 15% with my SSD disks.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/190dd358897017ed82c56f1e263192215ffbae43.1739182025.git.mchehab+huawei@kernel.org
show more ...
|
6b48bea1 | 10-Feb-2025 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
scripts/get_abi.py: add support for symbol search
Add support for searching symbols from Documentation/ABI using regular expressions to match the symbols' names.
Signed-off-by: Mauro Carvalho Cheha
scripts/get_abi.py: add support for symbol search
Add support for searching symbols from Documentation/ABI using regular expressions to match the symbols' names.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/21b2c48657dde112d5417dcd7e0aa7cd383b9a0a.1739182025.git.mchehab+huawei@kernel.org
show more ...
|