Chapter 2. Context Functions

Table of Contents

function::print_regs - Print a register dump
function::execname - Returns the execname of a target process (or group of processes)
function::pid - Returns the ID of a target process
function::tid - Returns the thread ID of a target process
function::ppid - Returns the process ID of a target process's parent process
function::pgrp - Returns the process group ID of the current process
function::sid - Returns the session ID of the current process
function::pexecname - Returns the execname of a target process's parent process
function::gid - Returns the group ID of a target process
function::egid - Returns the effective gid of a target process
function::uid - Returns the user ID of a target process
function::euid - Return the effective uid of a target process
function::is_myproc - Determines if the current probe point has occurred in the user's own process
function::cpuid - Returns the current cpu number
function::cpu - Returns the current cpu number
function::pp - Returns the active probe point
function::registers_valid - Determines validity of register and u_register in current context
function::user_mode - Determines if probe point occurs in user-mode
function::is_return - Whether the current probe context is a return probe
function::target - Return the process ID of the target process
function::module_name - The module name of the current script
function::stp_pid - The process id of the stapio process
function::stack_size - Return the size of the kernel stack
function::stack_used - Returns the amount of kernel stack used
function::stack_unused - Returns the amount of kernel stack currently available
function::addr - Address of the current probe point.
function::uaddr - User space address of current running task (EXPERIMENTAL)
function::cmdline_args - Fetch command line arguments from current process
function::cmdline_arg - Fetch a command line argument
function::cmdline_str - Fetch all command line arguments from current process
function::env_var - Fetch environment variable from current process
function::print_stack - Print out kernel stack from string
function::sprint_stack - Return stack for kernel addresses from string (EXPERIMENTAL)
function::probefunc - Return the probe point's function name, if known
function::probemod - Return the probe point's kernel module name
function::modname - Return the kernel module name loaded at the address
function::symname - Return the kernel symbol associated with the given address
function::symdata - Return the kernel symbol and module offset for the address
function::umodname - Returns the (short) name of the user module. EXPERIMENTAL!
function::usymname - Return the symbol of an address in the current task. EXPERIMENTAL!
function::usymdata - Return the symbol and module offset of an address. EXPERIMENTAL!
function::print_ustack - Print out stack for the current task from string. EXPERIMENTAL!
function::sprint_ustack - Return stack for the current task from string. EXPERIMENTAL!
function::print_backtrace - Print stack back trace
function::sprint_backtrace - Return stack back trace as string (EXPERIMENTAL)
function::backtrace - Hex backtrace of current stack
function::task_backtrace - Hex backtrace of an arbitrary task
function::caller - Return name and address of calling function
function::caller_addr - Return caller address
function::print_ubacktrace - Print stack back trace for current task. EXPERIMENTAL!
function::sprint_ubacktrace - Return stack back trace for current task as string. EXPERIMENTAL!
function::print_ubacktrace_brief - Print stack back trace for current task. EXPERIMENTAL!
function::ubacktrace - Hex backtrace of current task stack. EXPERIMENTAL!
function::task_current - The current task_struct of the current task
function::task_parent - The task_struct of the parent task
function::task_state - The state of the task
function::task_execname - The name of the task
function::task_pid - The process identifier of the task
function::pid2task - The task_struct of the given process identifier
function::pid2execname - The name of the given process identifier
function::task_tid - The thread identifier of the task
function::task_gid - The group identifier of the task
function::task_egid - The effective group identifier of the task
function::task_uid - The user identifier of the task
function::task_euid - The effective user identifier of the task
function::task_prio - The priority value of the task
function::task_nice - The nice value of the task
function::task_cpu - The scheduled cpu of the task
function::task_open_file_handles - The number of open files of the task
function::task_max_file_handles - The max number of open files for the task
function::pn - Returns the active probe name

The context functions provide additional information about where an event occurred. These functions can provide information such as a backtrace to where the event occurred and the current register values for the processor.