diff options
Diffstat (limited to 'SystemTap_Beginners_Guide/iotimesect.html')
| -rw-r--r-- | SystemTap_Beginners_Guide/iotimesect.html | 12 | 
1 files changed, 7 insertions, 5 deletions
| diff --git a/SystemTap_Beginners_Guide/iotimesect.html b/SystemTap_Beginners_Guide/iotimesect.html index ca6f7a74..1529afce 100644 --- a/SystemTap_Beginners_Guide/iotimesect.html +++ b/SystemTap_Beginners_Guide/iotimesect.html | |||
| @@ -1,7 +1,8 @@ | |||
| 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"><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="idm47951455847408" class="indexterm"></a><a id="idm47951459407088" class="indexterm"></a><a id="idm47951468753488" class="indexterm"></a><a id="idm47951475916832" class="indexterm"></a><a id="idm47951455859712" class="indexterm"></a><div class="para"> | 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.1.3" /><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"> | 
| 3 | </a>5.2.2. Tracking I/O Time For Each File Read or Write</h3></div></div></div><a id="idm214018786048" class="indexterm"></a><a id="idm213974995472" class="indexterm"></a><a id="idm213978825136" class="indexterm"></a><a id="idm214007049936" class="indexterm"></a><a id="idm213968122400" 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 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="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">iotime.stp</div> | 
| 5 | 6 | ||
| 6 | <pre class="programlisting">#! /usr/bin/env stap | 7 | <pre class="programlisting">#! /usr/bin/env stap | 
| 7 | 8 | ||
| @@ -90,9 +91,10 @@ probe syscall.close { | |||
| 90 | </pre> | 91 | </pre> | 
| 91 | </div><div class="para"> | 92 | </div><div class="para"> | 
| 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. | 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. | 
| 93 | </div><a id="idm47951474974528" class="indexterm"></a><a id="idm47951456584032" class="indexterm"></a><a id="idm47951456460432" class="indexterm"></a><div class="para"> | 94 | </div><a id="idm213978404080" class="indexterm"></a><a id="idm213975012832" class="indexterm"></a><a id="idm214011661232" class="indexterm"></a><div class="para"> | 
| 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>). | 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 (that is, <code class="command">syscall.read</code> and <code class="command">syscall.write</code>). | 
| 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">[...] | 96 | </div><div class="example"><a id="iotimeoutput"> | 
| 97 | </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">[...] | ||
| 96 | 825946 3364 (NetworkManager) access /sys/class/net/eth0/carrier read: 8190 write: 0 | 98 | 825946 3364 (NetworkManager) access /sys/class/net/eth0/carrier read: 8190 write: 0 | 
| 97 | 825955 3364 (NetworkManager) iotime /sys/class/net/eth0/carrier time: 9 | 99 | 825955 3364 (NetworkManager) iotime /sys/class/net/eth0/carrier time: 9 | 
| 98 | [...] | 100 | [...] | 
| @@ -101,7 +103,7 @@ probe syscall.close { | |||
| 101 | [...] | 103 | [...] | 
| 102 | 3973737 2886 (sendmail) access /proc/loadavg read: 4096 write: 0 | 104 | 3973737 2886 (sendmail) access /proc/loadavg read: 4096 write: 0 | 
| 103 | 3973744 2886 (sendmail) iotime /proc/loadavg time: 11 | 105 | 3973744 2886 (sendmail) iotime /proc/loadavg time: 11 | 
| 104 | [...]</pre></div></div><br class="example-break" /><div class="para"> | 106 | [...]</pre></div></div><div class="para"> | 
| 105 | <a class="xref" href="iotimesect.html#iotimeoutput">Example 5.7, “iotime.stp Sample Output”</a> prints out the following data: | 107 | <a class="xref" href="iotimesect.html#iotimeoutput">Example 5.7, “iotime.stp Sample Output”</a> prints out the following data: | 
| 106 | </div><div xmlns:d="http://docbook.org/ns/docbook" class="itemizedlist"><ul><li class="listitem"><div class="para"> | 108 | </div><div xmlns:d="http://docbook.org/ns/docbook" class="itemizedlist"><ul><li class="listitem"><div class="para"> | 
| 107 | A timestamp, in microseconds. | 109 | A timestamp, in microseconds. | 
