Bug 2171875 - find-{requires,provides}.ksyms: Eliminate unnecessary command calls in ksym/kernel check
Summary: find-{requires,provides}.ksyms: Eliminate unnecessary command calls in ksym/k...
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel-srpm-macros
Version: 42
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Eugene Syromiatnikov
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2172514 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-02-20 17:03 UTC by Eugene Syromiatnikov
Modified: 2025-06-30 02:11 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Eugene Syromiatnikov 2023-02-20 17:03:25 UTC
It is quite expensive to call grep, evenmoreso in a pipe, just to check the filename.

Comment 1 Denys Vlasenko 2023-03-15 15:19:31 UTC
find-provides.ksyms is invoked ~8000 times during rpmbuild of a kernel. This takes >10 minutes. It's beneficial to speed it up

This construct is slow (probably entails 2-3 forks, and one exec):

    dep_pfx="ksym"
    printf "%s" "$module" | grep -v "^${RPM_BUILD_ROOT}/\?lib/modules/[1-9][^/]*/kernel" > /dev/null \
        || dep_pfx="kernel"

What is seems to do is to set dep_pfx for "kernel" if path is /lib/modules/Nxxxxxx/kernel/yyyyyy. (well... what is that "\?" for?... anyway).

This can be achieved with shell string manipulations:

a=${module#${RPM_BUILD_ROOT}lib/modules/[0-9]*/kernel/}
a=${a#${RPM_BUILD_ROOT}/lib/modules/[0-9]*/kernel/}

If $a is not equal to $module, then the path was ${RPM_BUILD_ROOT}/lib/modules/Nxxxxxx/kernel/yyyyyy (or ${RPM_BUILD_ROOT}lib/modules/Nxxxxxx/kernel/yyyyyy, that is, there was a slash at the end of ${RPM_BUILD_ROOT} expansion)

Comment 2 Denys Vlasenko 2023-03-15 15:20:00 UTC
*** Bug 2172514 has been marked as a duplicate of this bug. ***

Comment 3 Fedora Release Engineering 2023-08-16 07:10:00 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.

Comment 4 Aoife Moloney 2024-11-08 10:47:58 UTC
This message is a reminder that Fedora Linux 39 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 39 on 2024-11-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '39'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 39 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 5 Aoife Moloney 2025-02-26 12:53:16 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.


Note You need to log in before you can comment on or make changes to this bug.