[patch] Preload popup menus for the desktop (3.5)

Josef Weidendorfer Josef.Weidendorfer at gmx.de
Tue Apr 4 22:02:01 BST 2006


On Tuesday 04 April 2006 22:29, Scott Wheeler wrote:
> On Tuesday 04 April 2006 22:12, Josef Weidendorfer wrote:
> > Just curious: Why don't you use callgrind or oprofile (with callgraph
> > option) or perhaps even sysprof (the Redhat tool) for this?
> 
> I expected it to be IO bound when I started on it and as such callgrind output 
> isn't really useful.

Yes. However...

You could check out "--collect-systime=yes". With this, the time in milliseconds
is measured for system calls. Additional to "Ir", which is executed instructions,
you get "sysCount" (number of system calls executed) and "sysTime" (time in
system calls).
To get one single cost, you could add a (so called "derived") cost type
"NanoSecs = Ir + 1000000 sysTime" for a 1GHz processor, assuming one instruction
using one nano second on average and without any cache misses.
[In the "Types" Pane of KCachegrind, choose "New Cost Type...", then edit the
formula cell.]

Note that this still does not give the real wallclock; especially, you will not
see any time spent on pagefaults in the kernel. It will get a little better if
you switch on the cache simulator.

Hmmm... I just tried this on "ls", and I got "36 msecs" total spent in 196 syscalls
 - so probably I should change the resolution to microseconds instead...
All the sys time there was spent mmap ;-)

> I presume oprofile works better for that, but I don't  
> feel like messing with the kernel modules.

Hmm... OProfile is part of the standard linux kernel - it should work
out of the box with every distro; but you have to start/stop the measurement
as root.

> (And I've never touched sysprof.) 

sysprof is a GTK app around a very stripped down version of the oprofile
kernel module for system wide time sampling only.

Josef

> When I did try thing under callgrind a couple hours ago the results weren't 
> useful at all.  (I don't mean this as a general criticism of the tool;

No problem - as you see, I sometimes even suggest a gtk tool if I think it
could fit better for a problem ;-)

> I use  
> it quite often, but in this case I find wall-clock times to be more 
> interesting and important.)
> 
> -Scott
> 




More information about the kde-core-devel mailing list