In this blog post, we will see how to use perf (a.k.a.: perf_events) together with Flame Graphs. They are used to generate a graphical representation of what functions are being called within our software of choice. Percona Server for MySQL is used here, but it can be extended to any software you can take a resolved stack trace from.
Before moving forward, a word of caution. As with any profiling tool, DON’T run this in production systems unless you know what you are doing.
Installing Packages Needed
For simplicity, I’ll use commands for CentOS 7, but things should be the same for Debian-based distros (apt-get install linux-tools-$(uname -r) instead of the yum command is the only difference in the steps).
To install perf, simply issue:
SHELL> sudo yum install -y perf…[Read more]