Question

I am planing to develop a profiler by using the JVMTI API provided by Oracle. For a visualization I would like to implement a GUI (Qt framework) on top of the agent code. My first jvmti agent is aready compiling and running and I started to integrate the agent into my Qt project.

Now I am facing the problem how to couple agent with GUI. Should the GUI be launched inside the agent? For instance in the Agent_OnLoad function?

A long-term would be to start the profiling out of the GUI, though I cannot imagine how to realize that.

Was it helpful?

Solution

Well.. you have a number of choices the most obvious would be socket based comms. You'll have to assume that the majority of profiling use cases will involve a remote headless JVM on a server. In my profiler you can operate headless with a small start/stop/control utility on the same machine as the agent, data is collected on the server and transfered to the client for visualisation. You can also start the remote (or local) jvm with the agent and connect to the listening agent over a socket from the full GUI.. collecting over that socket to the client.

There is also the new "JVM Attach API" which allows you to "insert" an agent into an already running JVM, therefore if the target machine is UNI* then you could use ssh/scp from your GUI and script an sCP transfer of the agent to the server and SSH to initiate the attach.

So... sockets (IP and/or domain) and reuse that code from the GUI for a headless control/collection client

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top