skip to main content
10.1145/3453483.3454096acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article
Public Access

JPortal: precise and efficient control-flow tracing for JVM programs with Intel processor trace

Published: 18 June 2021 Publication History

Abstract

Hardware tracing modules such as Intel Processor Trace perform continuous control-flow tracing of an end-to-end program execution with an ultra-low overhead. PT has been used in a variety of contexts to support applications such as testing, debugging, and performance diagnosis. However, these hardware modules have so far been used only to trace native programs, which are directly compiled down to machine code. As high-level languages (HLL) such as Java and Go become increasingly popular, there is a pressing need to extend these benefits to the HLL community. This paper presents JPortal, a JVM-based profiling tool that bridges the gap between HLL applications and low-level hardware traces by using a set of algorithms to precisely recover an HLL program’s control flow from PT traces. An evaluation of JPortal with the DaCapo benchmark shows that JPortal achieves an overall 80% accuracy for end-to-end control flow profiling with only a 4-16% runtime overhead.

References

[1]
[n.d.]. ASM: an open-source Java bytecode manipulation and analysis framework. https://asm.ow2.io/ Accessed: 2020-10-31.
[2]
[n.d.]. DiSL: an open-source Java bytecode instrumentation framework. https://disl.ow2.org/view/Main/ Accessed: 2020-10-31.
[3]
[n.d.]. DynamoRIO: a runtime code manipulation system. https://dynamorio.org/ Accessed: 2020-10-31.
[4]
[n.d.]. Dyninst: tools for binary instrumentation, analysis, and modification. https://dyninst.org/ Accessed: 2020-10-31.
[5]
[n.d.]. Honggfuzz: a feedback-driven security oriented software fuzzer. http://honggfuzz.com Accessed: 2020-10-31.
[6]
[n.d.]. hprof: an open source java profiler. http://java.sun.com/developer/technicalArticles/Programming/HPROF.html Accessed: 2020-10-31.
[7]
[n.d.]. Intel® VTune™ Profiler: a commercial application for software performance analysis. https://software.intel.com/content/www/us/en/develop/tools/vtune-profiler.html Accessed: 2020-10-31.
[8]
[n.d.]. JProfiler: a commercial java profiler. https://www.ej-technologies.com/products/jprofiler/overview.html Accessed: 2020.
[9]
[n.d.]. libipt: an Intel(R) Processor Trace decoder library. https://github.com/intel/libipt Accessed: 2020-10-31.
[10]
[n.d.]. LLVM: a compiler infrastructure. https://llvm.org/ 2021.
[11]
[n.d.]. perf: a performance analyzing tool in Linux. https://github.com/torvalds/linux/tree/master/tools/perf Accessed: 2020-10-31.
[12]
[n.d.]. Pin: a dynamic binary instrumentation framework. http://www.intel.com/software/pintool Accessed: 2020-10-31.
[13]
[n.d.]. ptm2human: a decoder for trace data outputted by Embedded Trace Macrocell (ETMv4). https://github.com/hwangcc23/ptm2human Accessed: 2020-10-31.
[14]
[n.d.]. Soot: an open-source Java compiler infrastructure. https://github.com/soot-oss/soot Accessed: 2020-10-31.
[15]
[n.d.]. Valgrind: an instrumentation framework for building dynamic analysis tools. https://valgrind.org/ Accessed: 2020-10-31.
[16]
[n.d.]. xprof: the internal profiler for hotspot. http://java.sun.com/docs/books/performance/1st edition/html/JPAppHotspot.fm.html Accessed: 2020-10-31.
[17]
[n.d.]. YourKit: a commercial java profiler. https://www.yourkit.com/ Accessed: 2020-10-31.
[18]
2019. Arm® Embedded Trace Macrocell Architecture Specification ETMv4.0 to ETMv4.5.
[19]
2019. Intel® 64 and IA-32 Architectures Software Developer’s Manual Volume 3 (3A, 3B, 3C & 3D): System Programming Guide.
[20]
Glenn Ammons, Thomas Ball, and James R. Larus. 1997. Exploiting Hardware Performance Counters with Flow and Context Sensitive Profiling. In Proceedings of the ACM SIGPLAN 1997 Conference on Programming Language Design and Implementation (PLDI ’97). 85–96. isbn:0897919076 https://doi.org/10.1145/258915.258924
[21]
Matthew Arnold and Barbara G. Ryder. 2001. A Framework for Reducing the Cost of Instrumented Code. In Proceedings of the ACM SIGPLAN 2001 Conference on Programming Language Design and Implementation (PLDI ’01). 168–179. isbn:1581134142 https://doi.org/10.1145/378795.378832
[22]
Joy Arulraj, Po-Chun Chang, Guoliang Jin, and Shan Lu. 2013. Production-Run Software Failure Diagnosis via Hardware Performance Counters. In Proceedings of the Eighteenth International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS ’13). 101–112. isbn:9781450318709 https://doi.org/10.1145/2451116.2451128
[23]
Joy Arulraj, Guoliang Jin, and Shan Lu. 2014. Leveraging the Short-Term Memory of Hardware to Diagnose Production-Run Software Failures. In Proceedings of the 19th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS ’14). 207–222. isbn:9781450323055 https://doi.org/10.1145/2541940.2541973
[24]
Thomas Ball and James R. Larus. 1994. Optimally Profiling and Tracing Programs. ACM Trans. Program. Lang. Syst., 16, 4 (1994), July, 1319–1360. issn:0164-0925 https://doi.org/10.1145/183432.183527
[25]
Thomas Ball and James R. Larus. 1996. Efficient Path Profiling. In Proceedings of the 29th Annual ACM/IEEE International Symposium on Microarchitecture (MICRO 29). 46–57. isbn:0818676418
[26]
S. M. Blackburn, R. Garner, C. Hoffman, A. M. Khan, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. Hosking, M. Jump, H. Lee, J. E. B. Moss, A. Phansalkar, D. Stefanović, T. VanDrunen, D. von Dincklage, and B. Wiedermann. 2006. The DaCapo Benchmarks: Java Benchmarking Development and Analysis. In OOPSLA ’06: Proceedings of the 21st annual ACM SIGPLAN conference on Object-Oriented Programing, Systems, Languages, and Applications. 169–190. https://doi.org/10.1145/1167473.1167488
[27]
Cheng Cai, Qirun Zhang, Zhiqiang Zuo, Khanh Nguyen, Guoqing Xu, and Zhendong Su. 2018. Calling-to-Reference Context Translation via Constraint-Guided CFL-Reachability. In Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2018). 196–210. isbn:9781450356985 https://doi.org/10.1145/3192366.3192378
[28]
Yaohui Chen, Dongliang Mu, Jun Xu, Zhichuang Sun, Wenbo Shen, Xinyu Xing, Long Lu, and Bing Mao. 2019. PTrix: Efficient Hardware-Assisted Fuzzing for COTS Binary. In Proceedings of the 2019 ACM Asia Conference on Computer and Communications Security (Asia CCS ’19). 633–645. isbn:9781450367523 https://doi.org/10.1145/3321705.3329828
[29]
Edmund Clarke, Orna Grumberg, Somesh Jha, Yuan Lu, and Helmut Veith. 2003. Counterexample-Guided Abstraction Refinement for Symbolic Model Checking. J. ACM, 50, 5 (2003), Sept., 752–794. issn:0004-5411 https://doi.org/10.1145/876638.876643
[30]
Weidong Cui, Xinyang Ge, Baris Kasikci, Ben Niu, Upamanyu Sharma, Ruoyu Wang, and Insu Yun. 2018. REPT: Reverse Debugging of Failures in Deployed Software. In Proceedings of the 13th USENIX Conference on Operating Systems Design and Implementation (OSDI’18). 17–32. isbn:9781931971478
[31]
Cormac Flanagan and Stephen N. Freund. 2010. The RoadRunner Dynamic Analysis Framework for Concurrent Programs. In Proceedings of the 9th ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering (PASTE ’10). 1–8. isbn:9781450300827 https://doi.org/10.1145/1806672.1806674
[32]
Xinyang Ge, Weidong Cui, and Trent Jaeger. 2017. GRIFFIN: Guarding Control Flows Using Intel Processor Trace. In Proceedings of the Twenty-Second International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS ’17). 585–598. isbn:9781450344654 https://doi.org/10.1145/3037697.3037716
[33]
Xinyang Ge, Ben Niu, and Weidong Cui. 2020. Reverse Debugging of Kernel Failures in Deployed Systems. In 2020 USENIX Annual Technical Conference, USENIX ATC 2020, July 15-17, 2020, Ada Gavrilovska and Erez Zadok (Eds.). 281–292. https://www.usenix.org/conference/atc20/presentation/ge
[34]
Baris Kasikci, Weidong Cui, Xinyang Ge, and Ben Niu. 2017. Lazy Diagnosis of In-Production Concurrency Bugs. In Proceedings of the 26th Symposium on Operating Systems Principles (SOSP ’17). 582–598. isbn:9781450350853 https://doi.org/10.1145/3132747.3132767
[35]
James R. Larus. 1999. Whole Program Paths. In Proceedings of the ACM SIGPLAN 1999 Conference on Programming Language Design and Implementation (PLDI ’99). 259–269. isbn:1581130945 https://doi.org/10.1145/301618.301678
[36]
Jeremy Lau, Matthew Arnold, Michael Hind, and Brad Calder. 2006. Online Performance Auditing: Using Hot Optimizations without Getting Burned. In Proceedings of the 27th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’06). 239–251. isbn:1595933204 https://doi.org/10.1145/1133981.1134010
[37]
Han Bok Lee and Benjamin G. Zorn. 1997. BIT: A Tool for Instrumenting Java Bytecodes. In USENIX Symposium on Internet Technologies and Systems (USITS 97). https://www.usenix.org/conference/usits-97/bit-tool-instrumenting-java-bytecodes
[38]
Daniel Lehmann and Michael Pradel. 2019. Wasabi: A Framework for Dynamically Analyzing WebAssembly. In Proceedings of the Twenty-Fourth International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS ’19). 1045–1058. isbn:9781450362405 https://doi.org/10.1145/3297858.3304068
[39]
Y. Liu, P. Shi, X. Wang, H. Chen, B. Zang, and H. Guan. 2017. Transparent and Efficient CFI Enforcement with Intel Processor Trace. In 2017 IEEE International Symposium on High Performance Computer Architecture (HPCA). 529–540. https://doi.org/10.1109/HPCA.2017.18
[40]
Chi-Keung Luk, Robert Cohn, Robert Muth, Harish Patil, Artur Klauser, Geoff Lowney, Steven Wallace, Vijay Janapa Reddi, and Kim Hazelwood. 2005. Pin: Building Customized Program Analysis Tools with Dynamic Instrumentation. In Proceedings of the 2005 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’05). 190–200. isbn:1595930566 https://doi.org/10.1145/1065010.1065034
[41]
Lukáš Marek, Alex Villazón, Yudi Zheng, Danilo Ansaloni, Walter Binder, and Zhengwei Qi. 2012. DiSL: A Domain-Specific Language for Bytecode Instrumentation. In Proceedings of the 11th Annual International Conference on Aspect-Oriented Software Development (AOSD ’12). 239–250. isbn:9781450310925 https://doi.org/10.1145/2162049.2162077
[42]
Todd Mytkowicz, Amer Diwan, Matthias Hauswirth, and Peter F. Sweeney. 2010. Evaluating the Accuracy of Java Profilers. In Proceedings of the 31st ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’10). 187–197. isbn:9781450300193 https://doi.org/10.1145/1806596.1806618
[43]
Khanh Nguyen and Guoqing Xu. 2013. Cachetor: Detecting Cacheable Data to Remove Bloat. In Proceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering (ESEC/FSE 2013). 268–278. isbn:9781450322379 https://doi.org/10.1145/2491411.2491416
[44]
Z. Ning and F. Zhang. 2019. Hardware-Assisted Transparent Tracing and Debugging on ARM. IEEE Transactions on Information Forensics and Security, 14, 6 (2019), 1595–1609. https://doi.org/10.1109/TIFS.2018.2883027
[45]
Peter Ohmann, Alexander Brooks, Loris D’Antoni, and Ben Liblit. 2017. Control-flow recovery from partial failure reports. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2017, Barcelona, Spain, June 18-23, 2017, Albert Cohen and Martin T. Vechev (Eds.). 390–405. https://doi.org/10.1145/3062341.3062368
[46]
Tao B. Schardl, Tyler Denniston, Damon Doucet, Bradley C. Kuszmaul, I-Ting Angelina Lee, and Charles E. Leiserson. 2017. The CSI Framework for Compiler-Inserted Program Instrumentation. Proc. ACM Meas. Anal. Comput. Syst., 1, 2 (2017), Article 43, Dec., 25 pages. https://doi.org/10.1145/3154502
[47]
Sergej Schumilo, Cornelius Aschermann, Robert Gawlik, Sebastian Schinzel, and Thorsten Holz. 2017. kAFL: Hardware-Assisted Feedback Fuzzing for OS Kernels. In 26th USENIX Security Symposium (USENIX Security 17). 167–182. isbn:978-1-931971-40-9 https://www.usenix.org/conference/usenixsecurity17/technical-sessions/presentation/schumilo
[48]
Koushik Sen, Swaroop Kalasapur, Tasneem Brutch, and Simon Gibbs. 2013. Jalangi: A Selective Record-Replay and Dynamic Analysis Framework for JavaScript. In Proceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering (ESEC/FSE 2013). 488–498. isbn:9781450322379 https://doi.org/10.1145/2491411.2491447
[49]
Ajeet Shankar, Matthew Arnold, and Rastislav Bodik. 2008. Jolt: Lightweight Dynamic Analysis and Removal of Object Churn. In Proceedings of the 23rd ACM SIGPLAN Conference on Object-Oriented Programming Systems Languages and Applications (OOPSLA ’08). 127–142. isbn:9781605582153 https://doi.org/10.1145/1449764.1449775
[50]
Suchakra Sharma. 2015. Hardware Tracing for Fast and Precise Performance Analysis. The New Stack, 10.
[51]
S. D. Sharma and M. Dagenais. 2016. Hardware-assisted instruction profiling and latency detection. The Journal of Engineering, 2016, 10 (2016), 367–376. https://doi.org/10.1049/joe.2016.0127
[52]
Chukri Soueidi, Ali Kassem, and Yliès Falcone. 2020. BISM: Bytecode-Level Instrumentation for Software Monitoring. In Runtime Verification, Jyotirmoy Deshmukh and Dejan Ničković (Eds.). 323–335. isbn:978-3-030-60508-7
[53]
Neal Stollon. 2011. ARM ETM. Springer US, Boston, MA. 213–218. isbn:978-1-4419-7563-8 https://doi.org/10.1007/978-1-4419-7563-8_13
[54]
The same crashes encountered as reported by the following issues when running certain subjects on OpenJDK 12. 2020. https://github.com/dacapobench/dacapobench/issues/175;
[55]
Xiayang Wang, Fuqian Huang, and Haibo Chen. 2019. DTrace: fine-grained and efficient data integrity checking with hardware instruction tracing. Cybersecur., 2, 1 (2019), 1. https://doi.org/10.1186/s42400-018-0018-3
[56]
Mario Wolczko and Cansu Kaynak. 2017. Processor Tracing for Virtual Machines. In The Workshop on Modern Language Runtimes, Ecosystems, and VMs (MoreVMs).
[57]
Guoqing Xu. 2012. Finding Reusable Data Structures. In Proceedings of the ACM International Conference on Object Oriented Programming Systems Languages and Applications (OOPSLA ’12). 1017–1034. isbn:9781450315616 https://doi.org/10.1145/2384616.2384690
[58]
Guoqing Xu, Matthew Arnold, Nick Mitchell, Atanas Rountev, and Gary Sevitsky. 2009. Go with the Flow: Profiling Copies to Find Runtime Bloat. In Proceedings of the 30th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’09). 419–430. isbn:9781605583921 https://doi.org/10.1145/1542476.1542523
[59]
Guoqing Xu, Nick Mitchell, Matthew Arnold, Atanas Rountev, Edith Schonberg, and Gary Sevitsky. 2010. Finding Low-Utility Data Structures. In Proceedings of the 31st ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’10). 174–186. isbn:9781450300193 https://doi.org/10.1145/1806596.1806617
[60]
Hao Xu, Qingsen Wang, Shuang Song, Lizy Kurian John, and Xu Liu. 2019. Can We Trust Profiling Results? Understanding and Fixing the Inaccuracy in Modern Profilers. In Proceedings of the ACM International Conference on Supercomputing (ICS ’19). 284–295. isbn:9781450360791 https://doi.org/10.1145/3330345.3330371
[61]
Yibiao Yang, Yanyan Jiang, Zhiqiang Zuo, Yang Wang, Hao Sun, Hongmin Lu, Yuming Zhou, and Baowen Xu. 2019. Automatic Self-Validation for Code Coverage Profilers. In Proceedings of the 34th IEEE/ACM International Conference on Automated Software Engineering (ASE ’19). 79–90. isbn:9781728125084 https://doi.org/10.1109/ASE.2019.00018
[62]
Yibiao Yang, Yuming Zhou, Hao Sun, Zhendong Su, Zhiqiang Zuo, Lei Xu, and Baowen Xu. 2019. Hunting for Bugs in Code Coverage Tools via Randomized Differential Testing. In Proceedings of the 41st International Conference on Software Engineering (ICSE ’19). 488–499. https://doi.org/10.1109/ICSE.2019.00061
[63]
G. Zhang, X. Zhou, Y. Luo, X. Wu, and E. Min. 2018. PTfuzz: Guided Fuzzing With Processor Trace Feedback. IEEE Access, 6 (2018), 37302–37313. https://doi.org/10.1109/ACCESS.2018.2851237
[64]
Zhiqiang Zuo, Lu Fang, Siau-Cheng Khoo, Guoqing Xu, and Shan Lu. 2016. Low-Overhead and Fully Automated Statistical Debugging with Abstraction Refinement. In Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2016). 881–896. isbn:9781450344449 https://doi.org/10.1145/2983990.2984005
[65]
Zhiqiang Zuo, Siau-Cheng Khoo, and Chengnian Sun. 2014. Efficient Predicated Bug Signature Mining via Hierarchical Instrumentation. In Proceedings of the 2014 International Symposium on Software Testing and Analysis (ISSTA 2014). 215–224. isbn:9781450326452 https://doi.org/10.1145/2610384.2610400

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
PLDI 2021: Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation
June 2021
1341 pages
ISBN:9781450383912
DOI:10.1145/3453483
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 18 June 2021

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Intel PT
  2. JVM
  3. control-flow tracing

Qualifiers

  • Research-article

Funding Sources

Conference

PLDI '21
Sponsor:

Acceptance Rates

Overall Acceptance Rate 406 of 2,067 submissions, 20%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)224
  • Downloads (Last 6 weeks)27
Reflects downloads up to 06 Nov 2024

Other Metrics

Citations

Cited By

View all

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media