From 349056b07cdd667823725d6a7d0b07ae194e3509 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Thu, 4 Feb 2021 16:54:47 -0500 Subject: development/perf: Autodetect kernel version. Signed-off-by: B. Watson Signed-off-by: Willy Sudiarto Raharjo --- development/perf/README | 21 +++++++++++++++--- development/perf/perf.SlackBuild | 46 +++++++++++++++++++++++++++++++++++++++- development/perf/perf.info | 2 +- 3 files changed, 64 insertions(+), 5 deletions(-) (limited to 'development') diff --git a/development/perf/README b/development/perf/README index 56771df929..1ec21e6c9e 100644 --- a/development/perf/README +++ b/development/perf/README @@ -4,7 +4,22 @@ such as instructions executed, cache-misses suffered, or branches mispredicted. They form a basis for profiling applications to trace dynamic control flow and identify hotspots. -Please note that this SBo doesn't have any sources in the DOWNLOAD -setting, as the sources are already part of a full slackware install. - Optional dependencies: audit, numactl, libunwind + +Please note that this build doesn't have any sources in the .info +file, as the sources are already part of the Slackware kernel-source +package. Your running kernel's version should match the kernel-source +version. If it doesn't: + +- If your kernel source is located in /usr/src/linux-$VERSION, you + can export KERNEL= in the script's environment. Example: + + export KERNEL=4.4.240 + +- If your kernel source is somewhere else, you can export + KERNEL=. Example: + + export KERNEL=/home/myuser/kernels/linux-4.2.240 + +Please note that the package's version number will match the version +of the kernel source, *not* necessarily what's in the perf.info file. diff --git a/development/perf/perf.SlackBuild b/development/perf/perf.SlackBuild index 1a81ae0622..ac56703e5a 100644 --- a/development/perf/perf.SlackBuild +++ b/development/perf/perf.SlackBuild @@ -22,8 +22,15 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# 20210202 bkw: Modified by SlackBuilds.org, autodetect the kernel +# version and allow the user to override it. Avoids having this build +# break every time Pat releases a new kernel in patches/. + PRGNAM=perf + +# This VERSION is actually a dummy. Use KERNEL to set the version. VERSION=${VERSION:-4.4.227} + BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -56,7 +63,44 @@ fi set -e -SRCDIR="/usr/src/linux-$VERSION/tools/perf" +die() { + echo "$0: fatal: $@" 1>&2 + cat 1>&2 <