This is my python tool for parsing the PC histogram output provided by Max's tool. This has been enormously helpful over the last week to diagnose and debug performance issues on HB.
This tool produces two files per CSV: pc_hist.pdf, and bb_hist.pdf. The former is a Program Counter histogram where the height of each bar is the number of cycles spent on that PC. The latter is a Basic Block Histogram where the height of each bar is the number of cycles spent on that PC.
The PC histogram is useful for identifying the program counter locations responsible for stalls. I typically use it to find load-use distance issues, but others exist.
The Basic Block Histogram provides slightly more information. In addition to the number of cycles in each basic block, it also provides a summary of the percentage of cycles spent in that basic block AND the IPC of the basic block.
The tool has three flags:
--start: Start PC for histogram plots
--end: End PC for histogram plots
--pathpat: Path pattern to search for CSV files
--start and --end are for narrowing the ROI. They must be provided in 32-bit hex format.
--pathpat is for aggregating results across multiple files. It must be provided as a string, e.g. "./block*"so that the shell doesn't expand the wildcard character. When--pathpat` is used, the tool produces two PDFs in each directory where it finds vanilla_core_pc_hist.csv AND two aggregate PDFs in the working directory where this tool is called.
This is my python tool for parsing the PC histogram output provided by Max's tool. This has been enormously helpful over the last week to diagnose and debug performance issues on HB.
This tool produces two files per CSV: pc_hist.pdf, and bb_hist.pdf. The former is a Program Counter histogram where the height of each bar is the number of cycles spent on that PC. The latter is a Basic Block Histogram where the height of each bar is the number of cycles spent on that PC.
The PC histogram is useful for identifying the program counter locations responsible for stalls. I typically use it to find load-use distance issues, but others exist.
The Basic Block Histogram provides slightly more information. In addition to the number of cycles in each basic block, it also provides a summary of the percentage of cycles spent in that basic block AND the IPC of the basic block.
The tool has three flags:
--start
: Start PC for histogram plots--end
: End PC for histogram plots--pathpat
: Path pattern to search for CSV files--start
and--end
are for narrowing the ROI. They must be provided in 32-bit hex format.--pathpat
is for aggregating results across multiple files. It must be provided as a string, e.g."
./block*"so that the shell doesn't expand the wildcard character. When
--pathpat` is used, the tool produces two PDFs in each directory where it finds vanilla_core_pc_hist.csv AND two aggregate PDFs in the working directory where this tool is called.Two examples are attached bb_hist.pdf pc_hist.pdf
WIP? because I keep thinking I'm done and then I iterate more.