0

Just installed Qt 4.8 and took a look at the analyzer stuff. Not sure what to make of this valgrind profiler and am not finding it very useful, indeed almost useless.

Specifically, two issues: 1) There doesn't seem to be any way to get back to the source line of code associated with an entry displayed in the "Function", "Callees", or "Callers" panes. Is there a hidden incantation needed to do this?

2) I'm not able to see any line profiling information, so it becomes hard to tell what lines in a function are the cause of bottlenecks.

If there are ways to achieve the above, that would be great. If not, I'd love a suggestion for an alternative. It doesn't have to be free, but it has to be useful!

I've never used Shark (comes with xcode) but a quick google search suggested that it would not work either, perhaps unable to handle the symbols....

Would appreciate any suggestions.

Chris
  • 16,401
  • 3
  • 53
  • 59
David
  • 5,718
  • 5
  • 31
  • 39
  • Which UI do you use for visualization? Try qcachegrind/kcachegrind. – Frank Osterfeld Mar 09 '12 at 06:51
  • I was just using the Qt 4.8 integrated QT Creator app. It has a section called "Analyser" which supports valgrind. What is qcachegrind? Can it do profiling at the line level and can you double-click on an entry to get back to the original source code? I used to use AQTime in the windows world, it was absolutely wonderful....I haven't found anything like that in the Mac world. – David Mar 09 '12 at 12:59
  • I assume you're aware of *[this method.](http://stackoverflow.com/questions/375913/what-can-i-use-to-profile-c-code-in-linux/378024#378024)* – Mike Dunlavey Mar 09 '12 at 13:10
  • Well, I just discovered that if I compile in debug mode, double-clicking on a line in valgrind does indeed take me to the line in the code. And beside the function name, there is an indicator of the duration of that function. Now, one might think this is obvious and why didn't I originally build in debug mode? Well, the answer is I did, and when I ran the Analyser for the first time, it warned me that Valgrind was designed to be used in release mode. So I recompiled again. Sigh! – David Mar 09 '12 at 14:16
  • @Mike Of course, but that's far too coarse for anything but some really broken stuff --- it's also way too slow a method for practical use other than emergencies. (The whole point of decent tools is to avoid doing that kind of thing in the first place) – David Mar 09 '12 at 14:18
  • @David: That's what many people think, but it's not so. *[Here is a sourceforge project](http://sourceforge.net/projects/randompausedemo/files/)*, with a short PDF slide show. It shows a typically realistic piece of software, in which less than 1% of the time spent was truly necessary. You could wishfully say "Well, it was just badly done!", but I've seen numerous cases like it. – Mike Dunlavey Mar 09 '12 at 15:05
  • Yeah, been there, done that, got the t-shirt. I've also done it with bare metal using logic analysers.....those things work but they are far more time consuming (people time) than running a decent profiler like AQTime so that you can quickly review all the various bottlenecks in context. (If that wasn't the case, nobody would bother to build such tools) – David Mar 09 '12 at 17:40
  • @David: OK, be glib :) But there's a program distilled from a real one, using all the "state of the art" programming techniques. When I stopped banging on it, it was 730 times faster. Do that with your "decent profiler". You can choose something easy to use that doesn't work very well, or a serious method that does. – Mike Dunlavey Mar 09 '12 at 21:19
  • Not being glib --- I'm quite serious. I'm perfectly aware that one can profile code the way you suggest. You can also write code in assembly language instead of a high-level language but most of the time, that's a poor choice. Tools like AQTime are extremely powerful and helpful and DO work very well. – David Mar 12 '12 at 11:04
  • So I guess there isn't actually line profiler for Qt at this time. – David Apr 19 '12 at 10:04

0 Answers0