dtrace_fire_extern - Fire DTrace EXTERN probe
cc [ flag... ] file... -ldtrace [ library... ] #include <dtrace.h> int dtrace_fire_extern(dtrace_hdl_t *dtp, uint64_t arg1, uint64_t arg2, uint64_t arg3)
The dtrace_fire_extern() function fires the Dtrace:::EXTERN probe in the running D program associated with the dtp argument. The arguments arg1, arg2, and arg3 to the function are passed as arguments arg1, arg2, and arg3, to the dtrace:::EXTERN probe.
On successful completion, the dtrace_fire_extern() function returns 0. On failure, the function returns -1, and sets the DTrace error number to indicate the reason for the failure. See the dtrace_errno(3DTRACE) man page for more information.
The dtrace_fire_extern() function will fail if:
dtp is NULL.
The system encountered an error when copying the arguments into the kernel.
Given the following script,
EXTERN { printf("%d %d %d\n", arg1, arg2, arg3); exit(0); }
the following line in a simple DTrace consumer
dtrace_fire_extern(dtp, 1 2 3);
causes the script to generate the following output:
1 2 3
See the libdtrace(3LIB) man page for an example of a simple DTrace consumer.
See attributes(7) for descriptions of the following attributes:
|