From b910f55bd84a55d8e916e8e6ad839305b1edc708 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 11 Nov 2008 11:31:16 -0500 Subject: Document timestamp.stp. --- .../en-US/Introduction.xml | 29 +++++++----- .../en-US/Tapset_Reference.xml | 1 + doc/SystemTap_Tapset_Reference/en-US/timestamp.xml | 50 +++++++++++++++++++++ tapset/timestamp.stp | 52 +++++++++++++++++++--- 4 files changed, 114 insertions(+), 18 deletions(-) create mode 100644 doc/SystemTap_Tapset_Reference/en-US/timestamp.xml 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 @@ ]> - Introduction - - 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 - netstat, ps, - top, and iostat; however, - SystemTap is designed to provide more filtering and analysis - options for collected information. - - + Introduction + + 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. + + + 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 + tapset library. This document describes the various + probe points and functions. + + 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 @@ + 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 @@ + + + + + Timestamp Functions + + 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. + + + get_cycles:long() + get_cycles + + Return the processor cycle counter value, or 0 if unavailable. + + + + gettimeofday_ns:long () + gettimeofday_ns + + Return the number of nanoseconds since the UNIX epoch. + + + + gettimeofday_us:long () + gettimeofday_us + + Return the number of microseconds since the UNIX epoch. + + + + gettimeofday_ms:long () + gettimeofday_ms + + Return the number of milliseconds since the UNIX epoch. + + + + gettimeofday_s:long () + gettimeofday_s + + Return the number of seconds since the UNIX epoch. + + + 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. +/// +/// Timestamp Functions +/// +/// 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. +/// %{ #include %} - -// return processor cycle counter (if any) +/// +/// get_cycles:long() +/// get_cycles +/// +/// Return the processor cycle counter value, or 0 if unavailable. +/// +/// function get_cycles:long () %{ /* pure */ cycles_t c = get_cycles(); THIS->__retvalue = (int64_t) c; %} -// return in nanoseconds since epoch +/// +/// gettimeofday_ns:long () +/// gettimeofday_ns +/// +/// Return the number of nanoseconds since the UNIX epoch. +/// +/// 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 +/// +/// gettimeofday_us:long () +/// gettimeofday_us +/// +/// Return the number of microseconds since the UNIX epoch. +/// +/// function gettimeofday_us:long () { return gettimeofday_ns() / 1000; } -// return in milliseconds since epoch +/// +/// gettimeofday_ms:long () +/// gettimeofday_ms +/// +/// Return the number of milliseconds since the UNIX epoch. +/// +/// function gettimeofday_ms:long () { return gettimeofday_ns() / 1000000; } -// return in seconds since epoch +/// +/// gettimeofday_s:long () +/// gettimeofday_s +/// +/// Return the number of seconds since the UNIX epoch. +/// +/// function gettimeofday_s:long () { return gettimeofday_ns() / 1000000000; } // likewise jiffies, monotonic_clock ... + +/// -- cgit