Go to main content

man pages section 3: Extended Library Functions, Volume 2

Exit Print View

Updated: Thursday, June 13, 2019
 
 

dtrace_uaddr2str (3DTRACE)

Name

dtrace_addr2str, dtrace_uaddr2str - Convert addresses to symbols

Synopsis

cc [ flag... ] file... -ldtrace [ library... ]      
#include <dtrace.h>  
  
int dtrace_addr2str(dtrace_hdl_t *dtp, uint64_t addr, char *str, int nbytes)  
int dtrace_uaddr2str(dtrace_hdl_t *dtp, pid_t pid, uint64_t addr, char *str, int nbytes)

Description

The dtrace_addr2str() function takes a kernel address, addr. The function writes a maximum of nbytes of the name of the symbol associated with the kernel address into the buffer, str.

The dtrace_uaddr2str() function takes a userspace address, addr., The function writes a maximum of nbytes of the name of the symbol associated with the userspace address into the provided buffer, str.

The string returned in the buffer, str can take the following forms:

module`symbol

If the address corresponds to a known object

module`function+offset

If the address is in a function

raw hex address

Any other condition

Return Values

On successful completion, the dtrace_addr2str() and dtrace_uaddr2str() functions return the length of the translated string, regardless of the value of _nbytes_.

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_addr2str() and dtrace_uaddr2str() functions will fail if:

EINVAL

dtp or str is NULL.

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)