xref: /openbmc/linux/scripts/pahole-version.sh (revision 613fe169)
1*613fe169SNathan Chancellor#!/bin/sh
2*613fe169SNathan Chancellor# SPDX-License-Identifier: GPL-2.0
3*613fe169SNathan Chancellor#
4*613fe169SNathan Chancellor# Usage: $ ./pahole-version.sh pahole
5*613fe169SNathan Chancellor#
6*613fe169SNathan Chancellor# Prints pahole's version in a 3-digit form, such as 119 for v1.19.
7*613fe169SNathan Chancellor
8*613fe169SNathan Chancellorif [ ! -x "$(command -v "$@")" ]; then
9*613fe169SNathan Chancellor	echo 0
10*613fe169SNathan Chancellor	exit 1
11*613fe169SNathan Chancellorfi
12*613fe169SNathan Chancellor
13*613fe169SNathan Chancellor"$@" --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/'
14