Creating a New DTrace Instrument
Create new individual instruments that are tailored to gather data from your application.
Open the Instruments analysis tool.
Select a trace template.
Choose Instrument > Build New Instrument.
Enter the individual instrument description.
Enter global variables for the instrument in the DATA section.
Enter initialization code for the instrument in the BEGIN section.
Enter the probe information.
Enter cleanup code for the instrument in the END section and click Save.
Customize instruments to your code to reduce the amount of data collected and improve the validity your testing. Create probes to gather only the information relevant to your application.
Custom instruments contain the following sections:
Instrument Description: Contains descriptive information about the instrument.
DATA declaration: Declare all global variables for custom scripts.
BEGIN script: Contains all global variable initialization and instrument startup tasks.
Probes: Contains all of the probes for the instrument.
END script: Contains all cleanup tasks.