一句话:提出 Whamm:面向 WebAssembly 的可编程插桩框架,结合引擎级探测与字节码重写回退,降低工具碎片化与插桩开销。
WebAssembly 调试与监控工具碎片化:动态分析依赖源码/IR 注入、字节码重写、VM API 或硬件支持,技能重复且特性支持不一致;通用框架开销大,定制低层高性能机制繁琐。Whamm 是面向 Wasm 的插桩框架,提供声明式匹配规则、静态/动态谓词、自动状态报告和用户库,并以引擎级探测为主、字节码重写为回退保证可移植性。其引擎 API 可将插桩作为 Wasm 代码交给引擎,复用优化并支持 intrinsification;匹配规则中显式请求程序状态而非反射,使引擎能高效打包参数甚至内联探测逻辑。案例研究显示 Whamm 表达力强、功能强大且高效。
Debugging and monitoring programs are integral to engineering and deploying software. Dynamic analyses monitor applications through source code or IR injection, machine code or bytecode rewriting, virtual machine APIs, or direct hardware support. While these techniques are viable within their respective domains, common tooling across techniques is rare, leading to fragmentation of skills, duplicated efforts, and inconsistent feature support. We address this problem in the WebAssembly ecosystem with Whamm, an instrumentation framework for Wasm that uses engine-level probing and has a bytecode rewriting fallback to promote portability. Whamm solves three problems: 1) tooling fragmentation, 2) prohibitive instrumentation overhead of general-purpose frameworks, and 3) tedium of tailoring low-level high-performance mechanisms. Whamm provides fully- programmable instrumentation with declarative match rules, static and dynamic predication, automatic state reporting, and user library support, achieving high performance through compiler and engine optimizations. The Whamm engine API allows instrumentation to be provided to a Wasm engine as Wasm code, reusing existing engine optimizations and unlocking new ones, most notably intrinsification, to minimize overhead. A key insight of our work is that explicitly requesting program state in match rules, rather than reflection, enables the engine to efficiently bundle arguments and even inline compiled probe logic. Whamm streamlines the tooling effort, as its bytecode-rewriting target can run instrumented programs everywhere, lowering fragmentation and advancing the state of the art for engine support. We evaluate Whamm with case studies of non-trivial monitors and show it is expressive, powerful, and efficient.
@article{paperbot2904,
title = {Debugging WebAssembly? Put Some Whamm on It!},
author = {Elizabeth Gilbert and Matthew Schneider and Zixi An and Suhas Thalanki and Wavid Bowman and Alexander Y. Bai and Ben L. Titzer and Heather Miller},
journal = {Proceedings of the ACM on Programming Languages},
volume = {9},
number = {OOPSLA2},
year = {2025},
doi = {10.1145/3763124}
}