From patchwork Tue Jun 1 17:05:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 54267 X-Patchwork-Delegate: leann.ogasawara@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 0F01CB6ED0 for ; Wed, 2 Jun 2010 03:05:24 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1OJUtw-0006Qw-HP; Tue, 01 Jun 2010 18:05:16 +0100 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1OJUtu-0006Pr-1o for kernel-team@lists.ubuntu.com; Tue, 01 Jun 2010 18:05:14 +0100 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1OJUtq-0005FF-9b; Tue, 01 Jun 2010 18:05:11 +0100 Received: from cpc2-aztw21-0-0-cust264.aztw.cable.virginmedia.com ([77.100.97.9] helo=[192.168.0.130]) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1OJUtq-0005VF-7O; Tue, 01 Jun 2010 18:05:10 +0100 Message-ID: <4C053DCB.3020805@canonical.com> Date: Tue, 01 Jun 2010 18:05:15 +0100 From: Lee Jones User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4 MIME-Version: 1.0 To: Leann Ogasawara Subject: [Maverick][PATCH] UBUNTU: Enable perf to be more helpful when perf_ does not exist. X-Enigmail-Version: 1.0.1 Cc: kernel-team X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com commit 8a2775c937d9349e8c7ccb915a3d2b134c13f09b Author: Lee Jones Date: Tue May 25 11:49:32 2010 +0100 UBUNTU: Enable perf to be more helpful when perf_ does not exist. BugLink: http://bugs.launchpad.net/bugs/570500 Signed-off-by: Lee Jones 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" "$@"