Go to main content

man pages section 3: Extended Library Functions, Volume 2

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

dtrace_lookup_by_type (3DTRACE)

Name

dtrace_lookup_by_type, dtrace_symbol_type, dtrace_type_fcompile, dtrace_type_strcompile - DTrace type interface

Synopsis

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

     int dtrace_lookup_by_type(dtrace_hdl_t *dtp, const char *object,
	const char *name, dtrace_typeinfo_t *tip)

     int dtrace_symbol_type(dtrace_hdl_t *dtp, const GElf_Sym *symp,
	const dtrace_syminfo_t *sip, dtrace_typeinfo_t *tip)

     int dtrace_type_fcompile(dtrace_hdl_t *dtp, FILE *fp,
	dtrace_typeinfo_t *tip)

     int dtrace_type_strcompile(dtrace_hdl_t *dtp, const char *s,
	dtrace_typeinfo_t *tip)

Description

The dtrace_lookup_by_type() function performs a lookup of the type, name in the module, object. The function returns the type information in tip, an opaque data structure.

The dtrace_symbol_type() function looks up the type information for the symbol described by the symp and sip arguments, and returns it in the tip argument.

The dtrace_type_fcompile() and dtrace_type_strcompile() functions take a D language type, either in a string, s or a in a file referred to by the fp argument. The functions add the type information to the information stored in the dtp argument, and return a reference to that type in the tip argument.

Return Values

On successful completion, these functions return 0. On failure, 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_lookup_by_type() function will fail if:

EINVAL

dtp is NULL.

EDT_NOMOD

The named module, object does not exist. (if a module name is given)

EDT_NOTYPE

The type does not exist in the specified module.

EDT_NOMEM

The system failed to allocate memory while processing this function.

The dtrace_symbol_type() function will fail if:

EINVAL

The value of the dtp, symp, sip, or tip argument is NULL.

EDT_NOMOD

The module specified in the sip argument does not exist.

EDT_NOSYM

The symbol specified in the sip argument does not exist in the specified module.

EDT_TYPE

There was a backend-type system error when looking up the symbol.

The dtrace_type_fcompile() and dtrace_type_strcompile() functions will fail if:

EINVAL

dtp, fp or s (respectively), or dtt is NULL.

EDT_NOMEM

The system was unable to allocate memory while processing this function.

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), dtrace_lookup_by_name(3DTRACE), dtrace_type_name(3DTRACE), gelf(3ELF)