FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 05-25-2010, 01:34 PM
Lee Jones
 
Default UBUNTU: Enable perf to be more helpful when perf_ does not exist.

All,

I received this bug yesterday where a user has run 'perf' and received an error similar to "command not found", without any clue as to what exactly has failed. The user submitted a patch which he thought might be helpful to ensure perf behaves a little better and is a little more forthcoming in the future. I have cleaned it up and changed a few bits and pieces. Here is the result:

http://bugs.launchpad.net/bugs/570500

Signed-off-by: Lee Jones <lee.jones@canonical.com>
---
debian/tools/perf | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/debian/tools/perf b/debian/tools/perf
index 79253d2..ab35fab 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" "$@"

Kind regards,
Lee (lag) <- awaits flogging





--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 05-26-2010, 04:51 PM
Tim Gardner
 
Default UBUNTU: Enable perf to be more helpful when perf_ does not exist.

On 05/25/2010 07:34 AM, Lee Jones wrote:
> All,
>
> I received this bug yesterday where a user has run 'perf' and received an error similar to "command not found", without any clue as to what exactly has failed. The user submitted a patch which he thought might be helpful to ensure perf behaves a little better and is a little more forthcoming in the future. I have cleaned it up and changed a few bits and pieces. Here is the result:
>
> http://bugs.launchpad.net/bugs/570500
>
> Signed-off-by: Lee Jones<lee.jones@canonical.com>
> ---
> debian/tools/perf | 19 ++++++++++++++-----
> 1 files changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/debian/tools/perf b/debian/tools/perf
> index 79253d2..ab35fab 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" "$@"
>
> Kind regards,
> Lee (lag)<- awaits flogging
>
>
>
>

I think your patch is space/tab munged. Its probably best if you push to
your public git repository and email a pull request.

rtg
--
Tim Gardner tim.gardner@canonical.com

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 05-27-2010, 10:24 AM
Lee Jones
 
Default UBUNTU: Enable perf to be more helpful when perf_ does not exist.

Hi Tim,

Is this what you need?

author Lee Jones <lee.jones@canonical.com>
Tue, 25 May 2010 10:49:32 +0000 (11:49 +0100)
committer Lee Jones <lee.jones@canonical.com>
Tue, 25 May 2010 10:49:32 +0000 (11:49 +0100)
commit 8a2775c937d9349e8c7ccb915a3d2b134c13f09b

Kind regards,
Lee

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 05-27-2010, 01:27 PM
Tim Gardner
 
Default UBUNTU: Enable perf to be more helpful when perf_ does not exist.

On 05/27/2010 04:24 AM, Lee Jones wrote:
> Hi Tim,
>
> Is this what you need?
>
> author Lee Jones<lee.jones@canonical.com>
> Tue, 25 May 2010 10:49:32 +0000 (11:49 +0100)
> committer Lee Jones<lee.jones@canonical.com>
> Tue, 25 May 2010 10:49:32 +0000 (11:49 +0100)
> commit 8a2775c937d9349e8c7ccb915a3d2b134c13f09b
>
> Kind regards,
> Lee
>

This section describes the syntax of a pull request:

https://wiki.ubuntu.com/KernelTeam/KernelSimpleGuide?highlight=(request-pull)

rtg
--
Tim Gardner tim.gardner@canonical.com

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 05-27-2010, 03:05 PM
Lee Jones
 
Default UBUNTU: Enable perf to be more helpful when perf_ does not exist.

Hi Tim,

Is this the kind of thing you're after?

The following changes since commit f0819aaf4948e34a44d9d685615ddee74271cd70:
Chase Douglas (1):
UBUNTU: enforce CONFIG_TMPFS_POSIX_ACL=y

are available in the git repository at:

git://kernel.ubuntu.com/lag/ubuntu-lucid.git lp570500

Lee Jones (1):
UBUNTU: Enable perf to be more helpful when perf_<version> does
not exist.

debian/tools/perf | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)

Kind regards,
Lee


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 05-27-2010, 04:13 PM
Tim Gardner
 
