Gprof-C + + performance analysis tool

Source: Internet
Author: User

Reprinted from:

C + + Performance Test Tool Gprof + kprof + gprof2dot in Linux environments

Add-PG Compilation options:

gcc/g++-G-PG File.c[c]

Run a.out to generate Gmon.out

./a.out

Generate Intermediate Analysis files

Gprof./a.out > Prof.log

Abbreviated brief output of common parameters-B brief

Gprof-b./a.out > Prof.log

-Q print Function call relationship

Gprof-q./a.out > Prof.log

-P Print a flat profile

Gprof-p./a.out > Prof.log

https://github.com/jrfonseca/

Generate Program Flowchart

Gprof./test | gprof2dot.py | Xdot

Gprof-b./test Gmon.out | Gprof2doc > A.dot

Gprof2dot default is a partial function call graph, does not have the performance influence small function call to display, for example does not appear in the class construction, the destructor,

If you want to display all of the function calls, you can gprof2dot-n0-e0 , the default is n0.5, which affects less than 5% of the function is not displayed.

Of course, this picture will be very messy, because the display of a lot of content, you can gprof2dot-n0-e0-s #-s that does not display such as templates, function entry parameters and so on, so that

Function name display is more streamlined.

Gprof-C + + performance analysis tool

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.