PMCANNOTATE(8)
π PMCANNOTATE(8) β like, the manual page but make it make sense π
okay so bestie, welcome to pmcannotate, from the System Manager's Manual β it's an 8-section (system manager) page and it's genuinely iconic once you get it. Let me walk you through it π«Ά
β¨ NAME β¨
pmcannotate β sources printout with inlined profiling. yes that's the whole name line, she's brief but she's powerful π
πΈ SYNOPSIS πΈ
pmcannotate [-a] [-h] [-k pathname] [-l level] [-m mode] pmcout.out
binaryobj
that's it, that's the whole vibe check π₯
π¦ DESCRIPTION π¦
okay so here's the tea: the pmcannotate utility can produce both C sources or assembly sources of a program, with a line-by-line based profiling. like, it's giving "annotated code" main character energy β¨
so how does it get this info? the profiling information is retrieved through a pmcstat(8) raw output β and the program operations are retrieved through the objdump(1) tool. two besties doing the heavy lifting, fr fr π
when you call pmcannotate, the raw output is passed through the pmcout.out argument, while the program is passed through the binaryobj argument. two arguments, no cap.
lowkey important: as long aspmcannotaterelies onobjdump(1)andpmcstat(8)to work, it will fail if one of them is not available. so like, check your supplies before you start the group project, bestie π
π OPTIONS π
the following options are available:
-aβ shows the program profiling inlined in the assembly code only. no C information involving C sources is provided. straight assembly, no crumbs π-hβ prints out information about the usage of the tool. the "help me help you" button π«Ά-llevel β changes the lower bound (expressed in percentage) for traced functions that will be printed out in the report. the default value is0.5%. so like, anything under half a percent gets left on read π-kkerneldir β set the pathname of the kernel directory to argument kerneldir. this directory specifies wherepmcannotateshould look for the kernel and its modules. the default is/boot/kernel. it's giving "where's my stuff" energy π§-mmode β format to use when annotating source or assembly lines. one of:blockβ display percentage of matching samples relative to samples falling in the current block.globalβ display percentage of matching samples relative to all samples.rawβ display the raw count of matching samples.
pick your fighter, all three are valid π β
π LIMITATIONS π
okay bestie, this is the part where we get real. as long as pmcannotate relies on the objdump(1) utility to retrieve the C code, the program needs to be compiled with debugging options. no debug info, no C code, periodt. π
sometimes β in particular with heavy optimization levels β the objdump(1) utility embeds the code of inlining functions directly in the callers, making an output difficult to read. so like, your report comes out looking like a group chat with no context π
and the x86 version? it reports the sampling from pmcstat collecting the following instruction in regard of the interrupted one. this means that the samples may be attributed to the line below the one of interest. so always double-check, ngl β off-by-one is out here ruining lives π
π SEE ALSO π
objdump(1), pmcstat(8) β go read those too, iykyk π
π AUTHORS π
Attilio Rao <attilio@FreeBSD.org> β thank you for your service, icon π«Ά
and that's the whole page!! this Debian version of PMCANNOTATE(8) is dated January 14, 2025 β screenshot it, cite it, live your truth β¨ see you in the next manpage bestie π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2008 Nokia Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms