The Community for Technology Leaders
Green Image
Issue No. 05 - Sept.-Oct. (2012 vol. 38)
ISSN: 0098-5589
pp: 1160-1177
Xiangyu Zhang , Purdue University, West Lafayette
Dasarath Weeratunge , Purdue University, West Lafayette
William N. Sumner , Purdue University, West Lafayette
Yunhui Zheng , Purdue University, West Lafayette
ABSTRACT
Calling contexts (CCs) are very important for a wide range of applications such as profiling, debugging, and event logging. Most applications perform expensive stack walking to recover contexts. The resulting contexts are often explicitly represented as a sequence of call sites and hence are bulky. We propose a technique to encode the current calling context of any point during an execution. In particular, an acyclic call path is encoded into one number through only integer additions. Recursive call paths are divided into acyclic subsequences and encoded independently. We leverage stack depth in a safe way to optimize encoding: If a calling context can be safely and uniquely identified by its stack depth, we do not perform encoding. We propose an algorithm to seamlessly fuse encoding and stack depth-based identification. The algorithm is safe because different contexts are guaranteed to have different IDs. It also ensures contexts can be faithfully decoded. Our experiments show that our technique incurs negligible overhead (0-6.4 percent). For most medium-sized programs, it can encode all contexts with just one number. For large programs, we are able to encode most calling contexts to a few numbers. We also present our experience of applying context encoding to debugging crash-based failures.
INDEX TERMS
Context, Encoding, Instruments, Image edge detection, Runtime, Decoding, Software algorithms, call graph, Calling context, context sensitivity, profiling, path encoding, calling context encoding
CITATION
Xiangyu Zhang, Dasarath Weeratunge, William N. Sumner, Yunhui Zheng, "Precise Calling Context Encoding", IEEE Transactions on Software Engineering, vol. 38, no. , pp. 1160-1177, Sept.-Oct. 2012, doi:10.1109/TSE.2011.70
91 ms
(Ver 3.1 (10032016))