EU-STACKPROF(1)
π eu-stackprof(1) π
okay bestie, sit DOWN, because this one is literally the girlboss of stack profilers. this is eu-stackprof from the elfutils squad, and she's here to collect a multi-process stack profile for you. no cap. π
β¨ SYNOPSIS β¨
eu-stackprof [-v|-vv|...] [--gmon] [-o DEST] [OPTION]... [-- CMD...]
πΈ DESCRIPTION πΈ
so basically, eu-stackprof collects stack profile data from Linux perf_events. she can do it systemwide across literally every process, or she can lock in on one specific process β either an existing one you hand her with -p, or a brand new one she launches from the command line arguments you give her β plus any children forked from it. yes, the babies count too. π«Ά
to get at the perf_events interface you need the right privileges, either globally or for the particular targeted process. go check out perf_event_open(2), section "Arguments", for the whole rundown on privilege requirements. it's giving homework but it's important. π
when you use the --gmon option, the results get saved as gmon.out files in the gprof(1) format. those are meant to be useful for collecting statistics with profiledb. iconic.
when you DON'T use --gmon, eu-stackprof just collects and prints basic stats about the profile data to standard error. lowkey chill of her. π
π OPTIONS π
-e EVENT,--event=EVENTβ configure theperf_eventssampling according to the libpfm event spec you give her (like, say,perf::CPU-CLOCK:freq=1000). yes ma'am, specify the vibe. β¨--event-listβ list all the available libpfm events and dip. window shopping, but for events. ποΈ-f,--forceβ if the output directory for--gmonalready has files matching the build-ids she ran into, just overwrite them with the freshly collected data. no hesitation, no mercy. π-g,--gmonβ output program counter histograms AND callgraphs for every executable binary encountered during profiling, ingprof(1)'sgmon.outformat. the whole menu. π-G METHOD,--hist-split=METHODβ pick the method used to divide the address space into histograms for the--gmonoutput.METHODshould be one of:noneβ don't split at all: write one histogram covering the whole address range. one girl, one histogram. πeven(default) β split the address space into histograms of equal size, so thatgprof(1)'s scale consistency check is satisfied. she's a rule follower, we love that. β¨flexβ split the address space into variable-sized histograms to minimize storage requirements. the result will likely be rejected by thegprof(1)tool, since it requires all histograms to have a consistent scale β but it should still be suitable forprofiledb. chaotic good energy, honestly. π
-?,--helpβ print a short list of options. the lil cheat sheet. π-n MAXFRAMES,--maxframes=MAXFRAMESβ upper bound on how many frames to unwind for each stack sample. defaults to1if--gmonis enabled, because frames beyond the first aren't needed to produce the gprof histogram and callgraph arc data; defaults to256otherwise. know your limits bestie. π¦-o DEST,--output=DESTβ the directory where results get written when--gmonoutput is enabled. defaults to the current directory. home sweet home. π-p PID,--pid=PIDβ restrict the profile to processPIDand its future children. just them, nobody else. π-v,--verboseβ output additional info. you can give this once or multiple times to crank up the granularity, logging each new binary, each stack sample, or each frame. morevs = more tea. π΅-V,--versionβ print program version. the origin story. β
π OUTPUT FORMAT π
when --gmon output is enabled, eu-stackprof produces the following files for each executable object she observed among the profiled processes, identified by build-id:
gmon.BUILDID.exeβ a symlink to the executable object observed by the profiler. cute little pointer. π«Άgmon.BUILDID.outβ contains a histogram of program counters and a table of callgraph arcs (observed from the top2frames of the stacktrace). same format as produced by the gprof infrastructure and consumed bygprof(1). the real deal. π₯gmon.BUILDID.jsonβ metadata in JSON format, including the path to the executable object and libpfm event information. receipts. π§Ύ
π EXAMPLES π
profile system-wide; write gmon.out files to the current directory:
sudo eu-stackprof --gmon
profile PID 1211 and children forked from it; log one line per stack sample; write gmon.out files to results/, replacing any already-existing files with the same build-ids:
sudo eu-stackprof -vv --gmon -o results/ -p 1211 --force
likewise, launch vim and profile it:
sudo eu-stackprof --gmon -o results/ --force -- vim test.txt
profile system-wide; log one line per stack frame:
sudo eu-stackprof -vvv
π REPORTING BUGS π
found a bug? spill the tea to <elfutils-devel@sourceware.org> or hit up https://sourceware.org/bugzilla/. they wanna hear it fr fr.
π¦ SEE ALSO π¦
okay that's the whole page bestie, go forth and profile π this was brought to you by elfutils, dated 2026-Apr-10. periodt. π
β¨
π¦ where this page comes from
- arch rolling: elfutils 0.196-1
- arch rolling: elfutils 0.197-1 Β· GPL-3.0-or-later
- centos-stream 10: elfutils 0.197-1.el10 Β· GPL-3.0-or-later AND (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GFDL-1.3-no-invariants-or-later
- fedora 43: elfutils 0.196-1.fc43
- fedora 43: elfutils 0.197-1.fc43 Β· GPL-3.0-or-later AND (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GFDL-1.3-no-invariants-or-later
- fedora 44: elfutils 0.196-1.fc44
- fedora 44: elfutils 0.197-1.fc44 Β· GPL-3.0-or-later AND (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GFDL-1.3-no-invariants-or-later
- ubuntu stonking: elfutils 0.196-1 Β· GPL-3.0-or-later
- Copyright 2026 Red Hat Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms