gprof, bprof and Time Profilers

Mr. Vaught shows programmers a few commands to determine which sections of their code need optimization.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

progress has been made

Anonymous's picture

"The easiest profiler to use under Linux is the gprof profiler"

We've come a long way since 1998. Check out Zoom - or even oprofile.

> The operation of

Anonymous's picture

> The operation of referencing the array consists of multiplying
> i times a scaling factor (which is implemented as binary left shifts),
> adding this value to the start of array[] and fetching from that location.
> Replacing this code with:

Any CPU since the 68000 has had addressing modes like (reg1*constant + reg2) which makes the array index and pointer cases strictly identical, unless the pointer saves you a register. Is your friend coding on 8-bit cpu or something ?

Flat Profile

V Varun's picture


We are using Flat profile in order to analyse our program. But the calls column for all the functions does not show any value. We are unable to figure out what is the problem. Please tell us a solution as quickly as possible. Thanks in advance.

Thanks and Regards,
V Varun.

error on running gprof

Anonymous's picture

I am using gprof for profiling my code compiled using gcc in Linux.
the code runs fine and generates gmon.out
but when i give gprof it is giving error
"gprof: datalogger(which is the name of my executable):not in a.out format"

what can be the possible reason?
anybody please suggest.


Anonymous's picture

I am trying to profile my code on Linux using Gprof
However it is showing incomplete data
Also it is showing the cumulative sec and self sec as all 0.00
I tried profileing in HP 11i there gprof is doing name mangling

One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix