Handler APIs
- 
                        int dtrace_handle_err(dtrace_hdl_t *dtp, dtrace_handle_err_f *hdlr, void *arg)
- 
                     Registers an error handler for a DTrace consumer. The error handler is called when an error occurs in a running D program such as accessing an invalid address or dividing by zero. Information about the error is stored in the dtrace_errdata_targument. The error handler can return aDTRACE_HANDLE_OKvalue to continue processing orDTRACE_HANDLE_ABORTto abort. An error handler has the following signature:int dtrace_handle_err_f(const dtrace_errdata_t *, void *); 
- 
                        int dtrace_handle_drop(dtrace_hdl_t *dtp, dtrace_handle_drop_f *hdlr, void *arg)
- 
                     Registers a drop handler for a DTrace consumer. The drop handler is called when the data is dropped by the running D program. Information about the drop (including the drop type) is stored in the dtrace_dropdata_targument. The drop handler can return a value to continue processingDTRACE_HANDLE_OKorDTRACE_HANDLE_ABORTto abort. A drop handler has the following signature:int dtrace_handle_drop_f(const dtrace_dropdata_t *, void *); 
- 
                        int dtrace_handle_proc(dtrace_hdl_t *dtp, dtrace_handle_proc_f *hdlr, void *arg)
- 
                     Registers a process handler for a DTrace consumer. The process handler is called when certain events occur for a process under DTrace control, such as dynamic linker activity or the process exiting. The process handler is called whenever certain events occur for a process under DTrace control, such as dynamic linker activity or the process exiting. A libprochandle to the process is passed as the first argument, and a predefined message is passed as the second argument. A proc handler has the following signature:void dtrace_handle_proc_f(struct ps_prochandle *, const char *, void *); 
- 
                        int dtrace_handle_buffered(dtrace_hdl_t *dtp, dtrace_handle_buffered_f *hdlr, void *arg)
- 
                     Registers a buffered I/O handler for a DTrace consumer. A buffered I/O handler allows the consumer to perform its own buffered I/O. If a NULL pointer is passed to dtrace_work(),dtrace_consume(), ordtrace_aggregate_print(),libdtrace() will make use of the buffered I/O handler. Output goes into thedtbda_bufferedmember of thedtrace_bufdata_tdata structure. A simple buffered I/O handler can just print that output. Information about the probe and the record or aggregation data being processed is also included. The buffered I/O handler can return aDTRACE_HANDLE_OKvalue to continue processing orDTRACE_HANDLE_ABORTto abort. Seedtrace_handle_buffered(3DTRACE).
- 
                        int dtrace_handle_setopt(dtrace_hdl_t *dtp, dtrace_handle_setopt_f *hdlr, void *arg)
- 
                     Registers a setopthandler for a DTrace consumer. Thesetopthandler is called when a DTrace option is set from within a D program by using thesetopt() action. Information about the option being set and the old and new values of the option are passed in thedtrace_setoptdata_targument. Thesetopthandler can return aDTRACE_HANDLE_OKvalue to continue processing orDTRACE_HANDLE_ABORTto abort. Seedtrace_handle_setopt(3DTRACE).