Page MenuHomeFreeBSD

pmc: Display system level breakdown of performance data
Needs ReviewPublic

Authored by ali_mashtizadeh.com on Aug 18 2026, 9:43 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 1, 3:52 AM
Unknown Object (File)
Thu, Oct 1, 3:11 AM
Unknown Object (File)
Wed, Sep 30, 12:42 PM
Unknown Object (File)
Tue, Sep 29, 7:26 PM
Unknown Object (File)
Tue, Sep 29, 5:10 PM
Unknown Object (File)
Tue, Sep 29, 2:39 PM
Unknown Object (File)
Tue, Sep 29, 2:36 PM
Unknown Object (File)
Tue, Sep 29, 1:56 PM

Details

Summary

Presents a system level view of the performance data broken down by
program binary.

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 77104
Build 73987: arc lint + arc unit

Event Timeline

ali_mashtizadeh.com created this revision.

For context we worked with AMD to get Instruction Based Sampling (IBS) support into HWPMC and we are making a number of ongoing improvements. I built into the somewhat abandoned pmc command a new set of tools for collecting and analyzing pmc logs. I split the this stack of patches into the smallest set I could but to do that I've left out a lot of functionality that improves substantially over pmcstat.

Major improvements:

  • 2.5x faster processing of large sample logs in about 1/2 the code of libpmcstat -> Reduced analysis pass code by more than 50% when we switched.
  • DWARF symbol and line resolution (see line numbers in pmc memory command below)
  • Generic tables, graphs, and bit field printing code for use by analysis tools
  • Generic filtering across all tools (including IBS specific filters)
  • A few general counter analysis passes that find samples by program, function, etc.
  • IBS provides precise samples
  • IBS specific commands to analyze frontend stalls, branch miss predicts, memory stalls
  • IBS based c2c analysis to detect potential false sharing

The remaining analysis passes, DWARF resolution and graphing code was left out to make this stack of changes as small as possible.

Ongoing work:

  • Ncurses and HTML output
  • Replacement to "pmc stat" to collect and print top-down model and other counter only presentations.

Sample output from the pmc commands: https://rcs.uwaterloo.ca/~ali/pmc-samples/

Remaining changes: c2c, dwarf debug symbols, and man pages

  1. Distributed the build changes to have each diff build
  2. A few minor fixes for gcc builds (tested with amd64-gcc15)