binutils Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gprof

Gprof tests now accommodate Solaris systems

Gprof test suite is updated to correctly handle profiling outputs from Solaris, which includes 'main' in its call graph due to its traditional BSD gmon.out for…

The gprof test suite was failing on Solaris systems because Solaris includes the main function in the call graph generated by its profiling tools, unlike other platforms. This commit modifies the test scripts to account for this difference in output, allowing successful testing on Solaris. It also refines the handling of function descriptors for PowerPC AIX targets, ensuring that specific platform behaviors are correctly addressed within the test framework.

In Details

Gprof is a profiling tool that analyzes the execution time of functions in a program. It relies on gmon.out files, which contain profiling data generated during program execution. On Solaris, the gmon.out format, derived from original BSD implementations, includes the main function in the call graph where other systems might exclude it as an entry point. This impacts how gprof interprets and reports function timings. The change adjusts gprof's test scripts to recognize and tolerate the presence of main in the Solaris output, preventing test failures due to platform-specific gmon.out

For Context

Imagine you have a program and you want to know which parts of it are taking the most time to run. That's what profiling tools like gprof do. When your program runs with profiling enabled, it creates a special file (called gmon.out) that records how much time is spent in each function. Gprof then takes this file and gives you a report. However, different operating systems can record this information slightly differently. On Solaris, for example, the gmon.out file always includes main (the very first function that runs in almost any program) in its timing reports, whereas other systems might not. This update makes sure that gprof's automatic tests don't fail just because Solaris reports main in its profiling data, making gprof more robust across different operating systems. It also clarifies how to handle profiling data from specialized systems like PowerPC running AIX.

Filed Under: gproftestingsolarisprofilingbugfix