Page MenuHomeFreeBSD

pmc: console configuration and table rendering for new PMC tools
Needs ReviewPublic

Authored by ali_mashtizadeh.com on Tue, Jun 23, 4:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jul 10, 11:36 PM
Unknown Object (File)
Thu, Jul 9, 12:05 AM
Unknown Object (File)
Wed, Jul 8, 3:41 PM
Unknown Object (File)
Wed, Jul 8, 7:08 AM
Unknown Object (File)
Wed, Jul 8, 7:04 AM
Unknown Object (File)
Mon, Jul 6, 7:00 PM
Unknown Object (File)
Mon, Jul 6, 11:48 AM
Unknown Object (File)
Sun, Jul 5, 7:18 PM
Subscribers

Details

Reviewers
imp
jhb
mhorne
adrian
Group Reviewers
pmc
Summary

Initializes the terminal rendering code used by the new pmc tools. Then
provides a table abstraction for collecting, sorting and rendering
tables. It provides pretty printed results with typed fields that print
several types used throughout the new PMC tools. By default the fields
are formatted in engineering notation.

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 74480
Build 71363: 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/

adrian added inline comments.
usr.sbin/pmc/display.cc
210

I haven't checked yet if anything else is registering for SIGWINCH / window size updates, but I thought I'd mention here to handle window size updates.

Yes, I don't have the ncurses bits ready so I haven't bothered with SIGWINCH just yet. In this first set of diffs it print once to the current console.

This revision is now accepted and ready to land.Tue, Jun 30, 6:29 PM

Misused git-arc sorry my first attempt so it should have any changes.

This revision now requires review to proceed.Wed, Jul 1, 9:08 PM
This revision is now accepted and ready to land.Wed, Jul 1, 9:10 PM

I'm running a build on a few architectures to make sure I don't break anything. I'll post when it's done.

This revision now requires review to proceed.Thu, Jul 2, 4:13 PM

Tinderbox passes on my tree, except for unrelated ZFS build problems for amd64.LINT*.

Any more comments on these or can someone land this stack? I got the remaining functionality I described that I would like to rebase and prepare for review.