summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMiguel Flores Silverio <floresmigu3l@gmail.com>2016-07-20 11:37:37 -0700
committerLaura Abbott <labbott@fedoraproject.org>2016-07-22 09:57:02 -0700
commit8571affd22d3394cede8230eaab46d35c64496ef (patch)
treee43e75b985eddcee1b68aee8336d3ceb86520ae0 /scripts
parent0078c3460afd3fa305b460fee66afa285421c493 (diff)
downloadkernel-8571affd22d3394cede8230eaab46d35c64496ef.tar.gz
kernel-8571affd22d3394cede8230eaab46d35c64496ef.tar.xz
kernel-8571affd22d3394cede8230eaab46d35c64496ef.zip
Script to generate perf man tarball.
By default the scritp uses the kernel version of the upstream tree set in LINUX_GIT. In the given case the the upstream tree and the current tree do not have the same version use the --version=x.y Signed-off-by: Miguel Flores Silverio <floresmigu3l@gmail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/generate-perf-man.sh54
1 files changed, 54 insertions, 0 deletions
diff --git a/scripts/generate-perf-man.sh b/scripts/generate-perf-man.sh
new file mode 100755
index 000000000..27691fafd
--- /dev/null
+++ b/scripts/generate-perf-man.sh
@@ -0,0 +1,54 @@
+#!/bin/sh
+# Small script to generate the perf-man tarball. The script relies on having
+# LINUX_GIT set in your local .bashrc. By default the script will use the
+# the kernel version of the upstream tree set in LINUX_GIT. Use --version=x.y
+# to set a specific version.
+
+# [Default] eg. ./scritps/generate-perf-man
+# eg. ./scripts/generate-perf-man --version=4.8
+function usage(){
+ echo
+ echo "Helps generate the perf-man tarball "
+ echo "-h, --help "
+ echo
+ echo "./generate-perf-man.sh #Generates using upstream kernel version"
+ echo
+ echo "./generate-perf-man.sh --version=x.y #Generate using x.y version"
+}
+
+if [ -f ~/.bashrc ]; then
+ source ~/.bashrc
+fi
+
+if [ ! -d "$LINUX_GIT" ]; then
+ echo "Error: \$LINUX_GIT is not set to the upstream git tree."
+ exit 1
+fi
+
+BASEDIR=$(dirname "$(cd $(dirname $BASH_SOURCE[0]) && pwd)")
+pushd "$LINUX_GIT" > /dev/null
+KERNEL_VERSION=$( awk '/^VERSION =/ {print $3}' Makefile )
+KERNEL_PATCHLEVEL=$( awk '/^PATCHLEVEL =/ {print $3}' Makefile )
+
+if [ ! -z "$@" ]; then
+ for opt in "$@"; do
+ case $opt in
+ --version=*.*)
+ version="${opt#*=}"
+ KERNEL_VERSION=$( awk -F. '{print $1}' <<< $version )
+ KERNEL_PATCHLEVEL=$( awk -F. '{print $2}' <<< $version )
+ ;;
+ -h | --help)
+ usage
+ exit 0
+ ;;
+ *)
+ ;;
+ esac
+ done
+fi
+cd tools/perf/Documentation/
+make
+tar -czvf $BASEDIR/perf-man-${KERNEL_VERSION}.${KERNEL_PATCHLEVEL}.tar.gz *.1
+make clean
+popd