~ubuntu-branches/ubuntu/quantal/linux-base/quantal

« back to all changes in this revision

Viewing changes to bin/perf

  • Committer: Package Import Robot
  • Author(s): Ben Hutchings
  • Date: 2011-11-14 05:42:35 UTC
  • Revision ID: package-import@ubuntu.com-20111114054235-699ztpw2hoi64465
Tags: 3.4
perf: Fix lookup of the real command and package names for official
packages of Linux 3.1 onward and for custom kernels with stable
updates

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/bash
2
2
 
3
3
# Execute the right version of perf for the current kernel.
 
4
# Remove flavour or custom suffix and fix number of version components:
 
5
# - For 2.6.x, use 3 components
 
6
# - For 3.0 or 3.0.x, use 3.0.0
 
7
# - Otherwise, use 2 components
4
8
version="$(uname -r)"
5
9
version="${version%%-*}"
 
10
case "$version" in
 
11
    2.6.*.*)
 
12
        version="${version%.*}"
 
13
        ;;
 
14
    2.6.*)
 
15
        ;;
 
16
    3.0 | 3.0.*)
 
17
        version=3.0.0
 
18
        ;;
 
19
    *.*.*)
 
20
        version="${version%.*}"
 
21
        ;;
 
22
esac
6
23
shopt -s execfail
7
24
exec "perf_$version" "$@"
8
25