Skip to content

redhat: update kabi tooling

Čestmír Kalina requested to merge ckalina/centos-stream-9:bz2066238 into main

Upstream status: RHEL-only

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2066238

Tested: https://people.redhat.com/~ckalina/.test.sh and manual testing

  • Adds support for symbol namespace support to the kabi tooling.
  • Adds make target to emit symbol checksums into .symversions files.
  • Adds metadata to stablelist to enable stablelist versioning, fast export location lookup and reference symtype data.
  • Adds tooling (+make target wrappers) to update stablelist checksums.
  • Adds tooling to perform basic kabi diffs between a stablelist reference and current tree.
  • Adds tooling to dump symtypes nodes affected by node stabilization.
  • Adds tooling to dump symtypes nodes responsible for node stabilization.
  • Minor changes to redhat make to facilitate the above.

The crux of updating the stablelist rests on successfully locating the export location of a symbol. The sure way to accomplish this is to compute Module.symvers, which can be time consuming. In total, 6 methods of increasing complexity have been implemented:

  • human-guided: attempt files suggested by user,
  • stablelist-cached location,
  • attempt to use cscope, if available,
  • naive regular expression looking for symbols exporting using one of the following macros: ACPI_EXPORT_SYMBOL, ACPI_EXPORT_SYMBOL_INIT, EXPORT_DATA_SYMBOL, EXPORT_DATA_SYMBOL_GPL, EXPORT_INDIRECT_CALLABLE, EXPORT_PER_CPU_SYMBOL, EXPORT_PER_CPU_SYMBOL_GPL, EXPORT_STATIC_CALL, EXPORT_STATIC_CALL_GPL, EXPORT_STATIC_CALL_TRAMP, EXPORT_STATIC_CALL_TRAMP_GPL, EXPORT_SYMBOL, EXPORT_SYMBOL_FOR_TESTS_ONLY, EXPORT_SYMBOL_GPL, EXPORT_SYMBOL_NS, EXPORT_SYMBOL_NS_GPL, EXPORT_TRACEPOINT_SYMBOL and EXPORT_TRACEPOINT_SYMBOL_GPL; this method will fail if symbol name is composed using preprocessor directives,
  • computation of all symtypes and symversions files for any .c and .S files found in a dry run of a kernel build; this may fail when expecting a generated header file,
  • compiling the kernel and using Module.symvers as a fallback option.

They are called in order and early return if successful. In practice the code should always early return after the 2nd method, the rest is implemented for correctness. The tooling to update/diff kabi is implemented as callbacks to this shared code.

The image/preimage of a symtype entry ignores built in types as a micro-optimization, as these should be irrelevant to the intended use.

Signed-off-by: Čestmír Kalina ckalina@redhat.com

Edited by Čestmír Kalina

Merge request reports