BlogWhere Profiling Sucks Syndicate content

Mon, 04/05/2010 - 03:12

Ok, you should know by now that I love profiling and making things faster. Yet there’s always a “but”. For me it’s blocking syscalls, or anything that makes the app “slow” for the user but doesn’t show up in Callgrind as the Instruction Fetch cost doesn’t go up.

The usual suspect is of course locks (which we have quite a lot in KDevelop) or QProcesses with waitForFinished() or similar… You won’t see them in any Callgrind profile. Does anyone know a way to achieve that? Something that makes Callgrind increase the Ir cost for blocking func calls depending on the time it blocks? Or some other tool that would show me these?

And if you are interested: I was still able to find the cause for slow parsing of Custom Make Manager projects (Qt, Linux Kernel, …) in KDevelop: The cache in the IncludePathResolver never hit, since a operator== was improperly implemented ;-) I really wonder how we could have missed that for so long! I’ve also added some more changes that should make it much faster to parse projects that rely on the IncludePathResolver. I was personally now able to parse 10.000 files of the Linux Kernel in about 9.5 minutes. This is roughly a third of the Kernel, so I’d get to a total of approx 30min. Compare that to the 2.5h for 5% that one of our users reported ;-)


Try Systemtap Thu, 04/08/2010 - 05:47 — Anonymous (not verified)

Compuware Devpartner - it Wed, 04/07/2010 - 22:16 — Anonymous (not verified)

Compuware Devpartner - it instruments code at compile time, and is thus able to measure time taken to execute a function, which is sufficient to diagnoze IO bottlenecks. Only for Windows though.

At least oprofile is not Tue, 04/06/2010 - 23:42 — Christoph Bartoschek (not verified)

At least oprofile is not capable of profiling the waiting time of a program. I doubt that there is a single profiler that is able to profile the waiting time.

Try Tau [1], it’s probably Tue, 04/06/2010 - 07:40 — stativ (not verified)

Try Tau [1], it’s probably one of the best free profillers out there. But it’s a pain to make it work (I put it in work once but then I bougth a new computer and I haven’t got back to it). The nice thing is that it supports several levels of instruction (source code, external library (that one works similarly to callgring I think)…). Some are faster, some are more precise, some are “easy” to use. And it’s quite robust.


You could try sysprof, it Mon, 04/05/2010 - 20:42 — Benjamin Otte (not verified)

You could try sysprof, it shows traces into the kernel.

Use OProfile, or it’s Mon, 04/05/2010 - 20:32 — Justin Noel (not verified)

Use OProfile, or it’s commercial cousin Zoom by RotateRight. OProfile uses hardware ticks or kernel timers to do profiling so it requires only loading a kernel module rather than running an emulator like Valgrind. OProfile will also give you a profile of a system at large so you can keep an eye on what the XServer is doing while you client app is running. Pretty cool. I used to use Zoom because it would get me call-graphs, but there may be a conversion util now available to convert OProfile to Callgrind Format. That would allow you to keep using KCacheGrind.

Post new comment

  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <pre>.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options