From patchwork Wed Apr 21 13:25:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 50656 X-Patchwork-Delegate: apw@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 BADC7B6ED0 for ; Wed, 21 Apr 2010 23:26:41 +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 1O4Zwn-0003ge-Vw; Wed, 21 Apr 2010 14:26:34 +0100 Received: from mail.tpi.com ([70.99.223.143]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1O4Zwj-0003dA-2y for kernel-team@lists.ubuntu.com; Wed, 21 Apr 2010 14:26:29 +0100 Received: from [10.0.2.5] (unknown [10.0.2.5]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mail.tpi.com (Postfix) with ESMTP id BFACB22FBD0; Wed, 21 Apr 2010 06:26:10 -0700 (PDT) Message-ID: <4BCEFCE6.2070506@canonical.com> Date: Wed, 21 Apr 2010 07:25:58 -0600 From: Tim Gardner User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100415 Thunderbird/3.0.4 MIME-Version: 1.0 To: Jeremy Kerr Subject: Re: [RFC, PATCH] UBUNTU: fix perf kernel version detection for multiple-flavour strings References: <1271853779.810767.819588158504.1.gpush@pororo> In-Reply-To: <1271853779.810767.819588158504.1.gpush@pororo> Cc: kernel-team@lists.ubuntu.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 Precedence: list Reply-To: tim.gardner@canonical.com 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 On 04/21/2010 06:42 AM, Jeremy Kerr wrote: > Currently, the perf tool doesn't work for the generic-pae flavour: > > $ bash -x /usr/bin/perf > ++ uname -r > + version=2.6.32-21-generic-pae > + version=2.6.32-21-generic > + exec perf_2.6.32-21-generic > /usr/bin/perf: line 4: exec: perf_2.6.32-21-generic: not found > > - the PAE flavour has a version string ending in -generic-pae, but the > version cleaning in the perf script doesn't handle the multiple flavour > strings correctly. The perf tool is named perf_2.6.32-21, not > perf_2.6.32-21-generic. > > This change fixes the perf wrapper script to throw away version data > after a 'dash, non-digit' sequence instead of just the last dash. This > fixes the problem on the PAE kernel. We need to do a special pass for > the -386 flavour, as it's virtually indisinguishable from a normal > version number. Testing this parsing against the possible flavours > gives: > > 2.6.32-21-generic -> 2.6.32-21 > 2.6.32-21-server -> 2.6.32-21 > 2.6.32-21-preempt -> 2.6.32-21 > 2.6.32-21-versatile -> 2.6.32-21 > 2.6.32-21-generic -> 2.6.32-21 > 2.6.32-21-generic-pae -> 2.6.32-21 > 2.6.32-21-386 -> 2.6.32-21 > 2.6.32-21-ia64 -> 2.6.32-21 > 2.6.32-21-lpia -> 2.6.32-21 > 2.6.32-21-powerpc -> 2.6.32-21 > 2.6.32-21-powerpc-smp -> 2.6.32-21 > 2.6.32-21-powerpc64-smp -> 2.6.32-21 > 2.6.32-21-sparc64 -> 2.6.32-21 > 2.6.32-21-sparc64-smp -> 2.6.32-21 > > Signed-off-by: Jeremy Kerr > > --- > debian/tools/perf | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/debian/tools/perf b/debian/tools/perf > index 1a9915f..33df59d 100644 > --- a/debian/tools/perf > +++ b/debian/tools/perf > @@ -1,4 +1,5 @@ > #!/bin/bash > version=`uname -r` > -version=${version%-*} > +version=${version/-[^0-9]*} > +version=${version%-386} > exec "perf_$version" "$@" > Why not just drop everything after the second '-' inclusive ? rtg From f935a6337ea4a1b8d7061fc249cbbfa13c38f631 Mon Sep 17 00:00:00 2001 From: Tim Gardner Date: Wed, 21 Apr 2010 07:24:13 -0600 Subject: [PATCH] UBUNTU: Do a better job of stripping version information from the perf binary name Signed-off-by: Tim Gardner --- debian/tools/perf | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/debian/tools/perf b/debian/tools/perf index 1a9915f..7a3c10b 100644 --- a/debian/tools/perf +++ b/debian/tools/perf @@ -1,4 +1,3 @@ #!/bin/bash -version=`uname -r` -version=${version%-*} +version=`uname -r|sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)-\([0-9]*\)-.*$/\1\.\2\.\3-\4/'` exec "perf_$version" "$@" -- 1.7.0.4