Fine-grained binary instrumentation is a popular technique to monitor program execution. Intel's Pin is a leading dynamic binary instrumentation framework for building program measurement and analysis tools. A key feature missing in Pin is the ability to associate call paths with instructions as they execute. The availability of calling context information enables Pin tools to provide more detailed diagnostic feedback. This paper introduces CCTLib---a call path collection library that any Pin tool can use to obtain the full calling context at any and every machine instruction that executes. CCTLib not only associates any instruction with source code along the call path, but also points to the data object accessed by the instruction if it is a memory access.   With CCTLib, we demonstrate that collecting call paths on each executed instruction is possible, even for reasonably long running programs. Prior art in call path collection for Pin has several limitations. Compared to other open-source Pin tools for call path collection, CCTLib provides richer information that is accurate even for programs with complex control flow and does so with about 30% less overhead---a difference of 14× on average. CCTLib enables attribution of metrics in Pin tools to both code and data.
['Milind Chabbi', 'Xu Liu', 'John M. Mellor-Crummey']
Call Paths for Pin Tools