perf enable demangling of callgraph

I had the same problem on the Ubuntu 15.10 and I found the solution here: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1396654

Update: works also for Ubuntu 18.10

Here are the steps:

sudo apt-get install libiberty-dev binutils-dev
mkdir ~/install
cd ~/install
# If the following apt-get doesn't work on your system,
# uncomment deb-src lines in your /etc/apt/sources.list,
# as suggested by @ctitze
# or you can download it manually from packages.ubuntu.com
# as @aleixrocks suggested in the comment below
apt-get source linux-tools-`uname -r`
sudo apt-get build-dep linux-tools-`uname -r`
cd linux-`uname -r | sed 's/-.*//'`/tools/perf
make

# now you should see the new "perf" executable here
./perf

There should be also some way to create a new linux-tools-common package to really integrate it into your system. For now to override the official perf with your new one, just set your PATH:

export PATH=~/install/linux-`uname -r | sed 's/-.*//'`/tools/perf:$PATH

If you don't understand what to download from packages.ubuntu.com (as in the first answer), then you also can download linux kernel sources from git:

sudo apt-get install libiberty-dev binutils-dev
mkdir ~/install
cd ~/install
git clone https://github.com/torvalds/linux --depth 1
cd linux/tools/perf
make

# now you should see the new "perf" executable here
./perf

And modify path (as in the first answer):

export PATH=~/install/linux/tools/perf:$PATH