Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

JVMTI Profiler Hack Guide

Introduction

TPTP profiling contains two basic frameworks. One of them is Martini Framework, another one is Data Collection Framework. Martini Framework is used to get profiling data from runtime Virtual Machine (such as JVM). The collected profiling data will be sent to TPTP Client by Data Collection Framework.

Martini Framework is composed of three parts: The first part is Martini Infrastructure, which includes Profiling Kernel componet, Event Manager, Instrumentation Manager, Martini Profiling Interface, External Control Agent etc. The second part is Profilers, which currently contains several Java Profilers (Call Graph Profiler, Heap Profiler, Thread Profiler and ProbekitAgent). The third part is External Module (JPIAgent is currently implemented for Java profiling).

Data Collection Framework is composed of Data Collection Client (such as Eclipse workbench), Agent Controller and Agent(An application that exposes its services throught the agent controller). More information about Data Collection Framework, please refer Eclipse Help "Working with the Agent Controller". 

In current TPTP, Martini ACCollector is implemented as an agent of Data Collection Framework. The ACCollector interacts with Martini JPIAgent. The collected profiling data will be sent to Data Collection Client by this chain:

VM ==> Martini Framework (Martini Infrastructure => Profilers => JPIAgent) ==> DataCollection Framework (ACCollector => Agent Controller => TPTP Data Collection Client).

Martini Framework

Architecture

Martini Runtime is built on top of JVM. The JVM interface component is implemented as the interface between JVM and Martini Runtime by calling JVMTI/JVMPI. It’s responsible for data conversion and interface conversion and also provides rich functionality to inspect JVM state and control the execution of applications such as iterating heap. JVMTI event will be converted to internal event type and passed to Event Manger.

Event Manger component is responsible for dispatching event. Events can be sent from External components (EC, profilers) and internal components.

Martini Framework is instrumentation based profiling framework. It can record method enter/exit event, thread event and heap allocation event. Instead of generating event using JVMTI/JVMPI, Martini framework using bytecode instrumentation technology to generate execution, thread and heap event. Instrumentation Manger is responsible for managing the instrumentation process and it calls instrumentation adaptors to instrument bytecode with specific functionality.

Profiler Interface

The martini profiling interface is an interface for managed runtime profiling tools. It’s defined to suit a wide-range of virtual machines, such as Java. Its main goal is to allow using the same tool with different managed-runtime environments.

MPI is a declarative, event-based interface, offering a variety of well-defined events and data request operations. Some of the events may be optionally restricted to specific selective criteria, such as specific classes rather than all, reducing the overhead and the amount of data generated.

Instrumentation Engine

External Control Interface

The Martini External Control Interface is designed to allow Profiler front-ends to interact with their MPI back-end modules by sending "control" messages that will be dispatched to the MPI back-end modules as MPI events. To interact with MPI clients, a tool implements an "External Control" module which is loaded into the virtual machine process together with the MPI client it needs to control. This External Control module serves as a bridge between the tool's front-end process and the MPI client back-end and enables the front-end to send certain MPI events to the MPI client.

TPTP Java Profilers

Heap Profiler

CG Profiler

Thread Profiler


Back to TPTP wiki page

Back to the top