We present an efficient and expressive tool for the instrumentation of Java programs at the bytecode-level. BISM (Bytecode-Level Instrumentation for Software Monitoring) is a light-weight Java bytecode instrumentation tool that features an expressive high-level control-flow-aware instrumentation language. The language is inspired by the aspect-oriented programming paradigm in modularizing instrumentation into separate transformers, that encapsulate joinpoint selection and advice inlining. BISM allows capturing joinpoints ranging from bytecode instructions to methods execution and provides comprehensive static and dynamic context information. It runs in two instrumentation modes: build-time and load-time. BISM also provides a mechanism to compose transformers and automatically detect their collision in the base program. Transformers in a composition can control the visibility of their advice and other instructions from the base program. We show several example applications for BISM and demonstrate its effectiveness using three experiments: a security scenario, a financial transaction system, and a general runtime verification case. The results show that BISM instrumentation incurs low runtime and memory overheads.
翻译:我们在字节码一级为爪哇方案仪器提供一种高效和直观的工具。 BISM(软件监测的中间码级仪器)是一种轻量的 Java 字节仪表工具,具有高控制-流感仪表语言的外观性。该语言的灵感来自将仪器模块化成单独的变压器的面向方方面面的编程模式,该变压器将联合点的选择和建议嵌入内衬。 书目表允许捕捉从字节码指令到方法执行的连接点,并提供全面的静态和动态背景信息。它以两种仪器模式运行:建设时间和负荷时间。书目表还提供一种机制,用于配置变压器,并自动检测其在基础程序内的碰撞情况。组成中的变压器可以控制其建议和其他指示的可见度。我们为BISM展示了几个应用实例,并用三个实验来证明其有效性:一种安全情景、一种金融交易系统以及一个一般运行时间核查案例。结果显示,书状号仪表的运行时间和记忆管理发生频率都很低。