Opening The Data File

When your application exists, the profiler agent will write its data to disk. The filename of the data file is written to the console. Look for a message that looks like the following:

      Writing data to 1033924407.mjp
    

You will find this file in the working directory of the JVM. This is most often either the directory you invoked the JVM or the directory you specified in the Run dialog. The file name is based on the current time in seconds and thus when sorted in ascending order the most recent file will be at the bottom.

To open the file:

  1. Start the MJP GUI if isn't already started. On Windows, this can be done by executing mjp.exe or by double clicking on %MJP_HOME%/lib/mjpgui.jar in Windows Explorer. On Linux, this can be done by executing mjp.

  2. Select File->Open.

  3. Use the file chooser to locate and open the data file.

Caveats

It is on the TODO list to make this process simpler. Ideally, I would like to make the opening of the data file completely automatic. One way to accomplish this is to have the profiler agent communicate to the GUI via a interproceess communication mechanism, e.g. a socket or named pipe. There are two technical hurdles to be crossed before this can be made reality.

First, a portable C++ socket API must be requisitioned. BSD sockets and Winsock are not completely compatible. Possible alternatives include ACE and GNU Common C++.

Secondly, a portable way must be found for the profiler agent to determine the proper connection properties necessary to open a communication channel with the GUI (e.g. port number) and to invoke the GUI if is not already running. On Windows, COM fullfills this requirement, but COM is not available UNIX. One possibility is CORBA, however CORBA is overly complex for MJP's simple requirements and is not generally installed by default on any operating system. A second possibility is to build a solution from scratch and port it to each operating system along with the profiling agent.