VerySleepy / verysleepy

Very Sleepy, a sampling CPU profiler for Windows
http://www.codersnotes.com/sleepy
GNU General Public License v2.0
1.05k stars 103 forks source link

profiling executable compiled with gcc's -flto is messed up #13

Closed ellisonch closed 9 years ago

ellisonch commented 9 years ago

It seems that when trying to profile programs that have been compiled with -flto (link time optimization), the resulting profile is all messed up. I'm getting a bunch of duplicated Names, where clicking on them usually goes to the wrong functions. Sometimes it goes to the right one and the per-line timings seem to add up correctly.

I need to compile with flto because otherwise gcc won't inline some cross-file functions that need to be inlined. I'm not sure if the fault is with gcc not outputting the correct data, or with sleepy not being able to handle what it gets.

I'm running Very Sleepy CS 0.90 and gcc 4.9.2.

ellisonch commented 9 years ago

So I found that gcc's manpage says this: "Link-time optimization does not work well with generation of debugging information. Combining -flto with -g is currently experimental and expected to produce unexpected results." I'll assume it's their fault :)