summaryrefslogtreecommitdiffstats
path: root/tapset
diff options
context:
space:
mode:
Diffstat (limited to 'tapset')
-rw-r--r--tapset/aux_syscalls.stp7
-rw-r--r--tapset/context-symbols.stp19
-rw-r--r--tapset/context-unwind.stp16
-rw-r--r--tapset/context.stp77
-rw-r--r--tapset/ioscheduler.stp20
-rw-r--r--tapset/ip.stp32
-rw-r--r--tapset/memory.stp13
-rw-r--r--tapset/networking.stp8
-rw-r--r--tapset/process.stp4
-rw-r--r--tapset/scsi.stp18
-rw-r--r--tapset/signal.stp210
-rw-r--r--tapset/socket.stp74
-rw-r--r--tapset/task.stp24
-rw-r--r--tapset/tcp.stp38
-rw-r--r--tapset/timestamp.stp6
-rw-r--r--tapset/udp.stp46
16 files changed, 365 insertions, 247 deletions
diff --git a/tapset/aux_syscalls.stp b/tapset/aux_syscalls.stp
index d2e43903..87ea4e04 100644
--- a/tapset/aux_syscalls.stp
+++ b/tapset/aux_syscalls.stp
@@ -322,17 +322,10 @@ function _struct_sockaddr_u:string(uaddr:long, len:long)
}
else if ((sa->sa_family == AF_PACKET)&&(len == sizeof(struct sockaddr_ll)))
{
- /* FIXME. This needs tested */
struct sockaddr_ll *sll = (struct sockaddr_ll *)buf;
-#if defined(__powerpc__) || defined(__ia64__) || defined(__s390x__)
- snprintf(str, strlen, "{AF_PACKET, proto=%d, ind=%d, hatype=%d, pkttype=%d, halen=%d, addr=0x%lx}",
- (int)sll->sll_protocol, sll->sll_ifindex, (int)sll->sll_hatype, (int)sll->sll_pkttype,
- (int)sll->sll_halen, *(uint64_t *)sll->sll_addr);
-#else
snprintf(str, strlen, "{AF_PACKET, proto=%d, ind=%d, hatype=%d, pkttype=%d, halen=%d, addr=0x%llx}",
(int)sll->sll_protocol, sll->sll_ifindex, (int)sll->sll_hatype, (int)sll->sll_pkttype,
(int)sll->sll_halen, *(uint64_t *)sll->sll_addr);
-#endif
}
else
{
diff --git a/tapset/context-symbols.stp b/tapset/context-symbols.stp
index 46eab841..a3aae408 100644
--- a/tapset/context-symbols.stp
+++ b/tapset/context-symbols.stp
@@ -6,7 +6,11 @@
// redistribute it and/or modify it under the terms of the GNU General
// Public License (GPL); either version 2, or (at your option) any
// later version.
-
+// <tapsetdescription>
+// Context functions provide additional information about where an event occurred. These functions can
+//provide information such as a backtrace to where the event occured and the current register values for the
+//processor.
+// </tapsetdescription>
%{
#ifndef STP_NEED_SYMBOL_DATA
#define STP_NEED_SYMBOL_DATA 1
@@ -14,12 +18,13 @@
%}
// weirdness with print_stack, argument appears in build as undescribed
/**
- * sfunction print_stack - Print out stack from string
+ * sfunction print_stack - Print out stack from string.
* @stk: String with list of hexidecimal addresses. (FIXME)
*
* Perform a symbolic lookup of the addresses in the given string,
- * which is assumed to be the result of a prior call to
+ * which is assumed to be the result of a prior call to
* <command>backtrace()</command>.
+ *
* Print one line per address, including the address, the
* name of the function containing the address, and an estimate of
* its position within that function. Return nothing.
@@ -36,9 +41,7 @@ function print_stack(stk:string) %{
%}
/**
- * sfunction probefunc - Function probed
- *
- * Return the probe point's function name, if known.
+ * sfunction probefunc - Return the probe point's function name, if known.
*/
function probefunc:string () %{ /* pure */
char *ptr, *start;
@@ -72,9 +75,7 @@ function probefunc:string () %{ /* pure */
%}
/**
- * sfunction probemod - Module probed
- *
- * Return the probe point's module name, if known.
+ * sfunction probemod - Return the probe point's module name, if known.
*/
function probemod:string () %{ /* pure */
char *ptr, *start;
diff --git a/tapset/context-unwind.stp b/tapset/context-unwind.stp
index a0836ed6..90d4e0f4 100644
--- a/tapset/context-unwind.stp
+++ b/tapset/context-unwind.stp
@@ -6,7 +6,11 @@
// redistribute it and/or modify it under the terms of the GNU General
// Public License (GPL); either version 2, or (at your option) any
// later version.
-
+// <tapsetdescription>
+// Context functions provide additional information about where an event occurred. These functions can
+//provide information such as a backtrace to where the event occured and the current register values for the
+//processor.
+// </tapsetdescription>
%{
#ifndef STP_NEED_UNWIND_DATA
#define STP_NEED_UNWIND_DATA 1
@@ -19,7 +23,7 @@
/**
* sfunction print_backtrace - Print stack back trace
*
- * Equivalent to <command>print_stack(backtrace())</command>,
+ * Equivalent to <command>print_stack(backtrace())</command>,
* except that deeper stack nesting may be supported. Return nothing.
*/
function print_backtrace () %{
@@ -33,8 +37,8 @@ function print_backtrace () %{
/**
* sfunction backtrace - Hex backtrace of current stack
*
- * Return a string of hex addresses that are a backtrace of the
- * stack. It may be truncated due to maximum string length.
+ * Return a string of hex addresses that are a backtrace of the
+ * stack. Output may be truncated as per maximum string length.
*/
function backtrace:string () %{ /* pure */
if (CONTEXT->regs)
@@ -46,7 +50,7 @@ function backtrace:string () %{ /* pure */
/**
* sfunction caller - Return name and address of calling function
*
- * Return the address and name of the calling function.
+ * Return the address and name of the calling function.
* <emphasis>Works only for return probes at this time.</emphasis>
*/
function caller:string() %{ /* pure */
@@ -60,7 +64,7 @@ function caller:string() %{ /* pure */
/**
* sfunction caller_addr - Return caller address
*
- * Return the address of the calling function.
+ * Return the address of the calling function.
* <emphasis> Works only for return probes at this time.</emphasis>
*/
function caller_addr:long () %{ /* pure */
diff --git a/tapset/context.stp b/tapset/context.stp
index 7fd961c8..9f4be0e6 100644
--- a/tapset/context.stp
+++ b/tapset/context.stp
@@ -6,7 +6,11 @@
// redistribute it and/or modify it under the terms of the GNU General
// Public License (GPL); either version 2, or (at your option) any
// later version.
-
+// <tapsetdescription>
+// Context functions provide additional information about where an event occurred. These functions can
+//provide information such as a backtrace to where the event occured and the current register values for the
+//processor.
+// </tapsetdescription>
/**
* sfunction print_regs - Print a register dump.
*/
@@ -17,37 +21,28 @@ function print_regs () %{
%}
/**
- * sfunction execname - Execname of current processes
- *
- * Return the name of the current process.
+ * sfunction execname - Returns the execname of a target process (or group of processes).
*/
function execname:string () %{ /* pure */
strlcpy (THIS->__retvalue, current->comm, MAXSTRINGLEN);
%}
/**
- * sfunction pid - Process ID of current process
- *
- *
- * Return the id of the current process.
+ * sfunction pid - Returns the ID of a target process.
*/
function pid:long () %{ /* pure */
THIS->__retvalue = current->tgid;
%}
/**
- * sfunction tid - Thread ID of current process
- *
- * Return the id of the current thread.
+ * sfunction tid - Returns the thread ID of a target process.
*/
function tid:long () %{ /* pure */
THIS->__retvalue = current->pid;
%}
/**
- * sfunction ppid - Parent Process ID of current process
- *
- * Return the id of the parent process.
+ * sfunction ppid - Returns the process ID of a target process's parent process.
*/
function ppid:long () %{ /* pure */
#if defined(STAPCONF_REAL_PARENT)
@@ -58,9 +53,7 @@ function ppid:long () %{ /* pure */
%}
/**
- * sfunction pexecname - Execname of the parent process.
- *
- * Return the name of the parent process.
+ * sfunction pexecname - Returns the execname of a target process's parent process.
*/
function pexecname:string () %{ /* pure */
#if defined(STAPCONF_REAL_PARENT)
@@ -71,9 +64,7 @@ function pexecname:string () %{ /* pure */
%}
/**
- * sfunction gid - Group ID of current process
- *
- * Return the gid of the current process.
+ * sfunction gid - Returns the group ID of a target process.
*/
function gid:long () %{ /* pure */
#ifdef STAPCONF_TASK_UID
@@ -84,9 +75,7 @@ function gid:long () %{ /* pure */
%}
/**
- * sfunction egid - Effective gid of the current process.
- *
- * Return the effective gid of the current process.
+ * sfunction egid - Returns the effective gid of a target process.
*/
function egid:long () %{ /* pure */
#ifdef STAPCONF_TASK_UID
@@ -97,9 +86,7 @@ function egid:long () %{ /* pure */
%}
/**
- * sfunction uid -User ID of the current process.
- *
- * Return the uid of the current process.
+ * sfunction uid - Returns the user ID of a target process.
*/
function uid:long () %{ /* pure */
#ifdef STAPCONF_TASK_UID
@@ -110,9 +97,7 @@ function uid:long () %{ /* pure */
%}
/**
- * sfunction euid - Effective User ID of the current process.
- *
- * Return the effective uid of the current process.
+ * sfunction euid - Return the effective uid of a target process.
*/
function euid:long () %{ /* pure */
#ifdef STAPCONF_TASK_UID
@@ -128,26 +113,24 @@ function cpuid:long () %{ /* pure */
%}
/**
- * sfunction cpu - The current cpu number.
- *
- * Return the current cpu number.
+ * sfunction cpu - Returns the current cpu number.
*/
function cpu:long () %{ /* pure */
THIS->__retvalue = smp_processor_id();
%}
/**
- * sfunction pp - Current probe point
- *
- * Return the probe point associated with the currently running
- * probe handler, including alias and wildcard expansion effects.
+ * sfunction pp - Return the probe point associated with the currently running probe handler,
+ * including alias and wildcard expansion effects
+ * Context:
+ * The current probe point.
*/
function pp:string () %{ /* pure */
strlcpy (THIS->__retvalue, CONTEXT->probe_point, MAXSTRINGLEN);
%}
/**
- * sfunction registers_valid - Register information valid
+ * sfunction registers_valid - Determines validity of <command>register()</command> and <command>u_register()</command> in current context.
*
* Return 1 if register() and u_register() can be used
* in the current context, or 0 otherwise.
@@ -159,7 +142,7 @@ function registers_valid:long () %{ /* pure */
%}
/**
- * sfunction user_mode - User Mode
+ * sfunction user_mode - Determines if probe point occurs in user-mode.
*
* Return 1 if the probe point occurred in user-mode.
*/
@@ -176,7 +159,7 @@ function user_mode:long () %{ /* pure */ /* currently a user-mode address? */
%}
/**
- * sfunction is_return - Is return probe
+ * sfunction is_return - Determines if probe point is a return probe.
*
* Return 1 if the probe point is a return probe.
* <emphasis>Deprecated.</emphasis>
@@ -189,9 +172,7 @@ function is_return:long () %{ /* pure */
%}
/**
- * sfunction target - Target pid
- *
- * Return the pid of the target process.
+ * sfunction target - Return the process ID of the target process.
*/
function target:long () %{ /* pure */
THIS->__retvalue = _stp_target;
@@ -220,18 +201,16 @@ function stp_pid:long () %{ /* pure */
%}
/**
- * sfunction stack_size - Size of kernel stack
- *
- * Return the size of the kernel stack.
+ * sfunction stack_size - Return the size of the kernel stack.
*/
function stack_size:long () %{ /* pure */
THIS->__retvalue = THREAD_SIZE;
%}
/**
- * sfunction stack_used - Current amount of kernel stack used
+ * sfunction stack_used - Returns the amount of kernel stack used.
*
- * Return how many bytes are currently used in the kernel stack.
+ * Determines how many bytes are currently used in the kernel stack.
*/
function stack_used:long () %{ /* pure */
char a;
@@ -239,9 +218,9 @@ function stack_used:long () %{ /* pure */
%}
/**
- * sfunction stack_unused - Amount of kernel stack currently available
+ * sfunction stack_unused - Returns the amount of kernel stack currently available.
*
- * Return how many bytes are currently available in the kernel stack.
+ * Determines how many bytes are currently available in the kernel stack.
*/
function stack_unused:long () %{ /* pure */
char a;
diff --git a/tapset/ioscheduler.stp b/tapset/ioscheduler.stp
index d7a71aca..a79ae752 100644
--- a/tapset/ioscheduler.stp
+++ b/tapset/ioscheduler.stp
@@ -5,15 +5,17 @@
// redistribute it and/or modify it under the terms of the GNU General
// Public License (GPL); either version 2, or (at your option) any
// later version.
-
+// <tapsetdescription>
+// This family of probe points is used to probe IO scheduler activities.
+// </tapsetdescription>
%{
#include <linux/blkdev.h>
#include <linux/elevator.h>
%}
/**
- * probe ioscheduler.elv_next_request - Retrieve request from request queue
- * @elevator_name: The elevator name
+ * probe ioscheduler.elv_next_request - Fires when a request is retrieved from the request queue
+ * @elevator_name: The type of I/O elevator currently enabled
*/
probe ioscheduler.elv_next_request
= kernel.function("elv_next_request")
@@ -26,7 +28,7 @@ probe ioscheduler.elv_next_request
}
/**
- * probe ioscheduler.elv_next_request.return - Return from retrieving a request
+ * probe ioscheduler.elv_next_request.return - Fires when a request retrieval issues a return signal
* @req: Address of the request
* @req_flags: Request flags
* @disk_major: Disk major number of the request
@@ -58,14 +60,14 @@ probe ioscheduler.elv_next_request.return
}
/**
- * probe ioscheduler.elv_add_request - Add a request into request queue
- * @elevator_name: The elevator name
+ * probe ioscheduler.elv_add_request - A request was added to the request queue
+ * @elevator_name: The type of I/O elevator currently enabled
* @req: Address of the request
* @req_flags: Request flags
* @disk_major: Disk major number of the request
* @disk_minor: Disk minor number of the request
*/
-/* when a request is added to the request queue */
+// when a request is added to the request queue
probe ioscheduler.elv_add_request
= kernel.function("__elv_add_request")
{
@@ -96,8 +98,8 @@ probe ioscheduler.elv_add_request
}
/**
- * probe ioscheduler.elv_completed_request - Request is completed
- * @elevator_name: The elevator name
+ * probe ioscheduler.elv_completed_request - Fires when a request is completed
+ * @elevator_name: The type of I/O elevator currently enabled
* @req: Address of the request
* @req_flags: Request flags
* @disk_major: Disk major number of the request
diff --git a/tapset/ip.stp b/tapset/ip.stp
new file mode 100644
index 00000000..1e2e263c
--- /dev/null
+++ b/tapset/ip.stp
@@ -0,0 +1,32 @@
+// IP tapset
+// Copyright (C) 2009, IBM Inc.
+// Author : Breno Leitao <leitao@linux.vnet.ibm.com>
+//
+// This file is free software. You can redistribute it and/or modify it under
+// the terms of the GNU General Public License (GPL), version 2.
+//
+// Based on previous work done by Arnaldo Carvalho de Melo <acme@redhat.com>
+
+/**
+ * sfunction ip_ntop - returns a string representation from an integer IP number
+ * @addr: the ip represented as an integer
+ */
+function ip_ntop:string (addr:long)
+%{
+ __be32 ip;
+
+ ip = THIS->addr;
+ snprintf(THIS->__retvalue, MAXSTRINGLEN, NIPQUAD_FMT, NIPQUAD(ip));
+%}
+
+/* return the source IP address for a given sock */
+function __ip_sock_saddr:long (sock:long)
+{
+ return @cast(sock, "inet_sock")->saddr
+}
+
+/* return the destination IP address for a given sock */
+function __ip_sock_daddr:long (sock:long)
+{
+ return @cast(sock, "inet_sock")->daddr
+}
diff --git a/tapset/memory.stp b/tapset/memory.stp
index 961cca38..83875aa4 100644
--- a/tapset/memory.stp
+++ b/tapset/memory.stp
@@ -6,6 +6,9 @@
// redistribute it and/or modify it under the terms of the GNU General
// Public License (GPL); either version 2, or (at your option) any
// later version.
+// <tapsetdescription>
+// This family of probe points is used to probe memory-related events.
+// </tapsetdescription>
%{
#include <linux/mm.h>
%}
@@ -53,7 +56,7 @@ function vm_fault_contains:long (value:long, test:long)
/**
* probe vm.pagefault - Records that a page fault occurred.
* @address: The address of the faulting memory access; i.e. the address that caused the page fault.
- * @write_access: Indicates whether this was a write or read access; <command>1</command> indicates a write,
+ * @write_access: Indicates whether this was a write or read access; <command>1</command> indicates a write,
* while <command>0</command> indicates a read.
*
* Context: The process which triggered the fault
@@ -97,7 +100,7 @@ function addr_to_node:long(addr:long) %{ /* pure */
}
%}
-/* Return whether a page to be copied is a zero page. */
+// Return whether a page to be copied is a zero page.
function _IS_ZERO_PAGE:long(from:long, vaddr:long) %{ /* pure */
THIS->__retvalue = (THIS->from == (long) ZERO_PAGE(THIS->vaddr));
%}
@@ -110,8 +113,8 @@ function _IS_ZERO_PAGE:long(from:long, vaddr:long) %{ /* pure */
* Context:
* The context is the process attempting the write.
*
- * Fires when a process attempts to write to a shared page.
- * If a copy is necessary, this will be followed by a
+ * Fires when a process attempts to write to a shared page.
+ * If a copy is necessary, this will be followed by a
* <command>vm.write_shared_copy</command>.
*/
probe vm.write_shared = kernel.function("do_wp_page") {
@@ -119,7 +122,7 @@ probe vm.write_shared = kernel.function("do_wp_page") {
}
/**
- * probe vm.write_shared_copy- Page copy for shared page write.
+ * probe vm.write_shared_copy - Page copy for shared page write.
* @address: The address of the shared write.
* @zero: Boolean indicating whether it is a zero page
* (can do a clear instead of a copy).
diff --git a/tapset/networking.stp b/tapset/networking.stp
index a147441a..f6d78536 100644
--- a/tapset/networking.stp
+++ b/tapset/networking.stp
@@ -5,7 +5,9 @@
// redistribute it and/or modify it under the terms of the GNU General
// Public License (GPL); either version 2, or (at your option) any
// later version.
-
+// <tapsetdescription>
+// This family of probe points is used to probe the activities of the network device.
+// </tapsetdescription>
/**
* probe netdev.receive - Data recieved from network device.
* @dev_name: The name of the device. e.g: eth0, ath1.
@@ -49,7 +51,7 @@
///
/// </variablelist>
///</para>
-/* Main device receive routine, be called when packet arrives on network device */
+// Main device receive routine, be called when packet arrives on network device
probe netdev.receive
= kernel.function("netif_receive_skb")
{
@@ -67,7 +69,7 @@ probe netdev.receive
* @truesize: The size of the the data to be transmitted.
*
*/
-/* Queue a buffer for transmission to a network device */
+// Queue a buffer for transmission to a network device
probe netdev.transmit
= kernel.function("dev_queue_xmit")
{
diff --git a/tapset/process.stp b/tapset/process.stp
index ca49aa67..e39f740a 100644
--- a/tapset/process.stp
+++ b/tapset/process.stp
@@ -5,7 +5,9 @@
// redistribute it and/or modify it under the terms of the GNU General
// Public License (GPL); either version 2, or (at your option) any
// later version.
-
+// <tapsetdescription>
+// This family of probe points is used to probe process-related activities.
+// </tapsetdescription>
function _IS_ERR:long(ptr:long) %{ /* pure */
THIS->__retvalue = IS_ERR((const void *)(long)THIS->ptr);
diff --git a/tapset/scsi.stp b/tapset/scsi.stp
index 6d332e8b..e1457739 100644
--- a/tapset/scsi.stp
+++ b/tapset/scsi.stp
@@ -5,7 +5,9 @@
// redistribute it and/or modify it under the terms of the GNU General
// Public License (GPL); either version 2, or (at your option) any
// later version.
-
+// <tapsetdescription>
+// This family of probe points is used to probe SCSI activities.
+// </tapsetdescription>
%{
#include <linux/types.h>
#include <scsi/scsi_cmnd.h>
@@ -21,7 +23,7 @@
* @disk_minor: The minor number of the disk (-1 if no information)
* @device_state: The current state of the device.
*/
-/* FIXME describe the device_state */
+// FIXME describe the device_state
probe scsi.ioentry
= module("scsi_mod").function("scsi_prep_fn@drivers/scsi/scsi_lib.c")?,
kernel.function("scsi_prep_fn@drivers/scsi/scsi_lib.c")?
@@ -44,9 +46,9 @@ probe scsi.ioentry
* @lun: The lun number
* @dev_id: The scsi device id
* @device_state: The current state of the device.
- * @data_direction: The data_direction specifies whether this command is from/to
- * the device. 0 (DMA_BIDIRECTIONAL), 1 (DMA_TO_DEVICE),
- * 2 (DMA_FROM_DEVICE), 3 (DMA_NONE)
+ * @data_direction: The data_direction specifies whether this command is from/to the device.
+ * 0 (DMA_BIDIRECTIONAL), 1 (DMA_TO_DEVICE),
+ * 2 (DMA_FROM_DEVICE), 3 (DMA_NONE)
* @request_buffer: The request buffer address
* @req_bufflen: The request buffer length
*/
@@ -79,7 +81,7 @@ probe scsi.iodispatching
* @dev_id: The scsi device id
* @device_state: The current state of the device
* @data_direction: The data_direction specifies whether this command is
- * from/to the device.
+ * from/to the device.
*/
probe scsi.iodone
= module("scsi_mod").function("scsi_done@drivers/scsi/scsi.c")?,
@@ -104,10 +106,10 @@ probe scsi.iodone
* @dev_id: The scsi device id
* @device_state: The current state of the device
* @data_direction: The data_direction specifies whether this command is from/to
- * the device
+ * the device
* @goodbytes: The bytes completed.
*/
-/* mid-layer processes the completed IO */
+// mid-layer processes the completed IO
probe scsi.iocompleted
= module("scsi_mod").function("scsi_io_completion@drivers/scsi/scsi_lib.c")?,
kernel.function("scsi_io_completion@drivers/scsi/scsi_lib.c")?
diff --git a/tapset/signal.stp b/tapset/signal.stp
index 8fb6fe57..e8470a9c 100644
--- a/tapset/signal.stp
+++ b/tapset/signal.stp
@@ -8,16 +8,17 @@
// Public License (GPL); either version 2, or (at your option) any
// later version.
//
-// Note : Since there are so many signals sent to processes at any give
-// point, it's better to filter the information according to the
-// requirements. For example, filter only for a particular signal
-// (if sig==2) or filter only for a particular process
-// (if pid_name==stap).
//
-
+// <tapsetdescription>
+// This family of probe points is used to probe signal activities.
+// Since there are so many signals sent to processes at any given
+// point, it is advisable to filter the information according to the
+// requirements. For example, filter only for a particular signal
+// (if sig==2) or for a particular process (if pid_name==stap).
+// </tapsetdescription>
/**
- * probe signal.send- Fires when a system call or kernel function sends a signal to a process.
+ * probe signal.send - Signal being sent to a process
* Arguments:
* @sig: The number of the signal
* @sig_name: A string representation of the signal
@@ -27,9 +28,10 @@
* @task: A task handle to the signal recipient
* @sinfo: The address of <command>siginfo</command> struct
* @shared: Indicates whether the signal is shared by the thread group
- * @send2queue- Indicates whether the signal is sent to an existing <command>sigqueue</command>
+ * @send2queue: Indicates whether the signal is sent to an existing
+ * <command>sigqueue</command>
* @name: The name of the function used to send out the signal
- *
+ *
* Context:
* The signal's sender.
*
@@ -114,42 +116,41 @@ probe _signal.send.part3 = kernel.function("send_sigqueue")
}
/**
- * probe signal.send.return - Fires when a signal sent to a process returns.
+ * probe signal.send.return - Signal being sent to a process completed
* @retstr: The return value to either <command>__group_send_sig_info</command>,
- * <command>specific_send_sig_info</command>, or <command>send_sigqueue</command>.
- * Refer to the Description of this probe for more information about the return
- * values of each function call.
+ * <command>specific_send_sig_info</command>,
+ * or <command>send_sigqueue</command>
* @shared: Indicates whether the sent signal is shared by the thread group.
- * @send2queue: Indicates whether the sent signal was sent to an existing <command>sigqueue</command>
- * @name: The name of the function used to send out the signal.
- *
+ * @send2queue: Indicates whether the sent signal was sent to an
+ * existing <command>sigqueue</command>
+ * @name: The name of the function used to send out the signal
+ *
* Context:
* The signal's sender. <remark>(correct?)</remark>
- *
+ *
* Possible <command>__group_send_sig_info</command> and
* <command>specific_send_sig_info</command> return values are as follows;
*
- * <command>0</command> - The signal is sucessfully sent to a process,
+ * <command>0</command> -- The signal is sucessfully sent to a process,
* which means that
* <1> the signal was ignored by the receiving process,
* <2> this is a non-RT signal and the system already has one queued, and
* <3> the signal was successfully added to the <command>sigqueue</command> of the receiving process.
*
- * <command>-EAGAIN</command> - The <command>sigqueue</command> of the receiving process is
+ * <command>-EAGAIN</command> -- The <command>sigqueue</command> of the receiving process is
* overflowing, the signal was RT, and the signal was sent by a user using something other
- * than <command>kill()</command>
- *
+ * than <command>kill()</command>.
+ *
* Possible <command>send_group_sigqueue</command> and
* <command>send_sigqueue</command> return values are as follows;
- *
- * <command>0</command> - The signal was either sucessfully added into the
+ *
+ * <command>0</command> -- The signal was either sucessfully added into the
* <command>sigqueue</command> of the receiving process, or a <command>SI_TIMER</command> entry is already
* queued (in which case, the overrun count will be simply incremented).
*
- * <command>1</command> - The signal was ignored by the receiving process.
- *
+ * <command>1</command> -- The signal was ignored by the receiving process.
*
- * <command>-1</command> - (<command>send_sigqueue</command> only) The task was marked
+ * <command>-1</command> -- (<command>send_sigqueue</command> only) The task was marked
* <command>exiting</command>, allowing * <command>posix_timer_event</command> to redirect it to the group
* leader.
*
@@ -232,7 +233,7 @@ probe _signal.send.part3.return = kernel.function("send_sigqueue").return
}
/**
- * probe signal.checkperm - Fires when a permission check is performed on a sent signal
+ * probe signal.checkperm - Check being performed on a sent signal
* @sig: The number of the signal
* @sig_name: A string representation of the signal
* @sig_pid: The PID of the process receiving the signal
@@ -240,7 +241,8 @@ probe _signal.send.part3.return = kernel.function("send_sigqueue").return
* @si_code: Indicates the signal type
* @task: A task handle to the signal recipient
* @sinfo: The address of the <command>siginfo</command> structure
- * @name: Name of the probe point; default value is <command>signal.checkperm</command>
+ * @name: Name of the probe point; default value is
+ * <command>signal.checkperm</command>
*/
probe signal.checkperm = kernel.function("check_kill_permission")
{
@@ -261,6 +263,12 @@ probe signal.checkperm = kernel.function("check_kill_permission")
si_code="SI_USER or SI_TIMER or SI_ASYNCIO"
}
+/**
+ * probe signal.checkperm.return - Check performed on a sent signal completed
+ * @name: Name of the probe point; default value is
+ * <command>signal.checkperm</command>
+ * @retstr: Return value as a string
+ */
probe signal.checkperm.return = kernel.function("check_kill_permission").return
{
name = "signal.checkperm"
@@ -269,15 +277,15 @@ probe signal.checkperm.return = kernel.function("check_kill_permission").return
/**
- * probe signal.wakeup - Wakes up a sleeping process, making it ready for new active signals
- * @sig_pid: The PID of the process you wish to wake
- * @pid_name: Name of the process you wish to wake
- * @resume: Indicates whether to wake up a task in a <command>STOPPED</command> or
- * <command>TRACED</command> state
+ * probe signal.wakeup - Sleeping process being wakened for signal
+ * @sig_pid: The PID of the process to wake
+ * @pid_name: Name of the process to wake
+ * @resume: Indicates whether to wake up a task in a
+ * <command>STOPPED</command> or <command>TRACED</command> state
* @state_mask: A string representation indicating the mask
- * of task states you wish to wake. Possible values are <command>TASK_INTERRUPTIBLE</command>,
- * <command>TASK_STOPPED</command>, <command>TASK_TRACED</command>,
- * and <command>TASK_INTERRUPTIBLE</command>.
+ * of task states to wake. Possible values are
+ * <command>TASK_INTERRUPTIBLE</command>, <command>TASK_STOPPED</command>,
+ * <command>TASK_TRACED</command>, and <command>TASK_INTERRUPTIBLE</command>.
*/
probe signal.wakeup = kernel.function("signal_wake_up")
{
@@ -293,8 +301,7 @@ probe signal.wakeup = kernel.function("signal_wake_up")
/**
- * probe signal.check_ignored - Fires when a system call or kernel function checks whether a
- * signal was ignored or not
+ * probe signal.check_ignored - Checking to see signal is ignored
* @sig_pid: The PID of the process receiving the signal
* @pid_name: Name of the process receiving the signal
* @sig: The number of the signal
@@ -308,6 +315,12 @@ probe signal.check_ignored = kernel.function("sig_ignored")
sig_name = _signal_name($sig)
}
+/**
+ * probe signal.check_ignored.return - Check to see signal is ignored completed
+ * @name: Name of the probe point; default value is
+ * <command>signal.checkperm</command>
+ * @retstr: Return value as a string
+ */
probe signal.check_ignored.return = kernel.function("sig_ignored").return ?
{
name = "sig_ignored"
@@ -333,8 +346,7 @@ probe signal.handle_stop = kernel.function("handle_stop_signal")
/**
- * probe signal.force_segv - Fires when a system call, kernel function, or process sent a
- * <command>SIGSEGV</command> as a result of problems it encountered while handling a received signal
+ * probe signal.force_segv - Forcing send of <command>SIGSEGV</command>
* @sig_pid: The PID of the process receiving the signal
* @pid_name: Name of the process receiving the signal
* @sig: The number of the signal
@@ -360,6 +372,12 @@ probe _signal.force_segv.part2 = kernel.function("force_sigsegv_info") ?
sig_name = _signal_name($sig)
}
+/**
+ * probe signal.force_segv.return - Forcing send of <command>SIGSEGV</command> complete
+ * @name: Name of the probe point; default value is
+ * <command>force_sigsegv</command>
+ * @retstr: Return value as a string
+ */
probe signal.force_segv.return =
kernel.function("force_sigsegv").return,
kernel.function("force_sigsegv_info").return ?
@@ -370,9 +388,8 @@ probe signal.force_segv.return =
/**
- * probe signal.syskill - Fires when the kernel function <command>sys_kill</command>
- * sends a kill signal to a process
- * @pid: The PID of the process receiving the kill signal
+ * probe signal.syskill - Sending kill signal to a process
+ * @pid: The PID of the process receiving the signal
* @sig: The specific signal sent to the process
*/
probe signal.syskill = syscall.kill
@@ -380,33 +397,43 @@ probe signal.syskill = syscall.kill
sig_name = _signal_name($sig)
}
+/**
+ * probe signal.syskill.return - Sending kill signal completed
+ */
probe signal.syskill.return = syscall.kill.return
{
}
+
/**
- * probe signal.sys_tkill - Fires when <command>tkill</command> sends a kill signal
- * to a process that is part of a thread group
+ * probe signal.sys_tkill - Sending a kill signal to a thread
* @pid: The PID of the process receiving the kill signal
* @sig: The specific signal sent to the process
+ * @sig_name: The specific signal sent to the process
+ *
* The <command>tkill</command> call is analogous to <command>kill(2)</command>,
* except that it also allows a process within a specific thread group to
- * be targetted. Such processes are targetted through their unique thread IDs (TID).
+ * be targetted. Such processes are targetted through their unique
+ * thread IDs (TID).
*/
probe signal.systkill = syscall.tkill
{
sig_name = _signal_name($sig)
}
+/**
+ * probe signal.systkill.return - Sending kill signal to a thread completed
+ */
probe signal.systkill.return = syscall.tkill.return
{
}
/**
- * probe signal.sys_tgkill - Fires when the kernel function <command>tgkill</command>
- * sends a kill signal to a specific thread group
+ * probe signal.sys_tgkill - Sending kill signal to a thread group
* @pid: The PID of the thread receiving the kill signal
* @tgid: The thread group ID of the thread receiving the kill signal
* @sig: The specific kill signal sent to the process
+ * @sig_name: A string representation of the signal
+ *
* The <command>tgkill</command> call is similar to <command>tkill</command>,
* except that it also allows the caller to specify the thread group ID of
* the thread to be signalled. This protects against TID reuse.
@@ -416,12 +443,15 @@ probe signal.systgkill = syscall.tgkill
sig_name = _signal_name($sig)
}
+/**
+ * probe signal.sys_tgkill.return - Sending kill signal to a thread group completed
+ */
probe signal.systgkill.return = syscall.tgkill.return
{
}
/**
- * probe signal.send_sig_queue - Fires when a signal is queued to a process
+ * probe signal.send_sig_queue - Queuing a signal to a process
* @sig: The queued signal
* @sig_name: A string representation of the signal
* @sig_pid: The PID of the process to which the signal is queued
@@ -439,6 +469,10 @@ probe signal.send_sig_queue =
sigqueue_addr = $q
}
+/**
+ * probe signal.send_sig_queue.return - Queuing a signal to a process completed
+ * @retstr: Return value as a string
+ */
probe signal.send_sig_queue.return =
kernel.function("send_sigqueue").return,
kernel.function("send_group_sigqueue").return ?
@@ -448,25 +482,25 @@ probe signal.send_sig_queue.return =
/**
- * probe signal.pending - Fires when the <command>SIGPENDING</command> system call is used;
- * this normally occurs when the <command>do_sigpending</command> kernel function is executed
- * @sigset_add: The address of the user-space signal set (<command>sigset_t</command>)
- * @sigset_size: The size of the user-space signal set.
- *
- * Synopsis:
- * <programlisting>long do_sigpending(void __user *set, unsigned long sigsetsize)</programlisting>
+ * probe signal.pending - Examining pending signal
+ * @sigset_add: The address of the user-space signal set
+ * (<command>sigset_t</command>)
+ * @sigset_size: The size of the user-space signal set
*
* This probe is used to examine a set of signals pending for delivery
- * to a specific thread.
+ * to a specific thread. This normally occurs when the
+ * <command>do_sigpending</command> kernel function is executed.
*/
-// long do_sigpending(void __user *set, unsigned long sigsetsize)
-
probe signal.pending = kernel.function("do_sigpending")
{
sigset_add=$set
sigset_size=$sigsetsize
}
+/**
+ * probe signal.pending.return - Examination of pending signal completed
+ * @retstr: Return value as a string
+ */
probe signal.pending.return = kernel.function("do_sigpending").return
{
retstr = returnstr(1)
@@ -474,22 +508,17 @@ probe signal.pending.return = kernel.function("do_sigpending").return
/**
- * probe signal.handle - Fires when the signal handler is invoked
+ * probe signal.handle - Signal handler being invoked
* @sig: The signal number that invoked the signal handler
* @sinfo: The address of the <command>siginfo</command> table
- * @sig_code: The <command>si_code</command> value of the <command>siginfo</command> signal
- * @ka_addr: The address of the <command>k_sigaction</command> table associated with the signal
+ * @sig_code: The <command>si_code</command> value of the
+ * <command>siginfo</command> signal
+ * @ka_addr: The address of the <command>k_sigaction</command> table
+ * associated with the signal
* @oldset_addr: The address of the bitmask array of blocked signals
* @regs: The address of the kernel-mode stack area
* @sig_mode: Indicates whether the signal was a user-mode or kernel-mode signal
- *
- * Synopsis:
- * <programlisting>static int handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
- * sigset_t *oldset, struct pt_regs * regs)</programlisting>
*/
-//static int handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
-// sigset_t *oldset, struct pt_regs * regs)
-
probe signal.handle = kernel.function("handle_signal")
{
sig = $sig
@@ -508,6 +537,10 @@ probe signal.handle = kernel.function("handle_signal")
sig_mode = "Kernel Mode Signal"
}
+/**
+ * probe signal.handle.return - Signal handler invocation completed
+ * @retstr: Return value as a string
+ */
probe signal.handle.return = kernel.function("handle_signal").return ?
{
retstr = returnstr(1)
@@ -515,11 +548,12 @@ probe signal.handle.return = kernel.function("handle_signal").return ?
/**
- * probe signal.do_action - Initiates a trace when a thread is about to examine
- * and change a signal action
+ * probe signal.do_action - Examining or changing a signal action
* @sig: The signal to be examined/changed
- * @sigact_addr: The address of the new <command>sigaction</command> struct associated with the signal
- * @oldsigact_addr: The address of the old <command>sigaction</command> struct associated with the signal
+ * @sigact_addr: The address of the new <command>sigaction</command>
+ * struct associated with the signal
+ * @oldsigact_addr: The address of the old <command>sigaction</command>
+ * struct associated with the signal
* @sa_handler: The new handler of the signal
* @sa_mask: The new mask of the signal
*/
@@ -535,6 +569,10 @@ probe signal.do_action = kernel.function("do_sigaction")
}
}
+/**
+ * probe signal.do_action.return - Examining or changing a signal action completed
+ * @retstr: Return value as a string
+ */
probe signal.do_action.return = kernel.function("do_sigaction").return
{
retstr = returnstr(1)
@@ -554,16 +592,17 @@ function __get_action_mask:long(act:long) %{ /* pure */
/**
- * probe signal.procmask - Initiates a trace when a thread is about to examine and change blocked signals
+ * probe signal.procmask - Examining or changing blocked signals
* @how: Indicates how to change the blocked signals; possible values are
* <command>SIG_BLOCK=0</command> (for blocking signals),
* <command>SIG_UNBLOCK=1</command> (for unblocking signals), and
* <command>SIG_SETMASK=2</command> for setting the signal mask.
- * @sigset_addr: The address of the signal set (<command>sigset_t</command>) to be implemented
- * @oldsigset_addr: The old address of the signal set (<command>sigset_t</command>)
- * @sigset: The actual value to be set for <command>sigset_t</command> <remark>(correct?)</remark>
- * Synopsis:
- * <programlisting>int sigprocmask(int how, sigset_t *set, sigset_t *oldset)</programlisting>
+ * @sigset_addr: The address of the signal set (<command>sigset_t</command>)
+ * to be implemented
+ * @oldsigset_addr: The old address of the signal set
+ * (<command>sigset_t</command>)
+ * @sigset: The actual value to be set for <command>sigset_t</command>
+ * <remark>(correct?)</remark>
*/
probe signal.procmask = kernel.function("sigprocmask")
{
@@ -591,16 +630,13 @@ probe signal.procmask.return = kernel.function("sigprocmask").return
/**
- * probe signal.flush - Fires when all pending signals for a task are flushed
+ * probe signal.flush - Flusing all pending signals for a task
* @task: The task handler of the process performing the flush
- * @sig_pid: The PID of the process associated with the task performing the flush
- * @pid_name: The name of the process associated with the task performing the flush
- *
- * Synopsis:
- * <programlisting>void flush_signals(struct task_struct *t)</programlisting>
+ * @sig_pid: The PID of the process associated with the task
+ * performing the flush
+ * @pid_name: The name of the process associated with the task
+ * performing the flush
*/
-//void flush_signals(struct task_struct *t)
-
probe signal.flush = kernel.function("flush_signals")
{
task = $t
diff --git a/tapset/socket.stp b/tapset/socket.stp
index 3271d4f7..0f01b8d4 100644
--- a/tapset/socket.stp
+++ b/tapset/socket.stp
@@ -5,7 +5,9 @@
// redistribute it and/or modify it under the terms of the GNU General
// Public License (GPL); either version 2, or (at your option) any
// later version.
-
+// <tapsetdescription>
+// This family of probe points is used to probe socket activities.
+// </tapsetdescription>
%{
#include <net/sock.h>
#include <asm/bitops.h>
@@ -65,8 +67,8 @@ probe socket.receive = socket.recvmsg.return,
### FUNCTION SPECIFIC SEND/RECEIVE PROBES ###
-/*
- * probe socket.sendmsg - Message being sent on socket
+/**
+ * probe socket.sendmsg - Message is currently being sent on a socket.
* @name: Name of this probe
* @size: Message size in bytes
* @protocol: Protocol value
@@ -93,7 +95,7 @@ probe socket.sendmsg = kernel.function ("sock_sendmsg")
}
/**
- * probe socket.sendmsg.return - Return from Message being sent on socket
+ * probe socket.sendmsg.return - Return from <command>socket.sendmsg</command>.
* @name: Name of this probe
* @size: Size of message sent (in bytes) or error code if success = 0
* @protocol: Protocol value
@@ -149,7 +151,7 @@ probe socket.recvmsg = kernel.function ("sock_recvmsg")
type = $sock->type
}
-/*
+/**
* probe socket.recvmsg.return - Return from Message being received on socket
* @name: Name of this probe
* @size: Size of message received (in bytes) or error code if success = 0
@@ -196,14 +198,14 @@ probe socket.recvmsg.return = kernel.function ("sock_recvmsg").return
* Fires at the beginning of sending a message on a socket
* via the sock_aio_write() function
*/
-/*
- * 2.6.9~2.6.15:
- * static ssize_t sock_aio_write(struct kiocb *iocb, const char __user *ubuf, size_t size, loff_t pos);
- * 2.6.16~2.6.18:
- * static ssize_t sock_aio_write(struct kiocb *iocb, const char __user *ubuf, size_t count, loff_t pos);
- * 2.6.19~2.6.26:
- * static ssize_t sock_aio_write(struct kiocb *iocb, const struct iovec *iov, unsigned long nr_segs, loff_t pos);
- */
+//
+// 2.6.9~2.6.15:
+// static ssize_t sock_aio_write(struct kiocb *iocb, const char __user *ubuf, size_t size, loff_t pos);
+// 2.6.16~2.6.18:
+// static ssize_t sock_aio_write(struct kiocb *iocb, const char __user *ubuf, size_t count, loff_t pos);
+// 2.6.19~2.6.26:
+// static ssize_t sock_aio_write(struct kiocb *iocb, const struct iovec *iov, unsigned long nr_segs, loff_t pos);
+
probe socket.aio_write = kernel.function ("sock_aio_write")
{
name = "socket.aio_write"
@@ -270,14 +272,14 @@ probe socket.aio_write.return = kernel.function ("sock_aio_write").return
* Fires at the beginning of receiving a message on a socket
* via the sock_aio_read() function
*/
-/*
- * 2.6.9~2.6.15:
- * static ssize_t sock_aio_read(struct kiocb *iocb, char __user *ubuf, size_t size, loff_t pos);
- * 2.6.16~2.6.18:
- * static ssize_t sock_aio_read(struct kiocb *iocb, char __user *ubuf, size_t count, loff_t pos);
- * 2.6.19~2.6.26:
- * static ssize_t sock_aio_read(struct kiocb *iocb, const struct iovec *iov, unsigned long nr_segs, loff_t pos);
- */
+//
+// 2.6.9~2.6.15:
+// static ssize_t sock_aio_read(struct kiocb *iocb, char __user *ubuf, size_t size, loff_t pos);
+// 2.6.16~2.6.18:
+// static ssize_t sock_aio_read(struct kiocb *iocb, char __user *ubuf, size_t count, loff_t pos);
+// 2.6.19~2.6.26:
+// static ssize_t sock_aio_read(struct kiocb *iocb, const struct iovec *iov, unsigned long nr_segs, loff_t pos);
+
probe socket.aio_read = kernel.function ("sock_aio_read")
{
name = "socket.aio_read"
@@ -541,18 +543,16 @@ probe socket.close.return = kernel.function ("sock_release").return
####### PROTOCOL HELPER FUNCTIONS ########
-/*
- * sock_prot_num2str
- * Given a protocol number, return a string representation.
+/**
+ * sfunction sock_prot_num2str - Given a protocol number, return a string representation.
*/
function sock_prot_num2str:string (proto:long)
{
return (proto in _prot_num2str ? _prot_num2str[proto] : "UNDEF")
}
-/*
- * sock_prot_str2num
- * Given a protocol name (string), return the corresponding protocol number.
+/**
+ * sfunction sock_prot_str2num - Given a protocol name (string), return the corresponding protocol number.
*/
function sock_prot_str2num:long (proto:string)
{
@@ -561,18 +561,16 @@ function sock_prot_str2num:long (proto:string)
######### PROTOCOL FAMILY HELPER FUNCTIONS ###########
-/*
- * sock_fam_num2str
- * Given a protocol family number, return a string representation.
+/**
+ * sfunction sock_fam_num2str - Given a protocol family number, return a string representation.
*/
function sock_fam_num2str:string (family:long)
{
return (family in _fam_num2str ? _fam_num2str[family] : "UNDEF")
}
-/*
- * sock_fam_str2num
- * Given a protocol family name (string), return the corresponding
+/**
+ * sfunction sock_fam_str2num - Given a protocol family name (string), return the corresponding
* protocol family number.
*/
function sock_fam_str2num:long (family:string)
@@ -582,18 +580,16 @@ function sock_fam_str2num:long (family:string)
######### SOCKET STATE HELPER FUNCTIONS ##########
-/*
- * sock_state_num2str
- * Given a socket state number, return a string representation.
+/**
+ * sfunction sock_state_num2str - Given a socket state number, return a string representation.
*/
function sock_state_num2str:string (state:long)
{
return (state in _state_num2str ? _state_num2str[state] : "UNDEF")
}
-/*
- * sock_state_str2num
- * Given a socket state string, return the corresponding state number.
+/**
+ * sfunction sock_state_str2num - Given a socket state string, return the corresponding state number.
*/
function sock_state_str2num:long (state:string)
{
diff --git a/tapset/task.stp b/tapset/task.stp
index 07337156..f1a10b0a 100644
--- a/tapset/task.stp
+++ b/tapset/task.stp
@@ -63,6 +63,30 @@ function task_pid:long (task:long)
}
+// Return the task of the given process id
+function pid2task:long (pid:long) %{ /* pure */
+ struct task_struct *t = NULL;
+ pid_t t_pid = (pid_t)(long)THIS->pid;
+ rcu_read_lock();
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
+ t = find_task_by_vpid (t_pid);
+#else
+ t = find_task_by_pid (t_pid);
+#endif
+ rcu_read_unlock();
+ THIS->__retvalue = (long)t;
+ CATCH_DEREF_FAULT();
+%}
+
+// Return the name of the given process id
+function pid2execname:string (pid:long) {
+ tsk = pid2task(pid)
+ if (tsk)
+ return task_execname(tsk)
+ return ""
+}
+
+
// Return the thread id of the given task
function task_tid:long (task:long)
{
diff --git a/tapset/tcp.stp b/tapset/tcp.stp
index 995d6abc..bb96b0cb 100644
--- a/tapset/tcp.stp
+++ b/tapset/tcp.stp
@@ -7,7 +7,9 @@
// redistribute it and/or modify it under the terms of the GNU General
// Public License (GPL); either version 2, or (at your option) any
// later version.
-
+// <tapsetdescription>
+// This family of probe points is used to probe events that occur in the TCP layer,
+// </tapsetdescription>
%{
#include <linux/version.h>
#include <net/sock.h>
@@ -71,6 +73,16 @@ function tcp_ts_get_info_state:long(sock:long)
CATCH_DEREF_FAULT();
%}
+/* return the TCP destination port for a given sock */
+function __tcp_sock_dport:long (sock:long){
+ return @cast(sock, "inet_sock")->dport
+}
+
+/* return the TCP source port for a given sock */
+function __tcp_sock_sport:long (sock:long){
+ return @cast(sock, "inet_sock")->sport
+}
+
global sockstate[13], sockstate_init_p
function tcp_sockstate_str:string (state:long) {
if (! sockstate_init_p) {
@@ -180,6 +192,10 @@ probe tcp.sendmsg.return = kernel.function("tcp_sendmsg").return {
* @name: Name of this probe
* @sock: Network socket
* @size: Number of bytes to be received
+ * @saddr: A string representing the source IP address
+ * @daddr: A string representing the destination IP address
+ * @sport: TCP source port
+ * @dport: TCP destination port
* Context:
* The process which receives a tcp message
*/
@@ -187,12 +203,20 @@ probe tcp.recvmsg = kernel.function("tcp_recvmsg") {
name = "tcp.recvmsg"
sock = $sk
size = $len
+ saddr = ip_ntop(__ip_sock_saddr($sk))
+ daddr = ip_ntop(__ip_sock_daddr($sk))
+ sport = __tcp_sock_sport($sk)
+ dport = __tcp_sock_dport($sk)
}
/**
* probe tcp.recvmsg.return - Receiving TCP message complete
* @name: Name of this probe
* @size: Number of bytes received or error code if an error occurred.
+ * @saddr: A string representing the source IP address
+ * @daddr: A string representing the destination IP address
+ * @sport: TCP source port
+ * @dport: TCP destination port
*
* Context:
* The process which receives a tcp message
@@ -200,6 +224,10 @@ probe tcp.recvmsg = kernel.function("tcp_recvmsg") {
probe tcp.recvmsg.return = kernel.function("tcp_recvmsg").return {
name = "tcp.recvmsg"
size = $return
+ saddr = ip_ntop(__ip_sock_saddr($sk))
+ daddr = ip_ntop(__ip_sock_daddr($sk))
+ sport = __tcp_sock_sport($sk)
+ dport = __tcp_sock_dport($sk)
}
/**
@@ -207,6 +235,10 @@ probe tcp.recvmsg.return = kernel.function("tcp_recvmsg").return {
* @name: Name of this probe
* @sock: Network socket
* @flags: TCP flags (e.g. FIN, etc)
+ * @saddr: A string representing the source IP address
+ * @daddr: A string representing the destination IP address
+ * @sport: TCP source port
+ * @dport: TCP destination port
*
* Context:
* The process which disconnects tcp
@@ -215,6 +247,10 @@ probe tcp.disconnect = kernel.function("tcp_disconnect") {
name = "tcp.disconnect"
sock = $sk
flags = $flags
+ saddr = ip_ntop(__ip_sock_saddr($sk))
+ daddr = ip_ntop(__ip_sock_daddr($sk))
+ sport = __tcp_sock_sport($sk)
+ dport = __tcp_sock_dport($sk)
}
/**
diff --git a/tapset/timestamp.stp b/tapset/timestamp.stp
index ce8f7558..0b9d350a 100644
--- a/tapset/timestamp.stp
+++ b/tapset/timestamp.stp
@@ -6,7 +6,11 @@
// redistribute it and/or modify it under the terms of the GNU General
// Public License (GPL); either version 2, or (at your option) any
// later version.
-
+// <tapsetdescription>
+// Each timestamp function returns a value to indicate when a function is executed. These
+//returned values can then be used to indicate when an event occurred, provide an ordering for events,
+//or compute the amount of time elapsed between two time stamps.
+// </tapsetdescription>
/**
* sfunction get_cycles - Processor cycle count.
*
diff --git a/tapset/udp.stp b/tapset/udp.stp
index 707cf77d..2255074a 100644
--- a/tapset/udp.stp
+++ b/tapset/udp.stp
@@ -5,7 +5,9 @@
// redistribute it and/or modify it under the terms of the GNU General
// Public License (GPL); either version 2, or (at your option) any
// later version.
-
+// <tapsetdescription>
+// This family of probe points is used to probe events that occur in the UDP layer.
+// </tapsetdescription>
%{
#include <linux/version.h>
#include <net/sock.h>
@@ -15,12 +17,12 @@
/**
* probe udp.sendmsg - Fires whenever a process sends a UDP message
- * @name: Name of this probe
- * @sock: Network socket
- * @size: Number of bytes to send
+ * @name: The name of this probe
+ * @sock: Network socket used by the process
+ * @size: Number of bytes sent by the process
*
* Context:
- * The process which sends a udp message
+ * The process which sent a UDP message
*/
probe udp.sendmsg = kernel.function("udp_sendmsg") {
name = "udp.sendmsg"
@@ -30,11 +32,11 @@ probe udp.sendmsg = kernel.function("udp_sendmsg") {
/**
* probe udp.sendmsg.return - Fires whenever an attempt to send a UDP message is completed
- * @name: Name of this probe
- * @size: Number of bytes sent
+ * @name: The name of this probe
+ * @size: Number of bytes sent by the process
*
* Context:
- * The process which sends a udp message
+ * The process which sent a UDP message
*/
probe udp.sendmsg.return = kernel.function("udp_sendmsg").return {
name = "udp.sendmsg"
@@ -43,12 +45,12 @@ probe udp.sendmsg.return = kernel.function("udp_sendmsg").return {
/**
* probe udp.recvmsg - Fires whenever a UDP message is received
- * @name: Name of this probe
- * @sock: Network socket
- * @size: Number of bytes received
+ * @name: The name of this probe
+ * @sock: Network socket used by the process
+ * @size: Number of bytes received by the process
*
* Context:
- * The process which receives a udp message
+ * The process which received a UDP message
*/
probe udp.recvmsg = kernel.function("udp_recvmsg") {
name = "udp.recvmsg"
@@ -57,12 +59,12 @@ probe udp.recvmsg = kernel.function("udp_recvmsg") {
}
/**
- * probe udp.recvmsg.return - An attempt to receive a UDP message received has been completed
- * @name: Name of this probe
- * @size: Number of bytes received
+ * probe udp.recvmsg.return - Fires whenever an attempt to receive a UDP message received is completed
+ * @name: The name of this probe
+ * @size: Number of bytes received by the process
*
* Context:
- * The process which receives a udp message
+ * The process which received a UDP message
*/
probe udp.recvmsg.return = kernel.function("udp_recvmsg").return {
name = "udp.recvmsg"
@@ -70,13 +72,13 @@ probe udp.recvmsg.return = kernel.function("udp_recvmsg").return {
}
/**
- * probe udp.disconnect - A process requests for UPD to be UDP disconnected
- * @name: Name of this probe
- * @sock: Network socket
+ * probe udp.disconnect - Fires when a process requests for a UDP disconnection
+ * @name: The name of this probe
+ * @sock: Network socket used by the process
* @flags: Flags (e.g. FIN, etc)
*
* Context:
- * The process which disconnects UDP
+ * The process which requests a UDP disconnection
*/
probe udp.disconnect = kernel.function("udp_disconnect") {
name = "udp.disconnect"
@@ -86,11 +88,11 @@ probe udp.disconnect = kernel.function("udp_disconnect") {
/**
* probe udp.disconnect.return - UDP has been disconnected successfully
- * @name: Name of this probe
+ * @name: The name of this probe
* @ret: Error code (0: no error)
*
* Context:
- * The process which disconnects udp
+ * The process which requested a UDP disconnection
*/
probe udp.disconnect.return = kernel.function("udp_disconnect").return {
name = "udp.disconnect"