RPM macros that list arches the full kernel is built on
Go to file
Eugene Syromiatnikov a9123f8dde find-provides.ksyms, find-requires.ksyms: avoid iterating over sections
Since the section retrieval code is implemented inside the awk script
now, the next step is to eliminate external iteration over the section
list and just retrieve the required sections inside awk on demand.  This
allows calling (and processing the output of) objdump -t just once,
which saves around 8-12% of time on kernels that store modversions
as non-absolute symbols:

    $ for i in ./lib/modules/*; do \
        echo "====== $i ====="; \
        diff -u <(find $i | ./find-provides.ksyms.old) <(find $i | ./find-provides.ksyms.new); \
        echo -n "old: "; find $i | time ./find-provides.ksyms.old > /dev/null; \
        echo -n "new: "; find $i | time ./find-provides.ksyms.new > /dev/null; \
    done
    ====== ./lib/modules/4.18.0-372.57.1.el8_6.s390x =====
    old: ../find-provides.ksyms.old > /dev/null  4.41s user 3.46s system 136% cpu 5.756 total
    new: ../find-provides.ksyms.new > /dev/null  3.90s user 2.94s system 129% cpu 5.279 total
    ====== ./lib/modules/4.18.0-372.57.1.el8_6.x86_64 =====
    old: ../find-provides.ksyms.old > /dev/null  6.04s user 3.88s system 124% cpu 7.993 total
    new: ../find-provides.ksyms.new > /dev/null  6.08s user 3.91s system 124% cpu 8.012 total
    ====== ./lib/modules/5.14.0-284.15.1.el9_2.s390x =====
    old: ../find-provides.ksyms.old > /dev/null  5.09s user 3.51s system 133% cpu 6.452 total
    new: ../find-provides.ksyms.new > /dev/null  4.65s user 2.89s system 126% cpu 5.949 total
    ====== ./lib/modules/5.14.0-284.15.1.el9_2.x86_64 =====
    old: ../find-provides.ksyms.old > /dev/null  6.52s user 4.14s system 123% cpu 8.638 total
    new: ../find-provides.ksyms.new > /dev/null  6.64s user 4.12s system 123% cpu 8.690 total
    ====== ./lib/modules/6.4.0-0.rc1.20230511git80e62bc8487b.19.eln126.s390x =====
    old: ../find-provides.ksyms.old > /dev/null  4.45s user 3.29s system 136% cpu 5.661 total
    new: ../find-provides.ksyms.new > /dev/null  3.84s user 2.54s system 127% cpu 4.980 total
    ====== ./lib/modules/6.4.0-0.rc1.20230511git80e62bc8487b.19.eln126.x86_64 =====
    old: ../find-provides.ksyms.old > /dev/null  7.34s user 4.33s system 129% cpu 9.019 total
    new: ../find-provides.ksyms.new > /dev/null  6.67s user 3.51s system 122% cpu 8.278 total

* find-provides.ksyms: Remove "objdump -t" section loop, do not supply
sectname to the awk script, treat sectdata as an array keyed on section
name, convert section retrieval to a function with a section name
as an argument, call it if a section name is not present in sectdata.
* find-requires.ksyms (all_provides): Likewise.

Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
2023-06-07 02:13:40 +02:00
tests tests: adjust internal patch to apply cleanly 2023-05-08 11:28:24 +02:00
.gitignore Initial build 2020-07-21 14:06:48 -07:00
brp-kmod-restore-perms Add zstd kmod compression support 2021-11-18 16:44:20 +01:00
brp-kmod-set-exec-bit Enable extraction of debug information for kmods 2021-11-18 16:38:10 +01:00
find-provides.ksyms find-provides.ksyms, find-requires.ksyms: avoid iterating over sections 2023-06-07 02:13:40 +02:00
find-requires.ksyms find-provides.ksyms, find-requires.ksyms: avoid iterating over sections 2023-06-07 02:13:40 +02:00
firmware.prov Add zstd kmod compression support 2021-11-18 16:44:20 +01:00
kabi.attr kabi: handle symvers.xz 2023-05-16 09:27:51 +02:00
kabi.sh kabi: handle symvers.xz 2023-05-16 09:27:51 +02:00
kernel-srpm-macros.spec find-provides.ksyms, find-requires.ksyms: avoid awaking debuginfod 2023-04-25 12:40:16 +02:00
kmod.attr kmod.attr: cosmetic fixes: %{1} to %1, indentation fix 2023-05-04 12:55:15 +02:00
kmodtool Add zstd kmod compression support 2021-11-18 16:44:20 +01:00
macros.kernel-srpm Initial build 2020-07-21 14:06:48 -07:00
macros.kmp macros.kmp: remove kernel-abi-stablelists from the dependency list 2021-11-18 17:55:06 +01:00
modalias.attr Add zstd kmod compression support 2021-11-18 16:44:20 +01:00
modalias.prov modalias.prov: rename "class" and "tag" variables to "prev" and "next" 2023-05-08 11:12:45 +02:00
provided_ksyms.attr Add zstd kmod compression support 2021-11-18 16:44:20 +01:00
README.md README.md: update docs, add some questions 2023-05-12 15:48:56 +02:00
required_ksyms.attr Add zstd kmod compression support 2021-11-18 16:44:20 +01:00
rpmsort rpmsort: update the FSF address 2021-11-18 16:44:20 +01:00
sources Initial build 2020-07-21 14:06:48 -07:00
symset-table Adopt kernel-rpm-macros subpackage from redhat-rpm-config 2021-06-03 17:21:53 +02:00

kernel-srpm-macros

The kernel-srpm-macros package

This source package results in two "binary" packages, kernel-rpm-macros and kernel-srpm-macros. The role and locations of files is as follows:

kernel-srpm-macros:

/usr/lib/rpm/fileattrs/kmod.attr For /lib/modules/XYZ/modules.builtin and .../MODULE.ko.XYZ specifies a Lua script to generate kmod(MODULE.ko) "Provides:" deps /usr/lib/rpm/macros.d/macros.kernel-srpm Automatically included by all rpm invocations. Defines %kernel_arches (try rpm --eval '%kernel_arches') Question: what uses this macro? I didn't find any users.

kernel-rpm-macros:

/usr/lib/rpm/redhat/find-provides.ksyms Runs from rpmbuild at the end of kernel builds and 3rd party module builds, to extract kernel(SYMBOL)=0xHASH "Provides:" deps from modules in kernel packages, and ksym(SYMBOL)=0xHASH for 3rd party modules. Takes input list of files on stdin. /usr/lib/rpm/fileattrs/provided_ksyms.attr For newer rpmbuild with "internal dependency generators", this file specifies that find-provides.ksyms should be run only on .ko.XYZ files (with "external dependency generators", the script needs to filter out the files by itself).

/usr/lib/rpm/redhat/find-requires.ksyms ? /usr/lib/rpm/fileattrs/required_ksyms.attr For newer rpmbuild with "internal dependency generators", this file specifies that find-requires.ksyms should be run only on .ko.XYZ files, and not for /lib/modules/XYZ/kernel/* (IOW: only for building 3rd-party modules)

/usr/lib/rpm/redhat/find-provides.d/modalias.prov Runs from rpmbuild at the end of kernel builds and 3rd party module builds, to extract modalias(pci:SOMETHING)=OPTIONALLY_VERSION "Provides:" deps from modules in kernel and 3rd party modules packages. Takes input list of files on stdin. Question: what uses these deps? /usr/lib/rpm/fileattrs/modalias.attr For newer rpmbuild with "internal dependency generators", this file specifies that modalias.prov should be run only on .ko.XYZ files

/usr/lib/rpm/redhat/find-provides.d/firmware.prov ?

/usr/lib/rpm/kabi.sh Runs from rpmbuild at the end of kernel build to extract kernel(SYMBOL)=0xHASH "Provides:" deps. /usr/lib/rpm/fileattrs/kabi.attr For newer rpmbuild with "internal dependency generators", this file specifies that kabi.sh should be run on /boot/symvers-* and /lib/modules/XYZ/symvers.gz

/usr/lib/rpm/macros.d/macros.kmp Automatically included by all rpm invocations. Defines a number of macros.

/usr/lib/rpm/redhat/brp-kmod-restore-perms ? /usr/lib/rpm/redhat/brp-kmod-set-exec-bit ?

/usr/lib/rpm/redhat/kmodtool ? /usr/lib/rpm/redhat/rpmsort ? /usr/lib/rpm/redhat/symset-table ?