skip to main content
research-article

k-Calling context profiling

Published:19 October 2012Publication History
Skip Abstract Section

Abstract

Calling context trees are one of the most fundamental data structures for representing the interprocedural control flow of a program, providing valuable information for program understanding and optimization. Nodes of a calling context tree associate performance metrics to whole distinct paths in the call graph starting from the root function. However, no explicit information is provided for detecting short hot sequences of activations, which may be a better optimization target in large modular programs where groups of related functions are reused in many different parts of the code. Furthermore, calling context trees can grow prohibitively large in some scenarios. Another classical approach, called edge profiling, collects performance metrics for caller-callee pairs in the call graph, allowing it to detect hot paths of fixed length one. We study a generalization of edge and context-sensitive profiles by introducing a novel data structure called k-calling context forest (k-CCF). Nodes in a k-CCF associate performance metrics to paths of length at most k that lead to each distinct routine of the program, providing edge profiles for k=1, full context-sensitive profiles for k equal to infinity, as well as any other intermediate point in the spectrum. We study the properties of the k-CCF both theoretically and experimentally on a large suite of prominent Linux applications, showing how to construct it efficiently and discussing its relationships with the calling context tree. Our experiments show that the k-CCF can provide effective space-accuracy tradeoffs for interprocedural contextual profiling, yielding useful clues to the hot spots of a program that may be hidden in a calling context tree and using less space for small values of k, which appear to be the most interesting in practice.

