[vlc-devel] Re: profiing

Sam Hocevar sam at zoy.org
Tue Feb 24 14:40:33 CET 2004


   First of all, I highly recommend OProfile (http://oprofile.sf.net/)
as a powerful replacement for gprof. But I'll answer your gprof questions
anyway.

On Tue, Feb 24, 2004, chshin wrote:

> I'm profiling VLC player using GNU profiling tool (gprof).
> To compile a source file for profiling, should specify the '-pg' option when
> run the compiler.
> I simply modified main Makefile with Adding '-pg' to OBJCFLAGS.

   Be careful, OBJCFLAGS is only for Objective C files ; most of VLC is
in C.

   To add -pg to VLC and all its modules, the easiest is to edit
vlc-config after ./configure was run, look for the cflags="" line and
add -pg in the string. Do the same for cxxflags and ldflags.

> But VLC has dynamic structure which plugin/unplugin many modules.
> Because profiling result is made from partial codes except dynamic modules
> part, I can't acquire complete information.

   No, the reason you are getting incomplete information is because VLC
is multithreaded. Please read the following article for a solution:

    http://sam.zoy.org/writings/programming/gprof.html

-- 
Sam.

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the vlc-devel mailing list