home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / bin / perf < prev    next >
Encoding:
Text File  |  2011-11-14  |  603 b   |  29 lines

  1. #!/bin/bash
  2.  
  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
  8. version="$(uname -r)"
  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
  23. shopt -s execfail
  24. exec "perf_$version" "$@"
  25.  
  26. # Not found? Tell the user which package to install.
  27. echo >&2 "E: linux-tools-$version is not installed."
  28. exit 1
  29.