To create a probe, first create a Probekit source file (probe file)
in a Probekit project. Then, in the Probekit source file, create the probe
and add the contents that define how the probe works.
To create a Probekit source file, you must use the Probekit Source
File wizard. You can continue to use the wizard to create the probe and to
write most of the probe definition, or you can go directly to the Probekit
editor. In either case, you must use the Probekit editor to write the Java™ code
fragment for the code.
For detailed information about the parts of a probe,
see Probe definitions.
- To create the Probekit source file:
- In the Navigator or Package Explorer view, right-click the Probekit project
that you want to contain the source file, then click .
- On the Select a wizard page, expand Profiling
and Logging and select Probekit Source File.
- Click Next.
- In the Create a New Probe File wizard, type a name for the new probe source
file in the File name field. The file name extension
for Probekit source files must be .probe.
- In the Source Folder field, enter a project source
folder to contain the new Probekit source file.
Note: Probekit source files
must appear in the top level of a project source folder; they cannot be in
a subfolder.
- If you want to exit the wizard now and use the Probekit editor
to create your probe and its definition:
- Select No Content.
- Click Finish. The new Probekit source file is added
in the project source folder and, by default, automatically opens in the Probekit
editor.
- Continue with step 4.
- If you want to continue to use the wizard to assist you in creating
the probe definition:
- Select Method Probe or Callsite Probe.
- Select the Fragment Type value for the fragment
that you want the wizard to create.
- Click Next.
- Define as much of the content for the probe as you want using Add and Edit.
When you add or select an item, the wizard displays a description of it.
Note: If
you go back and change the type of probe being created or the fragment type
to be inserted, the editor will prompt you to discard any items that no longer
apply.
- Click Finish. The new Probekit source file is added
in the project source folder and, by default, automatically opens in the Probekit
editor.
- Optional: On the General page
of the Probekit editor, enter a unique ID string for the probe in the ID field,
and a version number in the Version field, as well
as values for a label. This data is only for your use in identifying
the probe.
- Click the Probes tab.
- If you did not use the wizard to create the probe, click Add
Probe. The new probe is listed in the tree pane on
the left side of the page.
- Right-click the probe in the tree pane, then click . The new fragment appears in the tree pane as a child of the probe, and
the property fields for the fragment are displayed in the edit
pane on the right side of the page.
- In the edit pane, select a Fragment Type value,
then type your Java code for the probe fragment. For specific
information, see Probe fragment types.
- Continue defining your probe by right-clicking items in the tree,
using the pop-up menu to add child items, and typing values for the new items
in the edit pane. The pop-up menu lists only the items that are
valid for the location that is selected in the tree. If the item is valid
but can no longer be added in the selected location, the item is disabled
in the menu.
Note: When you type a value in the Import directive property
field, type only the name of the package or class that you want to import.
Do not type the import keyword or the final semicolon (;).
- When you have finished defining your probe, click .
Note: When you save the Probekit source file, the Probekit editor checks
the syntax of all Java elements in the file and reports any javac problems.
If there is an error or warning for an entry, the corresponding icon in the
tree changes to the error or warning icon. Javac problems are displayed in
a table at the lower edge of the Probes page. Double-click an item in this
table to focus on the item for editing.