Product SiteDocumentation Site

4.2. Accessing User-Space Target Variables

User-space target variables can be accessed in the same manner as described in Section 3.3.2, “Target Variables”. However, in Linux there are separate address spaces for the user and kernel code. When using "->" operator SystemTap will access the appropriate address space. For pointers to base types such as integers and strings there are a number of functions listed below to access user-space data. The first argument for each functions is the pointer to the data item.
user_char(address)
Obtain the character at address for the current user process.
user_short(address)
Obtain the short at address for the current user process.
user_int(address)
Obtain the int at address for the current user process.
user_long(address)
Obtain the long at address for the current user process.
user_string(address)
Obtain the string at address for the current user process.
user_string_n(address, n)
Obtain the string at address for the current user process and limits the string to n bytes.