Skip to content

Improve ABI documentation generation

Mauro Carvalho Chehab bpf linux-arm-kernel linux-doc linux-f2fs-devel linux-hardening linux-wireless lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest27 patches 3 repliesIn review 1 of 27 applied

Patches in v1 1 of 27 applied

#Subject and filesSizeRepliesApplied
1/27docs: sphinx: remove kernellog.py fileDocumentation/sphinx/kernel_abi.py Documentation/sphinx/kerneldoc.py Documentation/sphinx/kernellog.py +1 more+53 -690 replies
2/27docs: sphinx/kernel_abi: adjust coding styleDocumentation/sphinx/kernel_abi.py+12 -130 replies
3/27docs: admin-guide: abi: add SPDX tags to ABI filesDocumentation/admin-guide/abi-obsolete.rst Documentation/admin-guide/abi-removed.rst Documentation/admin-guide/abi-stable.rst +2 more+10 -00 replies
4/27ABI: sysfs-class-rfkill: fix kernelversion tagsDocumentation/ABI/removed/sysfs-class-rfkill Documentation/ABI/stable/sysfs-class-rfkill+7 -70 replies
5/27ABI: sysfs-bus-coresight-*: fix kernelversion tagsDocumentation/ABI/testing/sysfs-bus-coresight-devices-cti Documentation/ABI/testing/sysfs-bus-coresight-devices-tpdm+65 -651 reply
6/27ABI: sysfs-driver-dma-idxd: fix date tagsDocumentation/ABI/stable/sysfs-driver-dma-idxd+2 -20 replies
7/27ABI: sysfs-fs-f2fs: fix date tagsDocumentation/ABI/testing/sysfs-fs-f2fs+2 -20 repliesApplied
8/27ABI: sysfs-power: fix a what tagDocumentation/ABI/testing/sysfs-power+1 -10 replies
9/27scripts/documentation-file-ref-check: don't check perl/python scriptsscripts/documentation-file-ref-check+1 -10 replies
10/27scripts/get_abi.py: add a Python tool to generate ReST outputscripts/get_abi.py scripts/lib/abi/abi_parser.py scripts/lib/abi/helpers.py+658 -00 replies
11/27scripts/get_abi.py: add support for symbol searchscripts/get_abi.py scripts/lib/abi/abi_parser.py+76 -00 replies
12/27docs: use get_abi.py for ABI generationDocumentation/admin-guide/abi-obsolete.rst Documentation/admin-guide/abi-removed.rst Documentation/admin-guide/abi-stable.rst +2 more+3 -110 replies
13/27scripts/lib/abi/abi_parser.py: optimize parse_abi() functionscripts/lib/abi/abi_parser.py+38 -190 replies
14/27scripts/lib/abi/abi_parser.py: use an interactor for ReST outputscripts/get_abi.py scripts/lib/abi/abi_parser.py+28 -230 replies
15/27docs: sphinx/kernel_abi: use AbiParser directlyDocumentation/sphinx/kernel_abi.py scripts/lib/abi/abi_parser.py+17 -140 replies
16/27docs: sphinx/kernel_abi: reduce buffer usage for ABI messagesDocumentation/sphinx/kernel_abi.py scripts/get_abi.py scripts/lib/abi/abi_parser.py+48 -450 replies
17/27docs: sphinx/kernel_abi: properly split linesDocumentation/sphinx/kernel_abi.py+3 -20 replies
18/27scripts/get_abi.pl: Add filtering capabilities to rest outputscripts/lib/abi/abi_parser.py+15 -60 replies
19/27scripts/get_abi.pl: add support to parse ABI README filescripts/lib/abi/abi_parser.py+20 -50 replies
20/27docs: sphinx/kernel_abi: parse ABI files only onceDocumentation/admin-guide/abi-obsolete.rst Documentation/admin-guide/abi-removed.rst Documentation/admin-guide/abi-stable.rst +3 more+81 -640 replies
21/27docs: admin-guide/abi: split files from symbolsDocumentation/admin-guide/abi-obsolete-files.rst Documentation/admin-guide/abi-obsolete.rst Documentation/admin-guide/abi-readme-file.rst +7 more+53 -00 replies
22/27docs: sphinx/automarkup: add cross-references for ABIDocumentation/sphinx/automarkup.py scripts/lib/abi/abi_parser.py+56 -00 replies
23/27docs: sphinx/kernel_abi: avoid warnings during Sphinx module initDocumentation/sphinx/automarkup.py Documentation/sphinx/kernel_abi.py+22 -50 replies
24/27scripts/lib/abi/abi_parser.py: Rename title name for ABI filesscripts/lib/abi/abi_parser.py+1 -10 replies
25/27scripts/lib/abi/abi_parser.py: make it backward-compatible with Python 3.6scripts/lib/abi/abi_parser.py+10 -60 replies
26/27scripts/get_abi.py: add support for undefined ABIsscripts/get_abi.py scripts/lib/abi/abi_regex.py scripts/lib/abi/helpers.py +1 more+693 -30 replies
27/27scripts/get_abi.pl: drop now obsoleted scriptscripts/get_abi.pl+0 -11030 replies

Reviews trailers per patch

1 of 27 patches has a Reviewed-by or Acked-by.

PatchSuzuki K Poulose
1/27
2/27
3/27
4/27
5/27A-b
6/27
7/27
8/27
9/27
10/27
11/27
12/27
13/27
14/27
15/27
16/27
17/27
18/27
19/27
20/27
21/27
22/27
23/27
24/27
25/27
26/27
27/27

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/27] Improve ABI documentation generation

Hi Jon/Greg,

This series replace get_abi.pl with a Python version.

