SystemTap Tapset Reference Manual

SystemTap

Hackers

This documentation is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

For more details see the file COPYING in the source distribution of Linux.


Table of Contents

1. Introduction
Tapset Name Format
2. Context Functions
print_regs - Print a register dump.
execname - Returns the execname of a target process (or group of processes).
pid - Returns the ID of a target process.
tid - Returns the thread ID of a target process.
ppid - Returns the process ID of a target process's parent process.
pexecname - Returns the execname of a target process's parent process.
gid - Returns the group ID of a target process.
egid - Returns the effective gid of a target process.
uid - Returns the user ID of a target process.
euid - Return the effective uid of a target process.
cpu - Returns the current cpu number.
pp - Return the probe point associated with the currently running probe handler,
registers_valid - Determines validity of <command>register</command> and <command>u_register</command> in current context.
user_mode - Determines if probe point occurs in user-mode.
is_return - Determines if probe point is a return probe.
target - Return the process ID of the target process.
stack_size - Return the size of the kernel stack.
stack_used - Returns the amount of kernel stack used.
stack_unused - Returns the amount of kernel stack currently available.
uaddr - User space address of current running task. EXPERIMENTAL.
print_stack - Print out stack from string.
probefunc - Return the probe point's function name, if known.
probemod - Return the probe point's module name, if known.
modname - Return the kernel module name loaded at the address.
symname - Return the symbol associated with the given address.
symdata - Return the symbol and module offset for the address.
print_backtrace - Print stack back trace
backtrace - Hex backtrace of current stack
caller - Return name and address of calling function
caller_addr - Return caller address
3. Timestamp Functions
get_cycles - Processor cycle count.
4. Memory Tapset
vm_fault_contains - Test return value for page fault reason
vm.pagefault - Records that a page fault occurred.
vm.pagefault.return - Indicates what type of fault occurred.
addr_to_node - Returns which node a given address belongs to within a NUMA system.
vm.write_shared - Attempts at writing to a shared page.
vm.write_shared_copy - Page copy for shared page write.
vm.mmap - Fires when an <command>mmap</command> is requested.
vm.munmap - Fires when an <command>munmap</command> is requested.
vm.brk - Fires when a <command>brk</command> is requested (i.e. the heap will be resized).
vm.oom_kill - Fires when a thread is selected for termination by the OOM killer.
5. IO Scheduler Tapset
ioscheduler.elv_next_request - Fires when a request is retrieved from the request queue
ioscheduler.elv_next_request.return - Fires when a request retrieval issues a return signal
ioscheduler.elv_add_request - A request was added to the request queue
ioscheduler.elv_completed_request - Fires when a request is completed
6. SCSI Tapset
scsi.ioentry - Prepares a SCSI mid-layer request
scsi.iodispatching - SCSI mid-layer dispatched low-level SCSI command
scsi.iodone - SCSI command completed by low level driver and enqueued into the done queue.
scsi.iocompleted - SCSI mid-layer running the completion processing for block device I/O requests
7. Networking Tapset
netdev.receive - Data recieved from network device.
netdev.transmit - Network device transmitting buffer
tcp.sendmsg - Sending a tcp message
tcp.sendmsg.return - Sending TCP message is done
tcp.recvmsg - Receiving TCP message
tcp.recvmsg.return - Receiving TCP message complete
tcp.disconnect - TCP socket disconnection
tcp.disconnect.return - TCP socket disconnection complete
tcp.setsockopt - Call to setsockopt
tcp.setsockopt.return - Return from setsockopt
tcp.receive - Called when a TCP packet is received
udp.sendmsg - Fires whenever a process sends a UDP message
udp.sendmsg.return - Fires whenever an attempt to send a UDP message is completed
udp.recvmsg - Fires whenever a UDP message is received
udp.recvmsg.return - Fires whenever an attempt to receive a UDP message received is completed
udp.disconnect - Fires when a process requests for a UDP disconnection
udp.disconnect.return - UDP has been disconnected successfully
ip_ntop - returns a string representation from an integer IP number
8. Socket Tapset
socket.send - Message sent on a socket.
socket.receive - Message received on a socket.
socket.sendmsg - Message is currently being sent on a socket.
socket.sendmsg.return - Return from <command>socket.sendmsg</command>.
socket.recvmsg - Message being received on socket
socket.recvmsg.return - Return from Message being received on socket
socket.aio_write - Message send via sock_aio_write
socket.aio_write.return - Conclusion of message send via sock_aio_write
socket.aio_read - Receiving message via sock_aio_read
socket.aio_read.return - Conclusion of message received via sock_aio_read
socket.writev - Message sent via socket_writev
socket.writev.return - Conclusion of message sent via socket_writev
socket.readv - Receiving a message via sock_readv
socket.readv.return - Conclusion of receiving a message via sock_readv
socket.create - Creation of a socket
socket.create.return - Return from Creation of a socket
socket.close - Close a socket
socket.close.return - Return from closing a socket
sock_prot_num2str - Given a protocol number, return a string representation.
sock_prot_str2num - Given a protocol name (string), return the corresponding protocol number.
sock_fam_num2str - Given a protocol family number, return a string representation.
sock_fam_str2num - Given a protocol family name (string), return the corresponding
sock_state_num2str - Given a socket state number, return a string representation.
sock_state_str2num - Given a socket state string, return the corresponding state number.
9. Kernel Process Tapset
kprocess.create - Fires whenever a new process is successfully created
kprocess.start - Starting new process
kprocess.exec - Attempt to exec to a new program
kprocess.exec_complete - Return from exec to a new program
kprocess.exit - Exit from process
kprocess.release - Process released
10. Signal Tapset
signal.send - Signal being sent to a process
signal.send.return - Signal being sent to a process completed
signal.checkperm - Check being performed on a sent signal
signal.checkperm.return - Check performed on a sent signal completed
signal.wakeup - Sleeping process being wakened for signal
signal.check_ignored - Checking to see signal is ignored
signal.check_ignored.return - Check to see signal is ignored completed
signal.force_segv - Forcing send of <command>SIGSEGV</command>
signal.force_segv.return - Forcing send of <command>SIGSEGV</command> complete
signal.syskill - Sending kill signal to a process
signal.syskill.return - Sending kill signal completed
signal.sys_tkill - Sending a kill signal to a thread
signal.systkill.return - Sending kill signal to a thread completed
signal.sys_tgkill - Sending kill signal to a thread group
signal.sys_tgkill.return - Sending kill signal to a thread group completed
signal.send_sig_queue - Queuing a signal to a process
signal.send_sig_queue.return - Queuing a signal to a process completed
signal.pending - Examining pending signal
signal.pending.return - Examination of pending signal completed
signal.handle - Signal handler being invoked
signal.handle.return - Signal handler invocation completed
signal.do_action - Examining or changing a signal action
signal.do_action.return - Examining or changing a signal action completed
signal.procmask - Examining or changing blocked signals
signal.flush - Flusing all pending signals for a task