Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Nov 2020 13:22:55 -0600
From:      Scott Bennett <bennett@sdf.org>
To:        ihor@antonovs.family
Cc:        freebsd-questions@freebsd.org
Subject:   Re:  Profiling C application
Message-ID:  <202011281922.0ASJMtiH020409@sdf.org>

next in thread | raw e-mail | index | archive | help
     On Fri, 27 Nov 2020 19:38:28 -0800 Ihor Antonov <ihor@antonovs.family>
wrote:

>What can I use on FreeBSD to profile a slow application?
>
>I have a source code of the application and I can rebuild it if necessary.
>
>I want to see where (in what functions) application spends most of its 
>time - amount of function calls and duration of each call (per call)
>
>What tools can you recommend to do this?
>
     I see you already have one response at least to your question, but
perhaps a simpler one is to use a now ancient BSD UNIX tool called gprof(1),
along with the compiler option -pg.  (See the gprof(1) man page for the
details.)  Note, too, that you may want to link your program to the profiling
versions of system libraries as explained in the man page.


                                  Scott Bennett, Comm. ASMELG, CFIAG
**********************************************************************
* Internet:   bennett at sdf.org   *xor*   bennett at freeshell.org  *
*--------------------------------------------------------------------*
* "A well regulated and disciplined militia, is at all times a good  *
* objection to the introduction of that bane of all free governments *
* -- a standing army."                                               *
*    -- Gov. John Hancock, New York Journal, 28 January 1790         *
**********************************************************************



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202011281922.0ASJMtiH020409>