Skip to content

Instantly share code, notes, and snippets.

@blukat29
Last active June 19, 2017 10:11
Show Gist options
  • Save blukat29/aed9cf8e7d260294576a5e690137d8cb to your computer and use it in GitHub Desktop.
Save blukat29/aed9cf8e7d260294576a5e690137d8cb to your computer and use it in GitHub Desktop.
#!/bin/sh
# IMPORTANT!
# Dont work in Linux 4.8.0
# Works in Linux 4.4.0
# http://halobates.de/blog/p/410
sudo sh -c "echo 'kernel.kptr_restrict=0' >> /etc/sysctl.conf"
# https://superuser.com/questions/980632/run-perf-without-root-rights
sudo sh -c "echo 'kernel.perf_event_paranoid=1' >> /etc/sysctl.conf"
sudo sysctl -p
sudo apt-get install -y cmake yasm
mkdir -p pt
cd pt
git clone https://github.com/01org/processor-trace
cd processor-trace
mkdir build
cd build
cmake -DPTDUMP=ON -DPTTC=ON -DFEATURE_ELF=ON -DFEATURE_THREADS=ON ..
make
sudo cp bin/ptdump /usr/local/bin/
# Test
sudo apt install linux-tools-common linux-tools-generic linux-tools-`uname -r`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment