Pmctools: Plan of Work

Callgraph support requires changes to the kernel to capture a stack at the time of the PMC NMI interrupt. It also requires changes to the userland API (libpmc(3)) and reporting tools (pmcstat(8)).

The current approach of using gprof(1) for the final display of profiling data is suboptimal for analysing callgraphs that span executable modules. pmcstat(8) will need to be enhanced to support callgraphs directly. I'm planning to do this in the following phases:

Implement a cross-platform libelf(3) API. One of my goals is to create a cross-platform performance analysis toolset. Rather than parsing ELF files directly in pmcstat, as most of our other tools do (e.g., gprof, readelf, others), I'd rather use a libelf API for pmcstatand the other tools. See wiki page "LibElf". Status: Completed, and in -current/FreeBSD 7.

Implement cross-module callgraph support in pmcstat. The hwpmc log will contain call graph information that could traverse module boundaries (e.g., calls from an executable into a shared library). Status: completed in Perforce, undergoing community review.

Implement a proper test suite for hwpmc(4) and libpmc(3). Since hwpmc(4) can log data remotely, I looked around for a test framework that can manage distributed test cases. I found TET 3.7, which I'm happy with. See also: TetIntegration.