Go to main content

man pages section 3: Extended Library Functions, Volume 2

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

dtrace_object_info (3DTRACE)

Name

dtrace_object_info, dtrace_object_iter - DTrace object interface

Synopsis

     cc [ flag... ] file... -ldtrace [ library... ]
     #include <dtrace.h>

     typedef int dtrace_obj_f(dtrace_hdl_t *, const dtrace_objinfo_t *,
	void *);

     int dtrace_object_iter(dtrace_hdl_t *dtp, dtrace_obj_f *func,
	void *data)

     int dtrace_object_info(dtrace_hdl_t *dtp, const char *object,
	dtrace_objinfo_t *dto)

Description

The dtrace_object_iter() function iterates over the object files that DTrace has knowledge of, and calls the specified function func, on each. The object files represent the kernel modules loaded on the system, and the C and D objects that are specific to DTrace. The C and D objects contain C include definitions and D program definitions, respectively.

The dtrace_object_info() function returns the object information for the named module, object. The information is returned in the dto argument.

Return Values

On successful completion, these functions return 0.

If func returns a non-zero value for some object, the dtrace_object_iter() function returns that value. Otherwise these functions return -1, and set the DTrace error number to indicate the reason for the failure. See the dtrace_errno(3DTRACE) man page for more information.

Errors

The dtrace_object_iter() function will fail if:

EINVAL

The dtp or func parameter is NULL.

The dtrace_object_info() function will fail if:

EINVAL

Either the dtp or dto parameter is NULL, or the value of object is DTRACE_OBJ_EVERY, DTRACE_OBJ_KMODS, or DTRACE_OBJ_UMODS.

EDT_NOMOD

The named module, object doesn't exist.

Usage

The dtrace_objinfo_t data structure is defined as follows:

     typedef struct dtrace_objinfo {
             const char *dto_name;         /* object file scope name */
             const char *dto_file;         /* object file path (if any) */
             int dto_id;                   /* object file id (if any) */
             uint_t dto_flags;             /* object flags (see below) */
             GElf_Addr dto_text_va;        /* address of text section */
             GElf_Xword dto_text_size;     /* size of text section */
             GElf_Addr dto_data_va;        /* address of data section */
             GElf_Xword dto_data_size;     /* size of data section */
             GElf_Addr dto_bss_va;         /* address of BSS */
             GElf_Xword dto_bss_size;      /* size of BSS */
     } dtrace_objinfo_t;

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)