title: Perf shows mangled function names
body: <p>I wanted to give perf a shot to profile some programs after I saw <a href="https://www.youtube.com/watch?v=nXaxk27zwlk&amp;feature=youtu.be&amp;list=PLHTh1InhhwT75gykhs7pqcR_uSiG601oh" rel="noreferrer">this</a> talk from CppCon 2015. I downloaded the same Google benchmark library that the guy uses in the talk, compiled my program with the appropriate switches, linked it to it, then used perf to record a run. The report option gives me this:</p>
  
  <p><a href="https://i.stack.imgur.com/KY3Yv.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KY3Yv.png" alt="enter image description here"></a></p>
  
  <p>As you can see the function names are not very readable. I assume this has to do with C++ name mangling. Interestingly, all the function names show up correctly in the video for the guy who gave the talk, but not for me. I don't think it's a case of completely missing the symbol information because I would only see memory addresses in that case. For some reason, perf can't "undo" the C++ name mangling for me, and this is frustrating to look at.</p>
  
  <p>I'm using gcc (g++) version 5.2.1, perf is version 4.2.6, and I use these switches when compiling:</p>
  
  <p><code>-I&lt;my own include path&gt; -L&lt;path to the benchmark library&gt; -O3 -std=c++14 -gdwarf-2 -fno-rtti -Wall -pedantic -lbenchmark -pthread</code></p>
  
  <p>The reason why I don't use <code>-fno-omit-frame-pointer</code> is that I use the <code>-gdwarf-2</code> option instead, which leaves debugging information in the dwarf executable, which is an alternative for leaving the frame pointer in place in this case. This also means I pass <code>--call-graph "dwarf"</code> to <code>perf record</code>. Anyway, I tried the frame pointer method as well, and it gives the same results, so this doesn't matter really.</p>
  
  <p>So why doesn't perf "undo" the C++ name mangling in this case? Does this have anything to do with using GCC, which of course means that I'm using libstdc++?</p>