branchstats

command
v0.0.0-...-7b712e5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2023 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Command branchstats analyzes branch profiles for branch mispredict rates.

branchstats expects a perf.data collected with

perf record -e branches -j any -c 400009

To collect only branches in user-space code, use

perf record -e branches:u -j any,u -c 400009

The output is a table like

comm     PC                               branches mispredicts
bench    scanner.go:258                  419609441 309206957 (73.7%)
    257 func isLetter(ch rune) bool {
    258         return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_' || ch >= 0x80 && unicode.IsLetter(ch)
    259 }

bench    mgcmark.go:1000                1967244262 236405319 (12.0%)
    999 }
   1000 if bits&bitPointer == 0 {
   1001         continue // not a pointer

Each row shows a branch at a particular location and gives the estimated number of times that branch executed, the estimated number of mispredicts, and the mispredict rate. The table is sorted by the number of mispredicts.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL