Affiliation:
1. Massachusetts Institute of Technology, Cambridge, MA, USA
2. Washington University in St. Louis, St. Louis, MO, USA
Abstract
The CSI framework provides comprehensive static instrumentation that a compiler can insert into a program-under-test so that dynamic-analysis tools - memory checkers, race detectors, cache simulators, performance profilers, code-coverage analyzers, etc. - can observe and investigate runtime behavior. Heretofore, tools based on compiler instrumentation would each separately modify the compiler to insert their own instrumentation. In contrast, CSI inserts a standard collection of instrumentation hooks into the program-under-test. Each CSI-tool is implemented as a library that defines relevant hooks, and the remaining hooks are "nulled" out and elided during either compile-time or link-time optimization, resulting in instrumented runtimes on par with custom instrumentation. CSI allows many compiler-based tools to be written as simple libraries without modifying the compiler, lowering the bar for the development of dynamic-analysis tools.
We have defined a standard API for CSI and modified LLVM to insert CSI hooks into the compiler's internal representation (IR) of the program. The API organizes IR objects - such as functions, basic blocks, and memory accesses - into flat and compact ID spaces, which not only simplifies the building of tools, but surprisingly enables faster maintenance of IR-object data than do traditional hash tables. CSI hooks contain a "property" parameter that allows tools to customize behavior based on static information without introducing overhead. CSI provides "forensic" tables that tools can use to associate IR objects with source-code locations and to relate IR objects to each other.
To evaluate the efficacy of CSI, we implemented six demonstration CSI-tools. One of our studies shows that compiling with CSI and linking with the "null" CSI-tool produces a tool-instrumented executable that is as fast as the original uninstrumented code. Another study, using a CSI port of Google's ThreadSanitizer, shows that the CSI-tool rivals the performance of Google's custom compiler-based implementation. All other demonstration CSI tools slow down the execution of the program-under-test by less than 70%.
Funder
National Science Foundation
Advanced Scientific Computing Research
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Networks and Communications,Hardware and Architecture,Safety, Risk, Reliability and Quality,Computer Science (miscellaneous)
Reference71 articles.
1. Apache Software Foundation. 2016. ab -- Apache HTTP server benchmarking tool. Available at https://httpd.apache.org/docs/2.4/programs/ab.html. (2016). Apache Software Foundation. 2016. ab -- Apache HTTP server benchmarking tool. Available at https://httpd.apache.org/docs/2.4/programs/ab.html. (2016).
2. A technique for finding storage allocation errors in C-language programs
3. Andrew R. Bernat and Barton P. Miller. 2011. Anywhere Any-time Binary Instrumentation. In PASTE. 9--16. 10.1145/2024569.2024572 Andrew R. Bernat and Barton P. Miller. 2011. Anywhere Any-time Binary Instrumentation. In PASTE. 9--16. 10.1145/2024569.2024572
4. Walter Binder Alex Villazón Danilo Ansaloni and Philippe Moret. 2009. @J: Towards Rapid Development of Dynamic Analysis Tools for the Java Virtual Machine. VMIL. Article 4 9 pages. 10.1145/1711506.1711510 Walter Binder Alex Villazón Danilo Ansaloni and Philippe Moret. 2009. @J: Towards Rapid Development of Dynamic Analysis Tools for the Java Virtual Machine. VMIL. Article 4 9 pages. 10.1145/1711506.1711510
Cited by
12 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Optimization-Aware Compiler-Level Event Profiling;ACM Transactions on Programming Languages and Systems;2023-06-26
2. TEA: Time-Proportional Event Analysis;Proceedings of the 50th Annual International Symposium on Computer Architecture;2023-06-17
3. Towards Solving the Challenge of Minimal Overhead Monitoring;Companion of the 2023 ACM/SPEC International Conference on Performance Engineering;2023-04-15
4. Creating concise and efficient dynamic analyses with ALDA;Proceedings of the 27th ACM International Conference on Architectural Support for Programming Languages and Operating Systems;2022-02-22
5. JPortal: precise and efficient control-flow tracing for JVM programs with Intel processor trace;Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation;2021-06-18