Content deleted Content added
Tech201805 (talk | contribs) →History: Prometheus exporter Tags: Mobile edit Mobile web edit Advanced mobile edit |
mNo edit summary |
||
(21 intermediate revisions by 14 users not shown) | |||
Line 1:
{{short description|Scripting language and tool}}
{{Infobox software
| name = SystemTap
| logo = Smileytap.svg
| screenshot =
| released = {{Start date|2005}}
| latest release version =
| latest release date = {{Start date and age|
| programming language = [[C (programming language)|C]], [[C++]]
| operating system = [[Linux]]
| language =
| genre = [[Tracing (software)|Tracing]] [[programming language]]
| license = [[GNU General Public License]]
| website = {{URL|
}}
In [[computing]], '''SystemTap''' (<code>stap</code>) is a [[scripting language]] and [[tool]] for dynamically [[Instrumentation (computer programming)|instrumenting]] running production [[Linux kernel]]-based [[operating system]]s. System administrators can use SystemTap to extract, filter and summarize data in order to enable diagnosis of complex performance or functional problems.▼
▲In [[computing]], '''SystemTap''' (
SystemTap consists of [[free and open-source software]] and includes contributions from [[Red Hat]], [[IBM]], [[Intel]], [[Hitachi, Ltd|Hitachi]], [[Oracle Corporation|Oracle]], and other community members.<ref>{{cite web|url=https://lwn.net/Articles/315022/|title=A SystemTap update|publisher=[[lwn.net]]}}</ref>▼
▲SystemTap consists of [[free and open-source software]] and includes contributions from [[Red Hat]], [[IBM]], [[Intel]], [[Hitachi, Ltd|Hitachi]], [[Oracle Corporation|Oracle]], the University of Wisconsin-Madison and other community members.<ref>{{cite web|url=https://lwn.net/Articles/315022/|title=A SystemTap update|publisher=[[
==History==
SystemTap debuted in 2005 in [[Red Hat Enterprise Linux]] 4 Update 2 as a technology preview.<ref>{{cite web|url=http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/release-notes/as-x86/RELEASE-NOTES-U2-x86-en.html|title=Product Documentation for Red Hat Enterprise Linux|publisher=[[Red Hat]]}}</ref>
After four years in development, SystemTap 1.0 was released in 2009.<ref>{{cite web|url=http://sourceware.org/ml/systemtap/2009-q3/msg00831.html|title=Josh Stone - SystemTap release 1.0
{{As of
Tracepoints in the [[CPython]] VM and [[JVM]] were added in SystemTap 1.2 in 2009.<ref>{{cite web|url=http://fedoraproject.org/wiki/Features/SystemtapStaticProbes|title=Features/SystemtapStaticProbes - FedoraProject|publisher=Fedoraproject}}</ref>
In November 2019, SystemTap 4.2
==Usage==
SystemTap files are written in the SystemTap language
| title
▲| title = SystemTap Language Reference: A guide to the constructs and syntax used in SystemTap scripts
|
▲| last = Romans
|
| quote
▲| publisher = Red Hat
| citeseerx = 10.1.1.172.5186}}</ref>
▲| page = 4
| format = PDF▼
The system carries out a number of analysis passes on the script before allowing it to run.
|url
▲| quote = 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.
▲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 <code>--runtime=</code> 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<ref>
▲ |url = https://sourceware.org/ml/systemtap/2017-q4/msg00096.htmlq1/msg00097.html
|quote
▲ |title = systemtap 3.2 release
}}{{Dead link|date=March 2023 |bot=InternetArchiveBot |fix-attempted=yes }}</ref> is based on [[
▲ |last1 = Merey
▲ |date = 2017-10-18
▲ |accessdate = 2017-10-18
▲ |quote = The systemtap team announces release 3.2 [...] early experimental eBPF (extended Berkeley Packet Filter) backend [...]
▲</ref> is based on [[Berkeley_Packet_Filter#EBPF|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 <code>-g</code> 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.
As of
| url = http://sourceware.org/ml/systemtap/2012-q1/msg00097.html
|
|
|
|
| access-date
| quote
▲ |quote = The systemtap team announces release 1.7 [...] The new group and privilege level "stapsys" has been added [...]
==Simple examples==
The following script shows all applications setting [[Transmission Control Protocol|TCP]] [[network socket|socket]] options on the system, what options are being set, and whether the option is set successfully or not
<
# Show sockets setting options
Line 112 ⟶ 105:
print ("\nClosing down\n")
}
</syntaxhighlight>
Many other examples are shipped with SystemTap.<ref>{{cite web|url=
==Importing scripts from other tracing technologies==
Line 131 ⟶ 124:
==External links==
*
* [
* [
* [http://www.ohloh.net/p/systemtap SystemTap project analysis by Ohloh]
* [https://myaut.github.io/dtrace-stap-book Dynamic Tracing with DTrace & SystemTap]
* [
* [
* [https://www.kernel.org/doc/ols/2006/ols2006v1-pages-261-268.pdf ''Problem Solving With Systemtap''], [http://www.linuxsymposium.org/ Ottawa Linux Symposium] {{Webarchive|url=https://web.archive.org/web/20080913185728/http://www.linuxsymposium.org/ |date=2008-09-13 }} 2006
* [http://sources.redhat.com/systemtap/wiki/RedHatSummit2007?action=AttachFile&do=get&target=RHSummit07-ETSystemTap.pdf ''Problem Solving with SystemTap''] {{Webarchive|url=https://web.archive.org/web/20120222005620/http://sources.redhat.com/systemtap/wiki/RedHatSummit2007?action=AttachFile&do=get&target=RHSummit07-ETSystemTap.pdf |date=2012-02-22 }}, Eugene Teo, presented at the [http://www.redhat.com/summit/ Red Hat Summit] 2007 ([
* [
* [
{{Linux kernel}}
Line 149 ⟶ 142:
[[Category:Debuggers]]
[[Category:Linux kernel features]]
[[Category:Linux-only free software]]
|