[hatari-devel] Major changes in DSP code

Eero Tamminen oak at helsinkinet.fi
Tue Dec 21 23:31:31 CET 2010


Hi,

On tiistai 21 joulukuu 2010, Thomas Huth wrote:
> One possibility for profiling is compiling with the "-pg" option and
> then to use gprof. I think Eero did a lot of profiling in the past, so
> I think he could advise the best possibilities for profiling...

gprof isn't IMHO that good.  It only covers stuff you've instrumented
(not e.g. SDL) and instrumentation skews the results (especially for small
often called functions) and there's no nice GUI for it.


I've myself used valgrind+callgrind and viewed the results in KCachegrind:
	http://kcachegrind.sourceforge.net/html/Home.html

It gives very good results, only downside of Valgrind is that its CPU
emulation slows down the program execution a lot (while allowing Valgrind to
catch everything without any need to instrument anything).

Valgrind of course offers a lot of other debugging facilities:
- allocation tracker (massif)
- couple of memory access checkers (memcheck & DHAT)
- couple of thread data race checkers (hellgrind & DRD)
- CPU usage callgraphing and CPU cache usage checkers
  (callgrind & cachegrind)
- some other, experimental checkers

So it's a good all-around tool.  See:
	http://valgrind.org/


If one wants to profile the whole system (to see also what SDL asks X server
to do etc), I would use either Oprofile or Sysprof:
	http://oprofile.sourceforge.net/about/
	http://sysprof.com/

When checking where the time went on the Nokia 770/N800/N810 (ARM) tablets,
I got the bottleneck functions on the device with Oprofile and then analyzed
from x86 data with valgrind/kcachegrind how/when/why those functions get
called in/from Hatari.

All of these tools are available e.g. in Debian.


	- Eero

> 
>  Thomas
> 
> 
> On Sun, 19 Dec 2010 23:04:28 +0100
> 
> Laurent Sallafranque <laurent.sallafranque at free.fr> wrote:
> > The main difference for me is that before the changes, I was running
> > full speed but I could hear my CPU FAN speeding.
> > I don't hear it anymore.
> > 
> > What's the best way to profile ?
> > 
> > Regards
> > 
> > Laurent
> > 
> > Le 19/12/2010 15:30, Thomas Huth a écrit :
> > > On Sat, 18 Dec 2010 09:28:27 +0100
> > > 
> > > Laurent Sallafranque<laurent.sallafranque at free.fr>  wrote:
> > >> All of these changes should result in a little more dsp speed.
> > >> Thomas, can you test this and tell me if this speeds up your
> > >> falcon ?
> > > 
> > > Which program / demo do you suggest for testing? I don't have
> > > much spare time to test a lot right now... Anyway, you could also
> > > simply do some profiling on your own, if your changes really make a
> > > difference, you should also see a difference on your fast computer.
> > > 
> > >   Thomas
> 
> _______________________________________________
> hatari-devel mailing list
> hatari-devel at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/hatari-devel




More information about the hatari-devel mailing list