[Numpy-discussion] Profiling numpy ? (parts written in C)

David Cournapeau david at ar.media.kyoto-u.ac.jp
Wed Dec 20 03:16:36 CST 2006


Francesc Altet wrote:
> A Dimecres 20 Desembre 2006 07:59, David Cournapeau escrigué:
>> Could you detail a bit how you did the profiling with oprofile ? I don't
>> manage to get the same results than you (that is on per application
>> basis when the application is a python script and not a 'binary' program)
>
> Sure. You need first to start the profiler with:
>
> opcontrol --start
>
> then run your application, for example:
>
> python2.5 /tmp/clipb2.py
>
> after this you should instruct oprofile to stop collecting samples:
>
> opcontrol --stop
>
> now, you need to tell oprofile that you want a report on the binary
> you have run (i.e. your interpreter):
>
> opreport -l /usr/local/bin/python2.5  # put there your actual path
>
Ok, I am a bit stupid, I should have thought about using the python 
interpreter instead of my script. But if I do this, I have only one 
line, which corresponds to the time spend to python:

opreport -l /usr/bin/python2.5

6520 100.00 (no symbols)

I guess the problem is that oprofile has no way to know that code spend 
into eg umath.so was called by scripts run python2.5. How do you do that 
? Do you need a specially compiled interpreter (with -g ?)

cheers,

David


More information about the Numpy-discussion mailing list