The CSI Framework for Compiler-Inserted Program Instrumentation

Author:

Schardl Tao B.1,Denniston Tyler1,Doucet Damon1,Kuszmaul Bradley C.1,Lee I-Ting Angelina2,Leiserson Charles E.1

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

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3