Comment 0 for bug 555130

Revision history for this message
Ulrik Mikaelsson (rawler) wrote :

Binary package hint: linux-tools-common

linux-tools-common contains a small redirection-script (/usr/bin/perf), for dispatching to the perf-version corresponding to the running kernel.

This script uses basically ${`uname -r`%-*} to figure the running kernel version, where %-* strips the last dash-delimited component of the kernel name. This breaks for -generic-pae.

Examples of uname "-r":
2.6.32-19-generic # Works today
2.6.32-19-generic-pae # Breaks, since the TWO last components needs to be stripped.

A proposed solution could be to instead use "%%-[a-z-]*", which would remove ALL trailing letters, and dashes, up to the last digit in the string (the package-release-number).

However, since I don't know kernel-release names for other architectures, it needs to be verified first.

Suggested new perf, change only on line 3
----------------
#!/bin/bash
version=`uname -r`
version=${version%%-[a-z-]*}
exec "perf_$version" "$@"