Current Plan: Callgraph support
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
pmcstat and 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 code to capture callgraphs inside the hwpmc(4) driver. Status: completed in Perforce, and undergoing community review.
A patch against recent -CURRENT (Aug 2007) may be found at:
http://people.freebsd.org/~jkoshy/download/pmctools-callgraph-patch.gz.
Near Future
Stuff that needs to be done in the near future:
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.
-
For longer term work, please see PmcTools/PmcResearch.