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

Francesc Altet faltet at carabos.com
Wed Dec 20 03:32:07 CST 2006


A Dimecres 20 Desembre 2006 10:16, David Cournapeau escrigué:
> 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 ?)

No, I don't think so (at least, if you are not going to profile python
itself). I think that the only thing you need should be to specify the
-g when compiling the libraries that you are going to profile; in this
case: NumPy.

Cheers,

-- 
>0,0<   Francesc Altet     http://www.carabos.com/
V   V   Cárabos Coop. V.   Enjoy Data
 "-"



More information about the Numpy-discussion mailing list