References

  1. G. Ammons and J. R. Larus. Improving data-flow analysis with path profiles. SIGPLAN Not., 39 (4): 568--582, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. G. Ammons, T. Ball, and J. R. Larus. Exploiting hardware performance counters with flow and context sensitive profiling. SIGPLAN Not., 32 (5): 85--96, 1997. ISSN 0362--1340. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. G. Ammons, J.-D. Choi, M. Gupta, and N. Swamy. Finding and removing performance bottlenecks in large systems. In ECOOP, volume 3086 of LNCS, pages 170--194, 2004.Google ScholarGoogle Scholar
  4. T. Apiwattanapong and M. J. Harrold. Selective path profiling. In Proc. ACM SIGPLAN-SIGSOFT workshop on Program analysis for software tools and engineering, pages 35--42. ACM, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. M. Arnold and B. Ryder. A framework for reducing the cost of instrumented code. In PLDI, pages 168--179. ACM, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. M. Arnold and P. Sweeney. Approximating the calling context tree via sampling. Technical Report RC 21789, IBM Research, 2000.Google ScholarGoogle Scholar
  7. T. Ball and J. R. Larus. Efficient path profiling. In MICRO 29: Proceedings of the 29th annual ACM/IEEE international symposium on Microarchitecture, pages 46--57, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. T. Ball, P. Mataga, and M. Sagiv. Edge profiling versus path profiling: the showdown. In POPL, pages 134--148. ACM, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. A. R. Bernat and B. P. Miller. Incremental call-path profiling. Technical report, University of Wisconsin, 2004.Google ScholarGoogle Scholar
  10. M. D. Bond and K. S. McKinley. Continuous path and edge profiling. In Proc. 38th annual IEEE/ACM International Symposium on Microarchitecture, pages 130--140. IEEE Computer Society, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. M. D. Bond and K. S. McKinley. Practical path profiling for dynamic optimizers. In CGO, pages 205--216. IEEE Computer Society, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. M. D. Bond and K. S. McKinley. Probabilistic calling context. SIGPLAN Not. (proceedings of the 2007 OOPSLA conference), 42 (10): 97--112, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. D. C. D'Elia, C. Demetrescu, and I. Finocchi. Mining hot calling contexts in small space. In M. W. Hall and D. A. Padua, editors, PLDI, pages 516--527. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. N. Froyd, J. Mellor-Crummey, and R. Fowler. Low-overhead call path profiling of unmodified, optimized code. In Proc. 19th Annual International Conf. on Supercomputing, pages 81--90. ACM, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. S. L. Graham, P. B. Kessler, and M. K. McKusick. gprof: a call graph execution profiler (with retrospective). In K. S. McKinley, editor, Best of PLDI, pages 49--57. ACM, 1982.Google ScholarGoogle Scholar
  16. R. J. Hall. Call path refinement profiles. IEEE Trans. Softw. Eng., 21 (6): 481--496, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. R. J. Hall and A. J. Goldberg. Call path profiling of monotonic program resources in UNIX. In Proc. Summer 1993 USENIX Technical Conference, pages 1--19. USENIX Association, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. M. Hirzel and T. Chilimbi. Bursty tracing: A framework for low-overhead temporal profiling. In Proc. 4th ACM Workshop on Feedback-Directed and Dynamic Optimization, 2001.Google ScholarGoogle Scholar
  19. R. Joshi, M. D. Bond, and C. Zilles. Targeted path profiling: Lower overhead path profiling for staged dynamic optimization systems. In CGO, pages 239--250, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Z. Lai, S.-C. Cheung, and W. K. Chan. Inter-context control-flow and data-flow test adequacy criteria for nesc applications. In M. J. Harrold and G. C. Murphy, editors, SIGSOFT FSE, pages 94--104. ACM, 2008. ISBN 978--1--59593--995--1. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. J. R. Larus. Whole program paths. SIGPLAN Not., 34 (5): 259--269, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. D. Melski and T. W. Reps. Interprocedural path profiling. In S. Jahnichen, editor, phCC, volume 1575 of Lecture Notes in Computer Science, pages 47--62. Springer, 1999. ISBN 3--540--65717--7. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. C. Ponder and R. J. Fateman. Inaccuracies in program profilers. Softw., Pract. Exper., 18 (5): 459--467, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. S. P. Reiss and M. Renieris. Encoding program executions. In Proceedings of the 23rd International Conference on Software Engineering, ICSE '01, pages 221--230, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. T. W. Reps, T. Ball, M. Das, and J. R. Larus. The use of program profiling for software maintenance with applications to the year 2000 problem. In M. Jazayeri and H. Schauer, editors, ESEC / SIGSOFT FSE, volume 1301 of phLecture Notes in Computer Science, pages 432--449. Springer, 1997. ISBN 3--540--63531--9. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. S. Roy and Y. N. Srikant. Profiling k-iteration paths: A generalization of the ball-larus profiling algorithm. In CGO, pages 70--80, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. A. Sarimbekov, A. Sewe, W. Binder, P. Moret, and M. Mezini. Jp2: Call-site aware calling context profiling for the java virtual machine. Science of Computer Programming, 2012. ISSN 0167--6423. 10.1016/j.scico.2011.11.003.Google ScholarGoogle Scholar
  28. J. M. Spivey. Fast, accurate call graph profiling. Softw., Pract. Exper., 34 (3): 249--264, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. W. N. Sumner, Y. Zheng, D. Weeratunge, and X. Zhang. Precise calling context encoding. In J. Kramer, J. Bishop, P. T. Devanbu, and S. Uchitel, editors, ICSE, pages 525--534. ACM, 2010. ISBN 978--1--60558--719--6. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. K. Vaswani, A. V. Nori, and T. M. Chilimbi. Preferential path profiling: compactly numbering interesting paths. In POPL, pages 351--362. ACM, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. J. Weidendorfer, M. Kowarschik, and C. Trinitis. A tool suite for simulation based analysis of memory access behavior. In phInternational Conference on Computational Science, volume 3038 of LNCS, pages 440--447, 2004.Google ScholarGoogle Scholar
  32. J. Whaley. A portable sampling-based profiler for Java virtual machines. In Proceedings of the ACM 2000 Conference on Java Grande, pages 78--87. ACM Press, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. M. R. Woodward, D. Hedley, and M. A. Hennell. Experience with path analysis and testing of programs. IEEE Trans. Software Eng., 6 (3): 278--286, 1980. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. X. Zhang, S. Tallam, and R. Gupta. Dynamic slicing long running programs through execution fast forwarding. In M. Young and P. T. Devanbu, editors, SIGSOFT FSE, pages 81--91. ACM, 2006. ISBN 1--59593--468--5. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. X. Zhuang, M. J. Serrano, H. W. Cain, and J.-D. Choi. Accurate, efficient, and adaptive calling context profiling. In PLDI, pages 263--271, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. k-Calling context profiling

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader
          About Cookies On This Site

          We use cookies to ensure that we give you the best experience on our website.

          Learn more

          Got it!