summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorLee Jones <lee.jones@canonical.com>2010-06-01 18:05:15 +0100
committerLeann Ogasawara <leann.ogasawara@canonical.com>2010-08-20 15:59:35 -0700
commitdff510b01b0b9815e1025f777e5268773016a56a (patch)
treeb30e1cbba92d9a9d3683feb91d8ee852f3ef56e9 /debian
parent267a07909b7e96b31474bab7e82c8bad1b2405a2 (diff)
UBUNTU: Enable perf to be more helpful when perf_<version> does not exist.
BugLink: http://bugs.launchpad.net/bugs/570500 Signed-off-by: Lee Jones <lee.jones@canonical.com> Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Diffstat (limited to 'debian')
-rw-r--r--debian/tools/perf19
1 files changed, 14 insertions, 5 deletions
diff --git a/debian/tools/perf b/debian/tools/perf
index 79253d279450..ab35fab9f0f7 100644
--- 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" "$@"