I originally started it due to some issues I noticed when searching for ABI symbols. While I could just go ahead and fix the already existing script, I noticed that the script maintainance didn't have much care over all those years, probably because it is easier to find Python programmers those days.

Also, the code is complex and was not using modules or classes and were using lots of global variables.

So, I decided to rewrite it in Python. I started with a manual conversion for each function. Yet, to avoid future maintainership issues, I opted to divide the main code on three classes, each on a sepaparate file.

Just like the original RFC, I opted to keep the Sphinx kernel-abi module on three different phases:

- call get_abi.py as an exec file;
- import AbiParser on a minimal integration scenario;
- cleanup the code to avoid needing to parse line numbers from the text.

This way, if something goes wrong, it would be easier to just revert any offending patches, It also provides a better rationale about what each logical change is doing.

The initial patches on this series do some preparation work and cleans some ABI symbol bugs that lack ":" delimiter.

I opted to place on this series the Sphinx and Python version updates.

I still have ~10 patches here with additional cleanups, from the original series I sent as RFC but let's get the main changes merged first.

Mauro Carvalho Chehab (27):
docs: sphinx: remove kernellog.py file
docs: sphinx/kernel_abi: adjust coding style
docs: admin-guide: abi: add SPDX tags to ABI files
ABI: sysfs-class-rfkill: fix kernelversion tags
ABI: sysfs-bus-coresight-*: fix kernelversion tags
ABI: sysfs-driver-dma-idxd: fix date tags
ABI: sysfs-fs-f2fs: fix date tags
ABI: sysfs-power: fix a what tag scripts/documentation-file-ref-check: don't check perl/python scripts scripts/get_abi.py: add a Python tool to generate ReST output scripts/get_abi.py: add support for symbol search
docs: use get_abi.py for ABI generation scripts/lib/abi/abi_parser.py: optimize parse_abi() function scripts/lib/abi/abi_parser.py: use an interactor for ReST output
docs: sphinx/kernel_abi: use AbiParser directly
docs: sphinx/kernel_abi: reduce buffer usage for ABI messages
docs: sphinx/kernel_abi: properly split lines scripts/get_abi.pl: Add filtering capabilities to rest output scripts/get_abi.pl: add support to parse ABI README file
docs: sphinx/kernel_abi: parse ABI files only once
docs: admin-guide/abi: split files from symbols
docs: sphinx/automarkup: add cross-references for ABI
docs: sphinx/kernel_abi: avoid warnings during Sphinx module init scripts/lib/abi/abi_parser.py: Rename title name for ABI files scripts/lib/abi/abi_parser.py: make it backward-compatible with Python

    3.6

scripts/get_abi.py: add support for undefined ABIs scripts/get_abi.pl: drop now obsoleted script

 Documentation/ABI/removed/sysfs-class-rfkill  |    2 +-
 Documentation/ABI/stable/sysfs-class-rfkill   |   12 +-
 .../ABI/stable/sysfs-driver-dma-idxd          |    4 +-
 .../testing/sysfs-bus-coresight-devices-cti   |   78 +-
 .../testing/sysfs-bus-coresight-devices-tpdm  |   52 +-
 Documentation/ABI/testing/sysfs-fs-f2fs       |    4 +-
 Documentation/ABI/testing/sysfs-power         |    2 +-
 .../admin-guide/abi-obsolete-files.rst        |    7 +
 Documentation/admin-guide/abi-obsolete.rst    |    6 +-
 Documentation/admin-guide/abi-readme-file.rst |    6 +
 .../admin-guide/abi-removed-files.rst         |    7 +
 Documentation/admin-guide/abi-removed.rst     |    6 +-
 .../admin-guide/abi-stable-files.rst          |    7 +
 Documentation/admin-guide/abi-stable.rst      |    6 +-
 .../admin-guide/abi-testing-files.rst         |    7 +
 Documentation/admin-guide/abi-testing.rst     |    6 +-
 Documentation/admin-guide/abi.rst             |   17 +
 Documentation/sphinx/automarkup.py            |   47 +
 Documentation/sphinx/kernel_abi.py            |  162 ++-
 Documentation/sphinx/kerneldoc.py             |   14 +-
 Documentation/sphinx/kernellog.py             |   22 -
 Documentation/sphinx/kfigure.py               |   81 +-
 scripts/documentation-file-ref-check          |    2 +-
 scripts/get_abi.pl                            | 1103 -----------------
 scripts/get_abi.py                            |  214 ++++
 scripts/lib/abi/abi_parser.py                 |  628 ++++++++++
 scripts/lib/abi/abi_regex.py                  |  234 ++++
 scripts/lib/abi/helpers.py                    |   38 +
 scripts/lib/abi/system_symbols.py             |  378 ++++++
 29 files changed, 1830 insertions(+), 1322 deletions(-)
 create mode 100644 Documentation/admin-guide/abi-obsolete-files.rst
 create mode 100644 Documentation/admin-guide/abi-readme-file.rst
 create mode 100644 Documentation/admin-guide/abi-removed-files.rst
 create mode 100644 Documentation/admin-guide/abi-stable-files.rst
 create mode 100644 Documentation/admin-guide/abi-testing-files.rst
 delete mode 100644 Documentation/sphinx/kernellog.py
 delete mode 100755 scripts/get_abi.pl
 create mode 100755 scripts/get_abi.py
 create mode 100644 scripts/lib/abi/abi_parser.py
 create mode 100644 scripts/lib/abi/abi_regex.py
 create mode 100644 scripts/lib/abi/helpers.py
 create mode 100644 scripts/lib/abi/system_symbols.py
Signature · 1 line
2.48.1