gprof(1) on Solnix vs Linux and the BSDs

On Solnix, gprof is the illumos gprof at /usr/bin/gprof. It reads gmon.out by default and prints a call graph, a flat profile and an index. Several single-letter flags differ from Linux and FreeBSD: -C means demangle, -l means suppress local symbols, and there are no -k, -K, -L or -u.

What Solnix runs

A default Solnix system runs the illumos gprof at /usr/bin/gprof. No other variants are shipped. The page is published in pkgs.solnix.illumos-world-man. Its NOTES section is cut off in the bundle, so only the first sentence is visible: a stripped image falls back to the .dynsym and .SUNW_ldynsym symbol tables.

Differences

Compared withTopicWhat differs
Linux, FreeBSD-C meaningSolnix -C demangles symbol names. FreeBSD -C count looks for arcs to break in cycles of count or more members, and can run very long. Linux -C[symspec] prints a tally of function call counts. Linux demangles with --demangle.
Source: Solnix gprof(1) -C; FreeBSD gprof(1) -C count; Linux gprof(1) -C, --exec-counts, --demangle
Linux, FreeBSD-l meaningSolnix -l suppresses graph entries for all local symbols. FreeBSD -l suppresses the whole call-graph profile. On Linux, -l combined with -C tallies basic-block counts. Linux also has a --line long option.
Source: Solnix gprof(1) -l; FreeBSD gprof(1) -l; Linux gprof(1) -C, SYNOPSIS (--line)
Linux, FreeBSD-L meaningSolnix gprof has no -L. FreeBSD -L suppresses the flat profile. Linux -L prints full source file pathnames. The same flag does opposite or unrelated things on the other two systems.
Source: Solnix gprof(1) SYNOPSIS; FreeBSD gprof(1) -L; Linux gprof(1) -L, --print-path
Linux, FreeBSDbreaking cycles with -kSolnix has no -k. FreeBSD -k fromname toname deletes arcs from one routine to another to break cycles. Linux lists -k from/to in its synopsis; the text in the bundle does not describe it.
Source: Solnix gprof(1) SYNOPSIS; FreeBSD gprof(1) -k; Linux gprof(1) SYNOPSIS
FreeBSD-K and -uFreeBSD -K reads symbols from the running kernel (sysctl(3), kldsym(2)) and ignores the a.out argument. FreeBSD -u hides names not visible to C. Solnix has neither option.
Source: FreeBSD gprof(1) -K, -u; Solnix gprof(1) SYNOPSIS
FreeBSD-n, -c and -DSolnix -n limits the flat and graph listings to the top n functions, -c finds the static call graph by heuristic, and -D writes a gmon.sum holding the difference of profiles. The FreeBSD synopsis has none of these.
Source: Solnix gprof(1) -n, -c, -D; FreeBSD gprof(1) SYNOPSIS
FreeBSDdefault profile file nameSolnix reads gmon.out by default. FreeBSD defaults to the executable's name with .gmon appended. Linux also defaults to gmon.out. Pass the profile file explicitly if the script must run on FreeBSD.
Source: Solnix gprof(1) DESCRIPTION; FreeBSD gprof(1) DESCRIPTION; Linux gprof(1) DESCRIPTION
Linuxoutput selection modelLinux selects output with -p, -q, -A and their negations, each taking an optional symspec. The default is -p -q. Solnix has none of these. It always prints the call graph, flat profile and index, and filters with -e, -E, -f and -F.
Source: Linux gprof(1) OPTIONS (-A, -p, -q, -P, -Q); Solnix gprof(1) DESCRIPTION and OPTIONS
Linux, FreeBSDenabling profiling and where output goesSolnix profiling comes from cc -xpg, -pg with other compilers, or LD_PROFILE for shared objects. The PROFDIR environment variable redirects output to pid.programname in that directory. The Linux and FreeBSD pages describe -pg only.
Source: Solnix gprof(1) DESCRIPTION, ENVIRONMENT VARIABLES (PROFDIR); Linux gprof(1) DESCRIPTION; FreeBSD gprof(1) DESCRIPTION
Linuxenvironment variable for source searchLinux reads GPROF_PATH as a source search path, an alternative to -I. The Solnix page documents PROFDIR instead, and has no source annotation or -I.
Source: Linux gprof(1) -I; Solnix gprof(1) ENVIRONMENT VARIABLES

Standards

  • POSIX: gprof is not a POSIX.1-2024 utility.

Writing portable scripts

  • Stick to -a, -b, -e, -E, -f, -F, -s and -z, which appear in the synopsis of all three systems. Avoid -C, -l, -L, -k, -n and -D, which differ or are missing.
  • Name the profile file on the command line instead of relying on the default: it is gmon.out on Solnix and Linux but a.out.gmon-style names on FreeBSD.

Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.