Go to main content

man pages section 3: Extended Library Functions, Volume 2

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

dtrace_fire_extern (3DTRACE)

Name

dtrace_fire_extern - Fire DTrace EXTERN probe

Synopsis

     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)

Description

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.

Return Values

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.

Errors

The dtrace_fire_extern() function will fail if:

EINVAL

dtp is NULL.

EFAULT

The system encountered an error when copying the arguments into the kernel.

Examples

Example 1 Using the dtrace_fire_extern() Function

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.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Architecture
all
Availability
system/dtrace
Interface Stability
Committed
MT-Level
Safe

See Also

libdtrace(3LIB), dtrace_errno(3DTRACE)