Chapter 2. Context Functions

Table of Contents

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

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.