Dr. David J. Pearce


DJProf is an experimental Java profiling tool which employs AspectJ to insert the necessary instrumentation for profiling rather than, for example, the Java Machine Profiler Interface (JVMPI). DJProf can be used to profile Java programs without modification (i.e. there is no need to recompile them for profiling) and does not require the user to have any knowledge of AspectJ. The Load-Time Weaving capability of AspectJ is utilised to make this possible. The tool (including its source code) is release under a very straightforward (and unrestrictive) license for the benefit of all.

DJProf supports several different modes of profiling:

Details of how the profiler works can be found in our paper entitled “Profiling with AspectJ” (see below).

History. DJProf was designed as a tool for research in AspectJ and AOP. It was developed by David J. Pearce in the summer of 2004 during an internship with the AspectJ team based at IBM Hursley, UK. The work was supervised by Dr Paul H.J Kelly (Imperial College) and Dr Robert Berry (IBM). Since that time, IBM has kindly assigned the copyright of DJProf over to David and, hence, he has now made it available for all to use. The name “DJProf” comes from the author’s initials, which are DJP!

Installation. The current version of djprof should work out-of-the-box on Linux/UNIX machines, and on Windows machines with Cygwin. However, for windows without Cygwin, you currently have to create your own batch file. Installing DJProf is quite straightforward, although there is no automatic installer as yet. The first step is to download and install the latest version of AspectJ, assuming it’s not already installed on your system. Then, download and unpack the latest tarball given above. This includes the compiled Java class files, so there is no need to compile DJProf from scratch. At this point, there are three things you need to do:

  1. Add the bin/ directory (which contains the djprof) script to your PATH environment variable.
  2. Set the DJPROF_HOME environment variable to the djprof directory.
  3. Make sure that the ASPECTJ_HOME environment variable holds the location the AspectJ package (this should be done as part of the AspectJ install).

Command-Line Options.

The following command-line options are used to select DJProf’s profiling mode. At the moment, they can only be used one at a time:

DJProf also supports the following general command-line options:

Related Publication(s)