<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Intro to IO Profiling of Applications</title>
	<atom:link href="http://www.linux-mag.com/id/7718/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.linux-mag.com/id/7718/</link>
	<description>Open Source, Open Standards</description>
	<lastBuildDate>Sat, 05 Oct 2013 13:48:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<item>
		<title>By: Kern Sibbald</title>
		<link>http://www.linux-mag.com/id/7718/#comment-224525</link>
		<dc:creator>Kern Sibbald</dc:creator>
		<pubDate>Fri, 18 May 2012 07:45:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.linux-mag.com/id/7718/#comment-224525</guid>
		<description>Hmm. This article is a bit old, but I stumbled across it.  Having written my own fwrite routine in 1982, I can make a good guess why glibc&#039;s fwrite splits the write into two parts.  First fwrite() is buffering writes, most likely in blocks of 4096 bytes.  When you write enough data to fwrite, at some point (probably when it is more than 4096 bytes), it will pass that data directly to the system via a write() call, but it will up to the largest multiple of 4096 bytes.  The rest of the data, in your case 2688 bytes, it keeps in its buffer waiting for more data.  In your case, the fclose() flushes those remaining 2688 bytes to disk in a second call to the kernel.</description>
		<content:encoded><![CDATA[<p>Hmm. This article is a bit old, but I stumbled across it.  Having written my own fwrite routine in 1982, I can make a good guess why glibc&#8217;s fwrite splits the write into two parts.  First fwrite() is buffering writes, most likely in blocks of 4096 bytes.  When you write enough data to fwrite, at some point (probably when it is more than 4096 bytes), it will pass that data directly to the system via a write() call, but it will up to the largest multiple of 4096 bytes.  The rest of the data, in your case 2688 bytes, it keeps in its buffer waiting for more data.  In your case, the fclose() flushes those remaining 2688 bytes to disk in a second call to the kernel.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dougalb</title>
		<link>http://www.linux-mag.com/id/7718/#comment-7967</link>
		<dc:creator>dougalb</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.linux-mag.com/id/7718/#comment-7967</guid>
		<description>&lt;p&gt;would you not consider \&#039;oprofile\&#039; or \&#039;systemtap\&#039; also effective tools for gathering IO inforamtion?
&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>would you not consider \&#8217;oprofile\&#8217; or \&#8217;systemtap\&#8217; also effective tools for gathering IO inforamtion?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: laytonjb</title>
		<link>http://www.linux-mag.com/id/7718/#comment-7968</link>
		<dc:creator>laytonjb</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.linux-mag.com/id/7718/#comment-7968</guid>
		<description>&lt;p&gt;@dougalb,&lt;/p&gt;
&lt;p&gt;Those are system profilers, not application profiles. I\&#039;m after the ability to look at what the application wants/needs. I don\&#039;t think either can do that.&lt;/p&gt;
&lt;p&gt;I haven\&#039;t used oprofile before on systems though. Looks interesting.&lt;/p&gt;
&lt;p&gt;I saw some things on lwn.net that indicate systemtap is not a favorite of many kernel hackers. I think there is something new being developed.&lt;/p&gt;
&lt;p&gt;Jeff
&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@dougalb,</p>
<p>Those are system profilers, not application profiles. I\&#8217;m after the ability to look at what the application wants/needs. I don\&#8217;t think either can do that.</p>
<p>I haven\&#8217;t used oprofile before on systems though. Looks interesting.</p>
<p>I saw some things on lwn.net that indicate systemtap is not a favorite of many kernel hackers. I think there is something new being developed.</p>
<p>Jeff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jsoda</title>
		<link>http://www.linux-mag.com/id/7718/#comment-7969</link>
		<dc:creator>jsoda</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.linux-mag.com/id/7718/#comment-7969</guid>
		<description>&lt;p&gt;the write is broken up into two calls because fwrite is a library call that executes its own logic before calling write(2).  if you replace fopen/fwrite/fclose with open/write/close and update your code accordingly, i suspect you\&#039;ll see one write.&lt;br /&gt;
page size writing alignments do not come into play at this level.
&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>the write is broken up into two calls because fwrite is a library call that executes its own logic before calling write(2).  if you replace fopen/fwrite/fclose with open/write/close and update your code accordingly, i suspect you\&#8217;ll see one write.<br />
page size writing alignments do not come into play at this level.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: laytonjb</title>
		<link>http://www.linux-mag.com/id/7718/#comment-7970</link>
		<dc:creator>laytonjb</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.linux-mag.com/id/7718/#comment-7970</guid>
		<description>&lt;p&gt;@jsoda,&lt;/p&gt;
&lt;p&gt;Thanks for the insight! Any idea why fwrite splits the write?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;Jeff
&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@jsoda,</p>
<p>Thanks for the insight! Any idea why fwrite splits the write?</p>
<p>Thanks!</p>
<p>Jeff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: john.fusco</title>
		<link>http://www.linux-mag.com/id/7718/#comment-7971</link>
		<dc:creator>john.fusco</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.linux-mag.com/id/7718/#comment-7971</guid>
		<description>&lt;p&gt;The -c option is useful for profiling as well. It doesn\&#039;t give you elapsed time with the -T option, unfortunately. However, it does give you counts which is helpful.&lt;/p&gt;
&lt;p&gt;I use it on running processes when I want to know what an unresponsive process is doing (if anything).
&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The -c option is useful for profiling as well. It doesn\&#8217;t give you elapsed time with the -T option, unfortunately. However, it does give you counts which is helpful.</p>
<p>I use it on running processes when I want to know what an unresponsive process is doing (if anything).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gordonmessmer</title>
		<link>http://www.linux-mag.com/id/7718/#comment-7972</link>
		<dc:creator>gordonmessmer</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.linux-mag.com/id/7718/#comment-7972</guid>
		<description>&lt;p&gt;Your understanding of strace seems to be slightly flawed.  It does not trace \&quot;function calls\&quot; in libraries.  Instead it traces system calls to the kernel.  If you wanted to trace library function calls you might use ltrace instead.  That\&#039;s an important distinction since there is a difference between the write() function call provided by glibc and the write() system call provided by the kernel.&lt;/p&gt;
&lt;p&gt;The dual-write call is not a function of your compiler.  Your request is passed as a single call to glibc\&#039;s fwrite(), which then decides how to pass it to the kernel.  It appears to pass one block of data which is composed of as many full filesystem blocks (gathered by the fstat() call) as possible, followed by any remaining data.  Beyond that, I don\&#039;t know why it doesn\&#039;t pass the whole request to the kernel and let Linux figure it out.&lt;/p&gt;
&lt;p&gt;You contend that there are no other tools for gathering this information, but that\&#039;s not quite true. :)&lt;/p&gt;
&lt;p&gt;As others have mentioned, Oprofile can give you a good idea of both what your application and your system are doing during its execution.  You can also use tools like gprof and valgrind (with callgrind) to get \&quot;real\&quot; profiling information and use tools that are already available for graphing and visualizing the resulting data.  Hopefully that will save you some time when writing the upcoming articles you mentioned at the end of your article.&lt;/p&gt;
&lt;p&gt;I\&#039;m very glad to see this written, and look forward to additional articles.  I fully agree that profiling is important, but widely neglected.
&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Your understanding of strace seems to be slightly flawed.  It does not trace \&#8221;function calls\&#8221; in libraries.  Instead it traces system calls to the kernel.  If you wanted to trace library function calls you might use ltrace instead.  That\&#8217;s an important distinction since there is a difference between the write() function call provided by glibc and the write() system call provided by the kernel.</p>
<p>The dual-write call is not a function of your compiler.  Your request is passed as a single call to glibc\&#8217;s fwrite(), which then decides how to pass it to the kernel.  It appears to pass one block of data which is composed of as many full filesystem blocks (gathered by the fstat() call) as possible, followed by any remaining data.  Beyond that, I don\&#8217;t know why it doesn\&#8217;t pass the whole request to the kernel and let Linux figure it out.</p>
<p>You contend that there are no other tools for gathering this information, but that\&#8217;s not quite true. :)</p>
<p>As others have mentioned, Oprofile can give you a good idea of both what your application and your system are doing during its execution.  You can also use tools like gprof and valgrind (with callgrind) to get \&#8221;real\&#8221; profiling information and use tools that are already available for graphing and visualizing the resulting data.  Hopefully that will save you some time when writing the upcoming articles you mentioned at the end of your article.</p>
<p>I\&#8217;m very glad to see this written, and look forward to additional articles.  I fully agree that profiling is important, but widely neglected.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: laytonjb</title>
		<link>http://www.linux-mag.com/id/7718/#comment-7973</link>
		<dc:creator>laytonjb</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.linux-mag.com/id/7718/#comment-7973</guid>
		<description>&lt;p&gt;@gordonmessmer&lt;/p&gt;
&lt;p&gt;You are correct that my writing about strace was flawed. Believe it or not I actually understand strace but I didn\&#039;t explain it well :)  Thanks for pointing that out. I\&#039;ve been so close to profiling for so long I just forgot how to explain it. &lt;/p&gt;
&lt;p&gt;I didn\&#039;t know about Oprofile until it was mentioned here. I will definitely give it a whirl to see what it can do for profiling applications.&lt;/p&gt;
&lt;p&gt;Once again - thanks for pointing how my flawed explanation of strace. I will fix that ASAP (but it takes a while to propagate).&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;Jeff
&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@gordonmessmer</p>
<p>You are correct that my writing about strace was flawed. Believe it or not I actually understand strace but I didn\&#8217;t explain it well :)  Thanks for pointing that out. I\&#8217;ve been so close to profiling for so long I just forgot how to explain it. </p>
<p>I didn\&#8217;t know about Oprofile until it was mentioned here. I will definitely give it a whirl to see what it can do for profiling applications.</p>
<p>Once again &#8211; thanks for pointing how my flawed explanation of strace. I will fix that ASAP (but it takes a while to propagate).</p>
<p>Thanks!</p>
<p>Jeff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jirihorky</title>
		<link>http://www.linux-mag.com/id/7718/#comment-7974</link>
		<dc:creator>jirihorky</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.linux-mag.com/id/7718/#comment-7974</guid>
		<description>&lt;p&gt;Hi Jeff,&lt;br /&gt;
Nice article. I have written something similar with a GUI interface and ability to trace child processes too (-f switch). It also plots the access pattern diagram for each file. If you are interested, please check it out on &lt;a href=&quot;http://code.google.com/p/ioapps/&quot;&gt;http://code.google.com/p/ioapps/&lt;/a&gt;
&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Jeff,<br />
Nice article. I have written something similar with a GUI interface and ability to trace child processes too (-f switch). It also plots the access pattern diagram for each file. If you are interested, please check it out on <a href="http://code.google.com/p/ioapps/">http://code.google.com/p/ioapps/</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>