CCTLib Tutorial
Pinpointing Software Inefficiencies with
Fine-grained Program Monitoring

When: 8:30 - 11:45 AM, Feb 5th, 2017.
Where: Room 615A, Hilton Austin, 500 East 4th street, Austin, Texas, 78701, USA.

Slides are available


Researchers, practitioners, and students interested in performace analysis and tuning.


Complex code bases with several layers of abstractions have abundant inefficiencies that affect the execution time. Inefficiencies arise from myriad causes such as developer's inattention to performance, inappropriate choice of abstractions, algorithms and data structures, ineffective or detrimental compiler optimizations, among others. Not all inefficiencies are easy to detect or eliminate with compiler optimization; compilers have inherent limitations of static analysis and optimization scope. Classical "hotspot" performance analysis tools are also incapable of identifying many kinds of software inefficiencies. Microscopic observation of whole executions at instruction- and operand-level granularity breaks down abstractions and helps recognize inefficiencies that masquerade in complex programs.

Intel's Pin is a dynamic binary-instrumentation tool widely used in microscopic program introspection such as performance analysis, debugging, software security, among others. Delivering deep insights about executions requires attributing runtime measurements to execution contexts--primarily the calling context. A detailed call path attribution of execution measurements enhances a tool's capability and usability. Pin, however, lacks a native API to collect calling context on an event of interest. Moreover, fine-grain tools such as a data-race detector may require storing call paths on every instruction, which can result in a deluge of call paths.

In this tutorial, we will introduce CCTLib, a library for efficiently collecting execution-wide call paths and associating execution metrics with call paths in any Pin tool. CCTLib is simple to use and effective in improving a Pin-tool's diagnostic capabilities. We introduce simple, yet effective, CCTLib APIs that offer rich calling context capabilities for Pin tools. We will introduce advanced CCTlib features for attributing every memory access to the corresponding data object in the program. We will introduce CCTLib internals for advanced users. We will show example Pin tools for detecting certain classes of software inefficiencies such as dead stores and redundant computations. Using CCTLib for these clients, we will show how one can pinpoint software inefficiencies in large, complex code bases and show how one can gain a superior understanding of execution profiles. Using CCTLib's pinpointing capabilities we show how one can tune their code to eliminate inefficiencies and obtain significant performance improvements. Finally, we will show an emerging GUI for CCTLib, which facilitates intuitive visualization of huge amounts of data obtained from fine-grained analysis.


  • Milind Chabbi, Hewlett Packard Labs
  • Xu Liu, College of William and Mary
  • Shasha Wen, College of William and Mary


For questions about this tutorial please contact Xu Liu and Milind Chabbi.

Related Publications

  • "RedSpy: Exploring Value Locality in Software", Shasha Wen, Milind Chabbi and Xu Liu, The 22nd International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), Apr 8-12, 2017, Xi'an, China.
  • "Characterizing Emerging Heterogeneous Memory", Du Shen, Xu Liu and Felix Xiaozhu Lin, The 2016 ACM SIGPLAN International Symposium on Memory Management (ISMM), Jun 14, 2016, Santa Barbara, California, USA.
  • "Runtime Value Numbering: A Profiling Technique to Pinpoint Redundant Computations", Shasha Wen, Xu Liu and Milind Chabbi, The 24th International Conference on Parallel Architectures and Compilation Techniques (PACT), Oct 18-21, 2015, San Francisco, California, USA.
  • "Call Paths for Pin Tools", Milind Chabbi, Xu Liu and John Mellor-Crummey, The 2014 International Symposium on Code Generation and Optimization (CGO), Feb 15-19, 2014, Orlando, Florida, USA.
  • "DeadSpy: a tool to pinpoint program inefficiencies", Milind Chabbi and John Mellor-Crummey, The 2012 International Symposium on Code Generation and Optimization (CGO), Mar 31 - Apr 04, 2012, San Jose, California, USA.


Start from 8:30 AM