install-perf.sh 531 B

1234567891011121314151617
  1. #!/usr/bin/env bash
  2. #
  3. # perf setup
  4. #
  5. set -ex
  6. [[ $(uname) = Linux ]] || exit 1
  7. [[ $USER = root ]] || exit 1
  8. # install perf
  9. apt-get --assume-yes install linux-tools-common linux-tools-generic "linux-tools-$(uname -r)"
  10. # setup permissions
  11. # Impose no scope and access restrictions on using perf_events performance monitoring
  12. echo -1 | tee /proc/sys/kernel/perf_event_paranoid
  13. # Allow recording kernel reference relocation symbol to avoid skewing symbol resolution if relocation was used
  14. echo 0 | tee /proc/sys/kernel/kptr_restrict