Default UBUNTU: Enable perf to be more helpful when perf_ does not exist.

On 05/27/2010 09:05 AM, Lee Jones wrote:
> Hi Tim,
>
> Is this the kind of thing you're after?
>
> The following changes since commit f0819aaf4948e34a44d9d685615ddee74271cd70:
> Chase Douglas (1):
> UBUNTU: enforce CONFIG_TMPFS_POSIX_ACL=y
>
> are available in the git repository at:
>
> git://kernel.ubuntu.com/lag/ubuntu-lucid.git lp570500
>
> Lee Jones (1):
> UBUNTU: Enable perf to be more helpful when perf_<version> does
> not exist.
>
> debian/tools/perf | 19 ++++++++++++++-----
> 1 files changed, 14 insertions(+), 5 deletions(-)
>
> Kind regards,
> Lee
>
>

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.

----------------
#!/bin/bash
full_version=`uname -r`

# 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" "$@"
----------------

I find the variable naming a bit confusing.
'version=${full_version%-$flavour}' doesn't do what it purports, though
it does work. Perhaps some clarification?

rtg
--
Tim Gardner tim.gardner@canonical.com

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 06-01-2010, 10:44 AM
Lee Jones
 
Default UBUNTU: Enable perf to be more helpful when perf_ does not exist.

On 27/05/10 17:13, Tim Gardner wrote:
> On 05/27/2010 09:05 AM, Lee Jones wrote:
>> Hi Tim,
>>
>> Is this the kind of thing you're after?
>>
>> The following changes since commit
>> f0819aaf4948e34a44d9d685615ddee74271cd70:
>> Chase Douglas (1):
>> UBUNTU: enforce CONFIG_TMPFS_POSIX_ACL=y
>>
>> are available in the git repository at:
>>
>> git://kernel.ubuntu.com/lag/ubuntu-lucid.git lp570500
>>
>> Lee Jones (1):
>> UBUNTU: Enable perf to be more helpful when perf_<version> does
>> not exist.
>>
>> debian/tools/perf | 19 ++++++++++++++-----
>> 1 files changed, 14 insertions(+), 5 deletions(-)
>>
>> Kind regards,
>> Lee
>>
>>
>
> 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.
>
> ----------------
> #!/bin/bash
> full_version=`uname -r`
>
> # 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" "$@"
> ----------------
>
> I find the variable naming a bit confusing.
> 'version=${full_version%-$flavour}' doesn't do what it purports,
> though it does work. Perhaps some clarification?
>

That line removes the '-' and the flavour (e.g. 'server' or 'generic') from the full version, so from 2.6.32-22-server we get '2.6.32-22' in this instance.

Kind regards,
Lee



--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 06-01-2010, 10:47 AM
Lee Jones
 
Default UBUNTU: Enable perf to be more helpful when perf_ does not exist.

> 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@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@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

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 06-01-2010, 01:43 PM
Stefan Bader
 
Default UBUNTU: Enable perf to be more helpful when perf_ does not exist.

On 06/01/2010 12:47 PM, Lee Jones wrote:
>
>> 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@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@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}

I think those are the merits of that oh so understandable and clear shell
syntax. Clearly ${...#word} removes the shortest prefix while ${...##word}
removes the longest match. :-)
But the comments help imo.

-Stefan

> +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
>


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 06-01-2010, 03:41 PM
Lee Jones
 
Default UBUNTU: Enable perf to be more helpful when perf_ does not exist.

On 01/06/10 14:43, Stefan Bader wrote:
> On 06/01/2010 12:47 PM, Lee Jones wrote:
>
>>
>>> 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@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@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}
>>
> I think those are the merits of that oh so understandable and clear shell
> syntax. Clearly ${...#word} removes the shortest prefix while ${...##word}
> removes the longest match. :-)
> But the comments help imo.
>
> -Stefan
>
>
>> +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
>>
>>

Yes, it's not the most intuitive language.

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 

Thread Tools




All times are GMT. The time now is 06:59 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org