summaryrefslogtreecommitdiffstats
path: root/SystemTap_Beginners_Guide/iotimesect.html
diff options
Diffstat (limited to 'SystemTap_Beginners_Guide/iotimesect.html')
-rw-r--r--SystemTap_Beginners_Guide/iotimesect.html19
1 files changed, 9 insertions, 10 deletions
diff --git a/SystemTap_Beginners_Guide/iotimesect.html b/SystemTap_Beginners_Guide/iotimesect.html
index 0d10d5f7..3b65d433 100644
--- a/SystemTap_Beginners_Guide/iotimesect.html
+++ b/SystemTap_Beginners_Guide/iotimesect.html
@@ -1,8 +1,7 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.2.2. Tracking I/O Time For Each File Read or Write</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-disk.html" title="5.2. Disk" /><link rel="prev" href="mainsect-disk.html" title="5.2. Disk" /><link rel="next" href="traceiosect.html" title="5.2.3. Track Cumulative IO" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="mainsect-disk.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="traceiosect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="iotimesect"></a>5.2.2. Tracking I/O Time For Each File Read or Write</h3></div></div></div><a id="idm246914224016" class="indexterm"></a><a id="idm246929512688" class="indexterm"></a><a id="idm246912282288" class="indexterm"></a><a id="idm246912283376" class="indexterm"></a><a id="idm246911814368" class="indexterm"></a><div class="para">
3<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>5.2.2. Tracking I/O Time For Each File Read or Write</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta name="generator" content="publican 2.8" /><meta name="package" content="Systemtap-SystemTap_Beginners_Guide-2.2-en-US-2.2-2" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-disk.html" title="5.2. Disk" /><link rel="prev" href="mainsect-disk.html" title="5.2. Disk" /><link rel="next" href="traceiosect.html" title="5.2.3. Track Cumulative IO" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img src="Common_Content/images/image_left.png" alt="Product Site" /></a><a class="right" href="https://fedorahosted.org/publican"><img src="Common_Content/images/image_right.png" alt="Documentation Site" /></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="mainsect-disk.html"><strong>Prev</strong></a></li><li class="next"><a accesskey="n" href="traceiosect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" id="iotimesect" lang="en-US"><div class="titlepage"><div><div><h3 class="title" id="iotimesect">5.2.2. Tracking I/O Time For Each File Read or Write</h3></div></div></div><a id="idp58392768" class="indexterm"></a><a id="idp26310352" class="indexterm"></a><a id="idp35524800" class="indexterm"></a><a id="idp56877088" class="indexterm"></a><a id="idp36194832" class="indexterm"></a><div class="para"> 3 This section describes how to monitor the amount of time it takes for each process to read from or write to any file. This is useful to determine what files are slow to load on a given system.
4 This section describes how to monitor the amount of time it takes for each process to read from or write to any file. This is useful if you wish to determine what files are slow to load on a given system. 4 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">iotime.stp</div>
5 </div><div class="formalpara" id="iotime"><h5 class="formalpara">iotime.stp</h5>
6 5
7<pre class="programlisting">#! /usr/bin/env stap 6<pre class="programlisting">#! /usr/bin/env stap
8 7
@@ -91,9 +90,9 @@ probe syscall.close {
91</pre> 90</pre>
92 </div><div class="para"> 91 </div><div class="para">
93 <a class="xref" href="iotimesect.html#iotime">iotime.stp</a> tracks each time a system call opens, closes, reads from, and writes to a file. For each file any system call accesses, <a class="xref" href="iotimesect.html#iotime">iotime.stp</a> counts the number of microseconds it takes for any reads or writes to finish and tracks the amount of data (in bytes) read from or written to the file. 92 <a class="xref" href="iotimesect.html#iotime">iotime.stp</a> tracks each time a system call opens, closes, reads from, and writes to a file. For each file any system call accesses, <a class="xref" href="iotimesect.html#iotime">iotime.stp</a> counts the number of microseconds it takes for any reads or writes to finish and tracks the amount of data (in bytes) read from or written to the file.
94 </div><a id="idp62746528" class="indexterm"></a><a id="idm3938304" class="indexterm"></a><a id="idp32882944" class="indexterm"></a><div class="para"> 93 </div><a id="idm246875163184" class="indexterm"></a><a id="idm246869037504" class="indexterm"></a><a id="idm246927603008" class="indexterm"></a><div class="para">
95 <a class="xref" href="iotimesect.html#iotime">iotime.stp</a> also uses the local variable <code class="command">$count</code> to track the amount of data (in bytes) that any system call <span class="emphasis"><em>attempts</em></span> to read or write. Note that <code class="command">$return</code> (as used in <a class="xref" href="mainsect-disk.html#scriptdisktop">disktop.stp</a> from <a class="xref" href="mainsect-disk.html#disktop">Section 5.2.1, “Summarizing Disk Read/Write Traffic”</a>) stores the <span class="emphasis"><em>actual</em></span> amount of data read/written. <code class="command">$count</code> can only be used on probes that track data reads or writes (e.g. <code class="command">syscall.read</code> and <code class="command">syscall.write</code>). 94 <a class="xref" href="iotimesect.html#iotime">iotime.stp</a> also uses the local variable <code class="command">$count</code> to track the amount of data (in bytes) that any system call <span class="emphasis"><em>attempts</em></span> to read or write. Note that <code class="command">$return</code> (as used in <a class="xref" href="mainsect-disk.html#scriptdisktop">disktop.stp</a> from <a class="xref" href="mainsect-disk.html#disktop">Section 5.2.1, “Summarizing Disk Read/Write Traffic”</a>) stores the <span class="emphasis"><em>actual</em></span> amount of data read/written. <code class="command">$count</code> can only be used on probes that track data reads or writes (that is, <code class="command">syscall.read</code> and <code class="command">syscall.write</code>).
96 </div><div class="example" id="iotimeoutput"><h6>Example 5.7. <a class="xref" href="iotimesect.html#iotime">iotime.stp</a> Sample Output</h6><div class="example-contents"><pre class="screen">[...] 95 </div><div class="example"><a id="iotimeoutput"></a><p class="title"><strong>Example 5.7. <a class="xref" href="iotimesect.html#iotime">iotime.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">[...]
97825946 3364 (NetworkManager) access /sys/class/net/eth0/carrier read: 8190 write: 0 96825946 3364 (NetworkManager) access /sys/class/net/eth0/carrier read: 8190 write: 0
98825955 3364 (NetworkManager) iotime /sys/class/net/eth0/carrier time: 9 97825955 3364 (NetworkManager) iotime /sys/class/net/eth0/carrier time: 9
99[...] 98[...]
@@ -104,7 +103,7 @@ probe syscall.close {
1043973744 2886 (sendmail) iotime /proc/loadavg time: 11 1033973744 2886 (sendmail) iotime /proc/loadavg time: 11
105[...]</pre></div></div><br class="example-break" /><div class="para"> 104[...]</pre></div></div><br class="example-break" /><div class="para">
106 <a class="xref" href="iotimesect.html#iotimeoutput">Example 5.7, “iotime.stp Sample Output”</a> prints out the following data: 105 <a class="xref" href="iotimesect.html#iotimeoutput">Example 5.7, “iotime.stp Sample Output”</a> prints out the following data:
107 </div><div class="itemizedlist"><ul><li class="listitem"><div class="para"> 106 </div><div xmlns:d="http://docbook.org/ns/docbook" class="itemizedlist"><ul><li class="listitem"><div class="para">
108 A timestamp, in microseconds. 107 A timestamp, in microseconds.
109 </div></li><li class="listitem"><div class="para"> 108 </div></li><li class="listitem"><div class="para">
110 Process ID and process name. 109 Process ID and process name.
@@ -115,5 +114,5 @@ probe syscall.close {
115 </div></li></ul></div><div class="para"> 114 </div></li></ul></div><div class="para">
116 If a process was able to read or write any data, a pair of <code class="computeroutput">access</code> and <code class="computeroutput">iotime</code> lines should appear together. The <code class="computeroutput">access</code> line's timestamp refers to the time that a given process started accessing a file; at the end of the line, it will show the amount of data read/written (in bytes). The <code class="computeroutput">iotime</code> line will show the amount of time (in microseconds) that the process took in order to perform the read or write. 115 If a process was able to read or write any data, a pair of <code class="computeroutput">access</code> and <code class="computeroutput">iotime</code> lines should appear together. The <code class="computeroutput">access</code> line's timestamp refers to the time that a given process started accessing a file; at the end of the line, it will show the amount of data read/written (in bytes). The <code class="computeroutput">iotime</code> line will show the amount of time (in microseconds) that the process took in order to perform the read or write.
117 </div><div class="para"> 116 </div><div class="para">
118 If an <code class="computeroutput">access</code> line is not followed by an <code class="computeroutput">iotime</code> line, it simply means that the process did not read or write any data. 117 If an <code class="computeroutput">access</code> line is not followed by an <code class="computeroutput">iotime</code> line, it means that the process did not read or write any data.
119 </div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="mainsect-disk.html"><strong>Prev</strong>5.2. Disk</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="traceiosect.html"><strong>Next</strong>5.2.3. Track Cumulative IO</a></li></ul></body></html> 118 </div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="mainsect-disk.html"><strong>Prev</strong>5.2. Disk</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="traceiosect.html"><strong>Next</strong>5.2.3. Track Cumulative IO</a></li></ul></body></html> \ No newline at end of file