summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/SystemTap_Tapset_Reference/en-US/Introduction.xml29
-rw-r--r--doc/SystemTap_Tapset_Reference/en-US/Tapset_Reference.xml1
-rw-r--r--doc/SystemTap_Tapset_Reference/en-US/timestamp.xml50
-rw-r--r--tapset/timestamp.stp52
4 files changed, 114 insertions, 18 deletions
diff --git a/doc/SystemTap_Tapset_Reference/en-US/Introduction.xml b/doc/SystemTap_Tapset_Reference/en-US/Introduction.xml
index 4256d8ea..84e960d4 100644
--- a/doc/SystemTap_Tapset_Reference/en-US/Introduction.xml
+++ b/doc/SystemTap_Tapset_Reference/en-US/Introduction.xml
@@ -3,16 +3,21 @@
]>
<chapter id="introduction">
- <title>Introduction</title>
- <para>
- SystemTap is a tracing and probing tool that allows users to
- study and monitor the activities of the operating system
- (particularly, the kernel) in fine detail. It provides
- information similar to the output of tools like
- <command>netstat</command>, <command>ps</command>,
- <command>top</command>, and <command>iostat</command>; however,
- SystemTap is designed to provide more filtering and analysis
- options for collected information.
- </para>
-</chapter>
+ <title>Introduction</title>
+ <para>
+ SystemTap provides free software (GPL) infrastructure to simplify the
+ gathering of information about the running Linux system. This assists
+ diagnosis of a performance or functional problem. SystemTap eliminates the
+ need for the developer to go through the tedious and disruptive instrument,
+ recompile, install, and reboot sequence that may be otherwise required to
+ collect data.
+ </para>
+ <para>
+ SystemTap provides a simple command line interface and scripting language
+ for writing instrumentation for a live running kernel. The instrumentation
+ makes extensive use of the probe points and functions provided in the
+ <firstterm>tapset</firstterm> library. This document describes the various
+ probe points and functions.
+ </para>
+</chapter>
diff --git a/doc/SystemTap_Tapset_Reference/en-US/Tapset_Reference.xml b/doc/SystemTap_Tapset_Reference/en-US/Tapset_Reference.xml
index 2f7e9cfa..4603b238 100644
--- a/doc/SystemTap_Tapset_Reference/en-US/Tapset_Reference.xml
+++ b/doc/SystemTap_Tapset_Reference/en-US/Tapset_Reference.xml
@@ -7,6 +7,7 @@
<xi:include href="Book_Info.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Preface.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Introduction.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+<xi:include href="timestamp.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Revision_History.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<index />
</book>
diff --git a/doc/SystemTap_Tapset_Reference/en-US/timestamp.xml b/doc/SystemTap_Tapset_Reference/en-US/timestamp.xml
new file mode 100644
index 00000000..198b54d9
--- /dev/null
+++ b/doc/SystemTap_Tapset_Reference/en-US/timestamp.xml
@@ -0,0 +1,50 @@
+<?xml version='1.0'?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<!-- This file is extracted from the tapset files
+ Do not modify this file -->
+<chapter id="timestamp_stp">
+ <title>Timestamp Functions</title>
+ <para>
+ Each timestamp function returns a value to indicate when
+ the function is executed.
+ Thus, these returned values can be used to indicate
+ when an event occurs, provide an ordering for events, or compute
+ the amount of time elapsed between to time stamps.
+ </para>
+<formalpara>
+ <title>get_cycles:long()</title>
+ <indexterm><primary>get_cycles</primary></indexterm>
+ <para>
+ Return the processor cycle counter value, or 0 if unavailable.
+ </para>
+</formalpara>
+<formalpara>
+ <title>gettimeofday_ns:long ()</title>
+ <indexterm><primary>gettimeofday_ns</primary></indexterm>
+ <para>
+ Return the number of nanoseconds since the UNIX epoch.
+ </para>
+</formalpara>
+<formalpara>
+ <title>gettimeofday_us:long ()</title>
+ <indexterm><primary>gettimeofday_us</primary></indexterm>
+ <para>
+ Return the number of microseconds since the UNIX epoch.
+ </para>
+</formalpara>
+<formalpara>
+ <title>gettimeofday_ms:long ()</title>
+ <indexterm><primary>gettimeofday_ms</primary></indexterm>
+ <para>
+ Return the number of milliseconds since the UNIX epoch.
+ </para>
+</formalpara>
+<formalpara>
+ <title>gettimeofday_s:long ()</title>
+ <indexterm><primary>gettimeofday_s</primary></indexterm>
+ <para>
+ Return the number of seconds since the UNIX epoch.
+ </para>
+</formalpara>
+</chapter>
diff --git a/tapset/timestamp.stp b/tapset/timestamp.stp
index 8db0faef..5eb0bfcc 100644
--- a/tapset/timestamp.stp
+++ b/tapset/timestamp.stp
@@ -7,39 +7,79 @@
// Public License (GPL); either version 2, or (at your option) any
// later version.
+///<chapter id="timestamp_stp">
+/// <title>Timestamp Functions</title>
+/// <para>
+/// Each timestamp function returns a value to indicate when
+/// the function is executed.
+/// Thus, these returned values can be used to indicate
+/// when an event occurs, provide an ordering for events, or compute
+/// the amount of time elapsed between to time stamps.
+/// </para>
%{
#include <linux/time.h>
%}
-
-// return processor cycle counter (if any)
+///<formalpara>
+/// <title>get_cycles:long()</title>
+/// <indexterm><primary>get_cycles</primary></indexterm>
+/// <para>
+/// Return the processor cycle counter value, or 0 if unavailable.
+/// </para>
+///</formalpara>
function get_cycles:long () %{ /* pure */
cycles_t c = get_cycles();
THIS->__retvalue = (int64_t) c;
%}
-// return in nanoseconds since epoch
+///<formalpara>
+/// <title>gettimeofday_ns:long ()</title>
+/// <indexterm><primary>gettimeofday_ns</primary></indexterm>
+/// <para>
+/// Return the number of nanoseconds since the UNIX epoch.
+/// </para>
+///</formalpara>
function gettimeofday_ns:long () %{ /* pure */
/* NOTE: we can't use do_gettimeofday because we could be called from a
* context where xtime_lock is already held. See bug #2525. */
THIS->__retvalue = _stp_gettimeofday_ns();
%}
-// return in microseconds since epoch
+///<formalpara>
+/// <title>gettimeofday_us:long ()</title>
+/// <indexterm><primary>gettimeofday_us</primary></indexterm>
+/// <para>
+/// Return the number of microseconds since the UNIX epoch.
+/// </para>
+///</formalpara>
function gettimeofday_us:long () {
return gettimeofday_ns() / 1000;
}
-// return in milliseconds since epoch
+///<formalpara>
+/// <title>gettimeofday_ms:long ()</title>
+/// <indexterm><primary>gettimeofday_ms</primary></indexterm>
+/// <para>
+/// Return the number of milliseconds since the UNIX epoch.
+/// </para>
+///</formalpara>
function gettimeofday_ms:long () {
return gettimeofday_ns() / 1000000;
}
-// return in seconds since epoch
+///<formalpara>
+/// <title>gettimeofday_s:long ()</title>
+/// <indexterm><primary>gettimeofday_s</primary></indexterm>
+/// <para>
+/// Return the number of seconds since the UNIX epoch.
+/// </para>
+///</formalpara>
function gettimeofday_s:long () {
return gettimeofday_ns() / 1000000000;
}
// likewise jiffies, monotonic_clock ...
+
+///</chapter>