You can apply a probe statically from within the workbench. The
workbench compiles the probe automatically.
To apply a probe:
- In the Navigator or Package Explorer view, select either a Probekit
source file (probe file) or the target class or jar files for the
probe.
- Right-click, then click . The Instrument
window or the Choose Probe File window opens, depending on the type of file
you selected.
- Do one of the following:
- If you selected a probe file, select the class, jar or external jar
files to be instrumented. Note that if you select an external jar file that
is in use by the workbench, the apply action will fail; apply the probe from
the command line instead of from the workbench.
- If you selected a class or a jar file, select the probe file to apply.
- Click OK. The probe is
compiled and applied to the target files. In addition:
- For source projects, the class files for the probe are copied into the
target project's output directory.
- For binary projects, the probe class files are copied into a new directory
called _probekit.probes, and that directory is added to the project's
classpath.
In both cases, you will have to clean up your project manually when
you no longer want to collect data with this probe. For instructions, read Removing probe instrumentation for statically applied probes.
Tip: You can apply multiple probes to a project. Apply
the probes one after the other to the appropriate class and jar files.
You
can now run your project and collect data. For instructions, read Running a project with statically applied probes.