what is -DNOPROFILE ?

cpghost at cordula.ws cpghost at cordula.ws
Thu Sep 9 05:01:26 PDT 2004


On Thu, Sep 09, 2004 at 01:51:22PM +0200, Geert Hendrickx wrote:
> On Thu, Sep 09, 2004 at 01:40:33PM +0200, cpghost at cordula.ws wrote:
> > On Thu, Sep 09, 2004 at 12:52:32PM +0200, Geert Hendrickx wrote:
> > > Hi, 
> > > 
> > > I was wondering what this make.conf-flag is for: 
> > > 
> > > NOPROFILE=     true    # Avoid compiling profiled libraries
> > > 
> > > What are "profiled" libraries?
> > 
> > /usr/lib/lib*_p.{a,so}
> > 
> > See gprof(1)
> 
> So, if I understand it correctly from gprof(1), profiled libraries are
> for measuring how much CPU time is spent in each suboutine?  And, as a
> regular user (not a developer or benchmarker), I don't need this and can
> use -DNOPROFILE for not building profiled libraries?  

Yes, that's the whole point of NOPROFILE. Unless you are a developer
yourself and want to optimize some code, there's little reason to keep
those profiling libs around (or spend time building them).

> I also understand these libraries are seperate from my "regular"
> libraries?  So, is there a drawback (other than increased compile time
> for a make world) in building them?  Or does it not matter?  

The libraries contain the same code as the regular (non-profiling)
libraries, with a small addition within every function, to count the
number of times a function is called and to measure the time.

Linking normal apps against profiled libraries naturally slows them
down (at run time), because the measuring code must be executed every
time a library function is called. Therefore, normal applications are
not linked against profiling libraries, and you can safely remove
those libs from your system.

It doesn't harm though to build them anyway, just in case you
change your mind. Even on slow systems, building profiled libraries
doesn't take that much longer. At the end of the day, it's your call.

> GH

Cheers,
cpghost.

-- 
Cordula's Web. http://www.cordula.ws/


More information about the freebsd-questions mailing list