Font Size: a A A

Hardware-Based Profiling For JVM Programs

Posted on:2022-02-17Degree:MasterType:Thesis
Country:ChinaCandidate:Y F WangFull Text:PDF
GTID:2518306725993329Subject:Software engineering
Abstract/Summary:PDF Full Text Request
Software has been applied to all aspects of people's work and life.As the scale and complexity of software continue to grow,its own defects or environmental adaptation problems can cause the software to exhibit unexpected behaviors at runtime.Therefore,it is very important to obtain runtime information to help developers and operations analyze,locate,and repair problems.Profiling technology can dynamically obtain program execution information at runtime,and has been widely used in multiple software engineering activities including testing,debugging,security enforcement,and performance optimization.According to the way of profiling,profiling technology can be divided into three categories: instrumentation-based profiling,sampling-based profiling,and hardwarebased profiling.Compared with the disadvantages of high overhead on instrumentationbased profiling and low accuracy on sampling-based profiling,hardware-based profiling has the advantages of high accuracy,low overhead,and high versatility.In order to support profiling from hardware level,most modern CPUs are equipped with hardware trace modules,such as Intel processor trace(PT)and ARM embedded trace macrocell(ETM).These modules only need low additional overhead(usually 2%-5%)to perform continuous and efficient control flow tracing of program execution to obtain runtime information.However,so far,these modules only support C/C++ and other programs that can be directly statically compiled to generate executable files and can directly run on hardware devices.The Java language that requires virtual machine support to run is not supported yet.Based on Intel PT,we study hardware-based profiling for Java virtual machine,aiming at the problem of Intel PT's inability to decode tracing data and data loss in JVM environment.Our innovation work includes:We propose a JVM extension method for PT collaboration.On the one hand,the problem of missing key data required for decoding is solved by dynamically acquiring execution information;on the other hand,a new PT tracing data export mechanism is proposed to support the recovery of data loss.We propose a method for generating execution-flow graphs that combine dynamic and static analysis.Firstly,use dynamic information to decode the tracing data;secondly,through the static analysis of the target bytecode program,match the decoded data to the static method,and generate execution-flow graph based on the control-flow graph;finally,use heuristic search for data recovery and update execution-flow graph.Based on the above methods,we implemented the prototype tool JPortal,which uses PT to profile the runtime of JVM applications.We selected Da Capo as the experimental object,designed and carried out the experiment.Experimental results show that the runtime overhead of JPortal is 2%-17%,and for most test projects,the accuracy of the generated execution-flow graph reaches 70%.
Keywords/Search Tags:Profiling, Hardware-based profiling, Hardware tracing, Intel processor trace, Java virtual machine
PDF Full Text Request
Related items