[PATCH] UBUNTU: Enable perf to be more helpful when perf_<version> does not exist.
Lee Jones
lee.jones at canonical.com
Tue Jun 1 10:47:20 UTC 2010
> The pull request is correct. For most patches (except the truly
> gargantuan ones) I attach or inline so that patchwork detects it as a
> patch which makes the release maintainers job easier.
commit 8a2775c937d9349e8c7ccb915a3d2b134c13f09b
Author: Lee Jones <lee.jones at canonical.com>
Date: Tue May 25 11:49:32 2010 +0100
UBUNTU: Enable perf to be more helpful when perf_<version> does not
exist.
http://bugs.launchpad.net/bugs/570500
Signed-off-by: Lee Jones <lee.jones at canonical.com>
diff --git a/debian/tools/perf b/debian/tools/perf
index 79253d2..ab35fab 100644 (file)
--- a/debian/tools/perf
+++ b/debian/tools/perf
@@ -1,7 +1,16 @@
#!/bin/bash
-version=`uname -r`
-flavour=${version#*-}
-flavour=${flavour#*-}
-version=${version%-$flavour}
+full_version=`uname -r`
-exec "perf_$version" "$@"
+# Removing flavour from version i.e. generic or server.
+flavour_abi=${full_version#*-}
+flavour=${flavour_abi#*-}
+version=${full_version%-$flavour}
+perf="perf_$version"
+
+if ! which "$perf" > /dev/null; then
+ echo "$perf not found" >&2
+ echo "You may need to install linux-tools-$version" >&2
+ exit 2
+fi
+
+exec "$perf" "$@"
Hopefully this is better.
Kind regards,
Lee
More information about the kernel-team
mailing list