Creating a New DTrace Instrument
Create new custom instruments that are tailored to gather data from your app.
Open the Instruments analysis tool.
Select a trace template.
Choose Instrument > Build New Instrument.
Enter a custom instrument description.
Enter any declarations that should not go in a probe definition into 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 of your testing. Create probes to gather only the information relevant to your app.
Custom instruments contain the following configurable 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.