mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2025-08-16 06:33:46 +00:00

There are a few different places where pahole's version is turned into a
three digit form with the exact same command. Move this command into
scripts/pahole-version.sh to reduce the amount of duplication across the
tree.
Create CONFIG_PAHOLE_VERSION so the version code can be used in Kconfig
to enable and disable configuration options based on the pahole version,
which is already done in a couple of places.
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220201205624.652313-3-nathan@kernel.org
(cherry picked from bpf-next commit 613fe16923
)
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
14 lines
269 B
Bash
Executable File
14 lines
269 B
Bash
Executable File
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Usage: $ ./pahole-version.sh pahole
|
|
#
|
|
# Prints pahole's version in a 3-digit form, such as 119 for v1.19.
|
|
|
|
if [ ! -x "$(command -v "$@")" ]; then
|
|
echo 0
|
|
exit 1
|
|
fi
|
|
|
|
"$@" --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/'
|