<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.11" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: strace: The Friend You Never Knew You Had</title>
	<link>http://www.linux-mag.com/id/5509/</link>
	<description>Open Source, Open Standards</description>
	<pubDate>Sun, 18 May 2008 15:18:03 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.11</generator>

	<item>
		<title>by: tothzp</title>
		<link>http://www.linux-mag.com/id/5509/#comment-954</link>
		<pubDate>Tue, 01 Apr 2008 09:25:00 +0000</pubDate>
		<guid>http://www.linux-mag.com/id/5509/#comment-954</guid>
					<description>1. A pretty big amount of data can be written to the buffer cache first. So when write() returns you don't know if the data has been physically written to the disk or not. (Except if you flush your file to disk, e.g. with the &lt;i&gt;fsync()&lt;/i&gt; or &lt;i&gt;fdatasync()&lt;i&gt; function.)

2. &lt;b&gt;strace&lt;/b&gt; can be also used to collect statistics about the time spent in different system calls. Use the -c option for that:

&lt;code&gt;
# strace -p 16640 -c

Process 16640 attached - interrupt to quit
Process 16640 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 36.72    0.649557          36     17944           epoll_wait
 33.40    0.590959           7     85036           gettimeofday
 21.75    0.384777          16     23568           writev
  6.65    0.117595           6     19767           recv
  1.48    0.026198           8      3354           time
------ ----------- ----------- --------- --------- ----------------
100.00    1.769086                149669           total
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>1. A pretty big amount of data can be written to the buffer cache first. So when write() returns you don&#8217;t know if the data has been physically written to the disk or not. (Except if you flush your file to disk, e.g. with the <i>fsync()</i> or <i>fdatasync()</i><i> function.)</p>
<p>2. <b>strace</b> can be also used to collect statistics about the time spent in different system calls. Use the -c option for that:</p>
<p><code><br />
# strace -p 16640 -c</p>
<p>Process 16640 attached - interrupt to quit<br />
Process 16640 detached<br />
% time     seconds  usecs/call     calls    errors syscall<br />
------ ----------- ----------- --------- --------- ----------------<br />
 36.72    0.649557          36     17944           epoll_wait<br />
 33.40    0.590959           7     85036           gettimeofday<br />
 21.75    0.384777          16     23568           writev<br />
  6.65    0.117595           6     19767           recv<br />
  1.48    0.026198           8      3354           time<br />
------ ----------- ----------- --------- --------- ----------------<br />
100.00    1.769086                149669           total<br />
</code></i>
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: tombauer</title>
		<link>http://www.linux-mag.com/id/5509/#comment-953</link>
		<pubDate>Tue, 01 Apr 2008 04:28:03 +0000</pubDate>
		<guid>http://www.linux-mag.com/id/5509/#comment-953</guid>
					<description>I think an interesting question would be why does the compiler create code that does the write with two write system calls.  Why not one?  And what is special about 388K?  Hmmm.</description>
		<content:encoded><![CDATA[<p>I think an interesting question would be why does the compiler create code that does the write with two write system calls.  Why not one?  And what is special about 388K?  Hmmm.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: ohmay</title>
		<link>http://www.linux-mag.com/id/5509/#comment-947</link>
		<pubDate>Fri, 28 Mar 2008 18:51:33 +0000</pubDate>
		<guid>http://www.linux-mag.com/id/5509/#comment-947</guid>
					<description>And for such "small" writes, how interacts the buffer-cache? In the article it is said that the difference between write rates are because the latency of the drive, the speed of the drive and this kind of things. 

Buf for small writes the data writed shouldn't be writed on buffer-cache?, and because of that at memory speed? Perhaps I'm wrong, but I think that the difference between write rates might be related to the initialization of I/O functions.

In any case, great article.</description>
		<content:encoded><![CDATA[<p>And for such &#8220;small&#8221; writes, how interacts the buffer-cache? In the article it is said that the difference between write rates are because the latency of the drive, the speed of the drive and this kind of things. </p>
<p>Buf for small writes the data writed shouldn&#8217;t be writed on buffer-cache?, and because of that at memory speed? Perhaps I&#8217;m wrong, but I think that the difference between write rates might be related to the initialization of I/O functions.</p>
<p>In any case, great article.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Marcin Owsiany</title>
		<link>http://www.linux-mag.com/id/5509/#comment-942</link>
		<pubDate>Fri, 28 Mar 2008 12:45:06 +0000</pubDate>
		<guid>http://www.linux-mag.com/id/5509/#comment-942</guid>
					<description>There is 'ltrace' as well. More useful sometimes.</description>
		<content:encoded><![CDATA[<p>There is &#8216;ltrace&#8217; as well. More useful sometimes.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: parmando</title>
		<link>http://www.linux-mag.com/id/5509/#comment-933</link>
		<pubDate>Fri, 28 Mar 2008 10:31:20 +0000</pubDate>
		<guid>http://www.linux-mag.com/id/5509/#comment-933</guid>
					<description>Muy bueno, me di cuenta de varias cosas que pasaba por alto al ver la salida de strace!!</description>
		<content:encoded><![CDATA[<p>Muy bueno, me di cuenta de varias cosas que pasaba por alto al ver la salida de strace!!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: gserban</title>
		<link>http://www.linux-mag.com/id/5509/#comment-929</link>
		<pubDate>Fri, 28 Mar 2008 02:01:38 +0000</pubDate>
		<guid>http://www.linux-mag.com/id/5509/#comment-929</guid>
					<description>Cool. I actually had no idea this command existed.</description>
		<content:encoded><![CDATA[<p>Cool. I actually had no idea this command existed.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
