Beneath the bytecode: observing the JVM at work using bytecode instrumentation

L. Bulej, Y. Zheng, Walter Binder
{"title":"Beneath the bytecode: observing the JVM at work using bytecode instrumentation","authors":"L. Bulej, Y. Zheng, Walter Binder","doi":"10.1145/3012408.3012409","DOIUrl":null,"url":null,"abstract":"Many dynamic program analysis (DPA) tools for profiling, debugging, and monitoring programs executing on managed platforms such as the Java Virtual Machine (JVM) rely on bytecode instrumentation (sometimes combined with agents utilizing the JVM Tool Interface and native code libraries) to observe the base program behavior. While this is both the recommended and preferred technique for implementing DPA tools, it has certain noticeable drawbacks [1]. One, the analysis runs in the same process as the base program, and often shares the Java Class Library (JCL) and other resources with the base program. This creates potential for interference that may result in deadlocks, or state corruption in code that does not expect reentrancy. Two, certain parts of the JCL are typically off-limits for instrumentation, because they either play a vital role during the JVM bootstrap, or the JVM implementation makes certain assumptions about properties of specific classes, or both. These two issues are typically solved by reducing the scope of the instrumentation, leading to under-approximation of the program's behavior. And three, bytecode instrumentation only allows observing base program events at the bytecode level. The instrumentation code remains oblivious to optimizations performed by the dynamic compiler, and conversely, the compiler is completely unaware of the presence of the instrumentation code. Because the instrumentation code may significantly inflate the base program code and create additional data dependencies as a result of observing the program's behavior, various optimizations performed by the dynamic compiler (e.g., inlining, partial escape analysis, code motion) will be perturbed by the presence of the instrumentation code. As a result, the dynamic analysis may observe events that would not have happened in the base program had it been left alone, thus over-approximating the actual behavior. In this talk, we will discuss some of the challenges in making the JVM more observable for instrumentation-based DPA tools, with specific focus on getting accurate profiling information in presence of an optimizing dynamic compiler. The core of this talk is based on the work that was originally presented at OOPSLA'15 [4]. In the meantime, the work has been integrated into the Graal project. Additional parts are based on joint work with other authors, originally presented at AOSD'12 [3] and GPCE'13 [2].","PeriodicalId":186136,"journal":{"name":"Proceedings of the 11th Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems","volume":"36 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2016-07-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 11th Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3012408.3012409","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Many dynamic program analysis (DPA) tools for profiling, debugging, and monitoring programs executing on managed platforms such as the Java Virtual Machine (JVM) rely on bytecode instrumentation (sometimes combined with agents utilizing the JVM Tool Interface and native code libraries) to observe the base program behavior. While this is both the recommended and preferred technique for implementing DPA tools, it has certain noticeable drawbacks [1]. One, the analysis runs in the same process as the base program, and often shares the Java Class Library (JCL) and other resources with the base program. This creates potential for interference that may result in deadlocks, or state corruption in code that does not expect reentrancy. Two, certain parts of the JCL are typically off-limits for instrumentation, because they either play a vital role during the JVM bootstrap, or the JVM implementation makes certain assumptions about properties of specific classes, or both. These two issues are typically solved by reducing the scope of the instrumentation, leading to under-approximation of the program's behavior. And three, bytecode instrumentation only allows observing base program events at the bytecode level. The instrumentation code remains oblivious to optimizations performed by the dynamic compiler, and conversely, the compiler is completely unaware of the presence of the instrumentation code. Because the instrumentation code may significantly inflate the base program code and create additional data dependencies as a result of observing the program's behavior, various optimizations performed by the dynamic compiler (e.g., inlining, partial escape analysis, code motion) will be perturbed by the presence of the instrumentation code. As a result, the dynamic analysis may observe events that would not have happened in the base program had it been left alone, thus over-approximating the actual behavior. In this talk, we will discuss some of the challenges in making the JVM more observable for instrumentation-based DPA tools, with specific focus on getting accurate profiling information in presence of an optimizing dynamic compiler. The core of this talk is based on the work that was originally presented at OOPSLA'15 [4]. In the meantime, the work has been integrated into the Graal project. Additional parts are based on joint work with other authors, originally presented at AOSD'12 [3] and GPCE'13 [2].
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
在字节码下面:使用字节码检测观察JVM的工作情况
许多用于分析、调试和监视在托管平台(如Java虚拟机(JVM))上执行的程序的动态程序分析(DPA)工具依赖于字节码插装(有时与利用JVM工具接口和本机代码库的代理结合使用)来观察基本程序行为。虽然这是实现DPA工具的推荐和首选技术,但它有某些明显的缺点[1]。第一,分析在与基程序相同的进程中运行,并且经常与基程序共享Java类库(JCL)和其他资源。这就产生了可能导致死锁的潜在干扰,或者不期望可重入的代码中的状态损坏。第二,JCL的某些部分通常不允许插装,因为它们要么在JVM引导过程中发挥重要作用,要么JVM实现对特定类的属性做出某些假设,或者两者兼而有之。这两个问题通常是通过减小插装的范围来解决的,这会导致对程序行为的近似不足。第三,字节码检测只允许在字节码级别观察基本程序事件。插装代码对动态编译器执行的优化保持不知情,相反,编译器完全不知道插装代码的存在。由于检测代码可能会显著地扩展基本程序代码,并在观察程序的行为时创建额外的数据依赖关系,因此动态编译器执行的各种优化(例如,内联、部分转义分析、代码移动)将被检测代码的存在所干扰。因此,动态分析可能会观察到在基本程序中不可能发生的事件,从而过度接近实际行为。在本次演讲中,我们将讨论使基于仪表的DPA工具的JVM更具可观察性的一些挑战,并特别关注在优化动态编译器的情况下获得准确的分析信息。这次演讲的核心是基于最初在OOPSLA'15[4]上提出的工作。与此同时,这项工作已被集成到Graal项目中。其他部分基于与其他作者的联合工作,最初在AOSD'12[3]和GPCE'13[2]上发表。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
The performance of object encodings in JavaScript Efficient profiling of actor-based applications in parallel and distributed systems Trufflereloader: a low-overhead language-neutral reloader Demo of docking: enabling language based dynamic coupling Growing an abstract grammar: teaching language engineering
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1