148ee639b5
Since the immediate symbols can be retrieved for "objdump -t" output as well, it makes some sence to use it as the sole data source and handle both vaiants inside the awk script. This simplification comes at some runtime cost for the simpler case of the immediate symbols, though, and overall it is about 5% faster in the relative symbols case and about the same 5% slower in the absolute symbols case, with the latter not as important moving forward, probably: $ 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 3.98s user 3.04s system 129% cpu 5.411 total new: ./find-provides.ksyms.new > /dev/null 3.78s user 3.06s system 132% cpu 5.181 total ====== ./lib/modules/4.18.0-372.57.1.el8_6.x86_64 ===== old: ./find-provides.ksyms.old > /dev/null 6.18s user 4.00s system 124% cpu 8.161 total new: ./find-provides.ksyms.new > /dev/null 6.57s user 4.84s system 132% cpu 8.644 total ====== ./lib/modules/5.14.0-284.15.1.el9_2.s390x ===== old: ./find-provides.ksyms.old > /dev/null 4.70s user 2.94s system 126% cpu 6.061 total new: ./find-provides.ksyms.new > /dev/null 4.37s user 3.03s system 127% cpu 5.793 total ====== ./lib/modules/5.14.0-284.15.1.el9_2.x86_64 ===== old: ./find-provides.ksyms.old > /dev/null 6.66s user 4.35s system 123% cpu 8.884 total new: ./find-provides.ksyms.new > /dev/null 7.07s user 5.00s system 130% cpu 9.218 total ====== ./lib/modules/6.4.0-0.rc1.20230511git80e62bc8487b.19.eln126.s390x ===== old: ./find-provides.ksyms.old > /dev/null 3.81s user 2.62s system 128% cpu 5.018 total new: ./find-provides.ksyms.new > /dev/null 3.55s user 2.56s system 128% cpu 4.743 total ====== ./lib/modules/6.4.0-0.rc1.20230511git80e62bc8487b.19.eln126.x86_64 ===== old: ./find-provides.ksyms.old > /dev/null 13.79s user 8.59s system 125% cpu 17.817 total new: ./find-provides.ksyms.new > /dev/null 13.18s user 8.78s system 127% cpu 17.247 total * find-provides.ksyms: Do not perform an intial "nm | awk" run in an attempt to capture absolute symbols, just parse "objdump -t" output and handle both absolute and relative symbols in the awk script based on the section name. * find-requires.ksyms (all_provides): Likewise. Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com> |
||
---|---|---|
tests | ||
.gitignore | ||
brp-kmod-restore-perms | ||
brp-kmod-set-exec-bit | ||
find-provides.ksyms | ||
find-requires.ksyms | ||
firmware.prov | ||
kabi.attr | ||
kabi.sh | ||
kernel-srpm-macros.spec | ||
kmod.attr | ||
kmodtool | ||
macros.kernel-srpm | ||
macros.kmp | ||
modalias.attr | ||
modalias.prov | ||
provided_ksyms.attr | ||
README.md | ||
required_ksyms.attr | ||
rpmsort | ||
sources | ||
symset-table |
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 ?