Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 History  





2 Usage  





3 Simple examples  





4 Importing scripts from other tracing technologies  





5 See also  





6 References  





7 External links  














SystemTap






Español

Norsk bokmål
Русский
Suomi
 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


SystemTap
Initial release2005 (2005)
Stable release

5.1 / April 26, 2024; 2 months ago (2024-04-26)

Repository
Written inC, C++
Operating systemLinux
TypeTracing programming language
LicenseGNU General Public License
Websitesourceware.org/systemtap/

Incomputing, SystemTap (stap) is a scripting language and tool for dynamically instrumenting running production Linux-based operating systems. System administrators can use SystemTap to extract, filter and summarize data in order to enable diagnosis of complex performance or functional problems.

SystemTap consists of free and open-source software and includes contributions from Red Hat, IBM, Intel, Hitachi, Oracle, the University of Wisconsin-Madison and other community members.[1]

History[edit]

SystemTap debuted in 2005 in Red Hat Enterprise Linux 4 Update 2 as a technology preview.[2]

After four years in development, SystemTap 1.0 was released in 2009.[3]

As of 2011, SystemTap runs fully supported in all Linux distributions including RHEL / CentOS5[4] since update 2, SLES 10,[5] Fedora, Debian and Ubuntu.

Tracepoints in the CPython VM and JVM were added in SystemTap 1.2 in 2009.[6]

In November 2019, SystemTap 4.2 included prometheus exporter.

Usage[edit]

SystemTap files are written in the SystemTap language[7] (saved as .stp files) and run with the stap command-line.[8]

The system carries out a number of analysis passes on the script before allowing it to run. Scripts may be executed with one of three backends selected by the --runtime= option. The default is a loadable kernel module, which has the fullest capability to inspect and manipulate any part of the system, and therefore requires most privilege. Another backend is based on the dynamic program analysis library DynInst to instrument the user's own user-space programs only, and requires least privilege. The newest backend[9] is based on eBPF byte-code, is limited to the Linux kernel interpreter's capabilities, and requires an intermediate level of privilege. In each case, the module is unloaded when the script has finished running.

Scripts generally focus on events (such as starting or finishing a script), compiled-in probe points such as Linux "tracepoints", or the execution of functions or statements in the kernel or user-space.

Some "guru mode" scripts may also have embedded C, which may run with the -g command-line option. However, use of guru mode is discouraged, and each SystemTap release includes more probe points designed to remove the need for guru-mode scripts. Guru mode is required in order to permit scripts to modify state in the instrumented software, such as to apply some types of emergency security fixes.

As of SystemTap version 1.7, the software implements the new stapsys group and privilege level.[10]

Simple examples[edit]

The following script shows all applications setting TCP socket options on the system, what options are being set, and whether the option is set successfully or not.

# Show sockets setting options

# Return enabled or disabled based on value of optval
function getstatus(optval)
{
    if ( optval == 1 )
        return "enabling"
    else
        return "disabling"
}

probe begin
{
 print ("\nChecking for apps setting socket options\n")
}

    # Set a socket option
    probe tcp.setsockopt
    {
        status = getstatus(user_int($optval))
     printf ("  App '%s' (PID %d) is %s socket option %s... ", execname(), pid(), status, optstr)
    }
    
        # Check setting the socket option worked
        probe tcp.setsockopt.return
        {
            if ( ret == 0 )
                printf ("success")
            else
                printf ("failed")
            printf ("\n")
        }

probe end
{
 print ("\nClosing down\n")
}

Many other examples are shipped with SystemTap.[11] There are also real-world examples of SystemTap use at the War Stories page.[12]

Importing scripts from other tracing technologies[edit]

SystemTap can attach to DTrace markers when they are compiled into an application using macros from the sys/sdt.h header file.

See also[edit]

References[edit]

  1. ^ "A SystemTap update". LWN.net.
  • ^ "Product Documentation for Red Hat Enterprise Linux". Red Hat.
  • ^ "Josh Stone - SystemTap release 1.0".
  • ^ "Product Documentation". Red Hat.
  • ^ "Optional update for SystemTap". Novell. 10 October 2006.
  • ^ "Features/SystemtapStaticProbes - FedoraProject". Fedoraproject.
  • ^ "SystemTap Language Reference".
  • ^ Compare Romans, Robb (2009). "SystemTap Language Reference: A guide to the constructs and syntax used in SystemTap scripts". Red Hat: 4. CiteSeerX 10.1.1.172.5186. SystemTap [...] requires root privileges to actually run the kernel objects it builds using the sudo command, applied to the staprun program.[...] staprun is a part of the SystemTap package, dedicated to module loading and unloading and kernel-touser data transfer. {{cite journal}}: Cite journal requires |journal= (help)
  • ^ Merey, Aaron (2017-10-18). "systemtap 3.2 release". Retrieved 2017-10-18. The systemtap team announces release 3.2 [...] early experimental eBPF (extended Berkeley Packet Filter) backend [...][permanent dead link]
  • ^ Eigler, Frank Ch. (2012-02-01). "systemtap 1.7 release". Retrieved 2013-03-26. The systemtap team announces release 1.7 [...] The new group and privilege level "stapsys" has been added [...]
  • ^ "SystemTap Examples".
  • ^ "WarStories - Systemtap Wiki".
  • External links[edit]


    Retrieved from "https://en.wikipedia.org/w/index.php?title=SystemTap&oldid=1220948208"

    Categories: 
    Free software programmed in C++
    Free system software
    Debuggers
    Linux kernel features
    Linux-only free software
    Hidden categories: 
    CS1 errors: missing periodical
    All articles with dead external links
    Articles with dead external links from March 2023
    Articles with permanently dead external links
    Articles with short description
    Short description matches Wikidata
    Articles containing potentially dated statements from 2011
    All articles containing potentially dated statements
    Webarchive template wayback links
     



    This page was last edited on 26 April 2024, at 22:32 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki