<?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: Poor man&#8217;s contention profiling</title>
	<atom:link href="http://mituzas.lt/2009/02/15/poor-mans-contention-profiling/feed/" rel="self" type="application/rss+xml" />
	<link>http://mituzas.lt/2009/02/15/poor-mans-contention-profiling/</link>
	<description>where ideas come and die</description>
	<lastBuildDate>Fri, 26 Feb 2010 17:15:26 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0-alpha</generator>
	<item>
		<title>By: Mark Callaghan</title>
		<link>http://mituzas.lt/2009/02/15/poor-mans-contention-profiling/comment-page-1/#comment-188879</link>
		<dc:creator>Mark Callaghan</dc:creator>
		<pubDate>Wed, 18 Feb 2009 18:40:42 +0000</pubDate>
		<guid isPermaLink="false">http://dammit.lt/?p=378#comment-188879</guid>
		<description>I modified the script to prepend the thread id to each comma-separated stack so that I can only look at traces for specific threads. This works great as I want to know where a thread spends all time (CPU, blocked on mutex, blocked on IO).</description>
		<content:encoded><![CDATA[<p>I modified the script to prepend the thread id to each comma-separated stack so that I can only look at traces for specific threads. This works great as I want to know where a thread spends all time (CPU, blocked on mutex, blocked on IO).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Callaghan</title>
		<link>http://mituzas.lt/2009/02/15/poor-mans-contention-profiling/comment-page-1/#comment-188873</link>
		<dc:creator>Mark Callaghan</dc:creator>
		<pubDate>Sun, 15 Feb 2009 18:35:57 +0000</pubDate>
		<guid isPermaLink="false">http://dammit.lt/?p=378#comment-188873</guid>
		<description>And the full script
# mpid = mysqld pid
mpid=15739 ; nsamples=1; sleeptime=1;
for x in $( seq 0 $nsamples) ; do
  gdb  -ex &quot;set pagination 0&quot; -ex &quot;thread apply all bt&quot; --batch -p $mpid
  sleep $sleeptime
done &#124; \
awk &#039;BEGIN { s = &quot;&quot;; }  /Thread/ { print s; s = &quot;&quot;; } /^\#/ { if (s != &quot;&quot; ) { s = s &quot;,&quot; $4} else { s = $4 } } END { print s }&#039; -  &#124; \
sort &#124; uniq -c &#124; sort -r -n -k 1,1</description>
		<content:encoded><![CDATA[<p>And the full script<br />
# mpid = mysqld pid<br />
mpid=15739 ; nsamples=1; sleeptime=1;<br />
for x in $( seq 0 $nsamples) ; do<br />
  gdb  -ex &#8220;set pagination 0&#8243; -ex &#8220;thread apply all bt&#8221; &#8211;batch -p $mpid<br />
  sleep $sleeptime<br />
done | \<br />
awk &#8216;BEGIN { s = &#8220;&#8221;; }  /Thread/ { print s; s = &#8220;&#8221;; } /^\#/ { if (s != &#8220;&#8221; ) { s = s &#8220;,&#8221; $4} else { s = $4 } } END { print s }&#8217; &#8211;  | \<br />
sort | uniq -c | sort -r -n -k 1,1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Callaghan</title>
		<link>http://mituzas.lt/2009/02/15/poor-mans-contention-profiling/comment-page-1/#comment-188872</link>
		<dc:creator>Mark Callaghan</dc:creator>
		<pubDate>Sun, 15 Feb 2009 18:27:34 +0000</pubDate>
		<guid isPermaLink="false">http://dammit.lt/?p=378#comment-188872</guid>
		<description>Collapse the call stacks into strings with this:
BEGIN { s = &quot;&quot;; }
/Thread/ { print s; s = &quot;&quot;; }
/^\#/ { if (s != &quot;&quot; ) { s = s &quot;,&quot; $4} else { s = $4 } }
END { print s }

And then aggregate the result with: &#039;sort &#124; uniq -c&#039;</description>
		<content:encoded><![CDATA[<p>Collapse the call stacks into strings with this:<br />
BEGIN { s = &#8220;&#8221;; }<br />
/Thread/ { print s; s = &#8220;&#8221;; }<br />
/^\#/ { if (s != &#8220;&#8221; ) { s = s &#8220;,&#8221; $4} else { s = $4 } }<br />
END { print s }</p>
<p>And then aggregate the result with: &#8217;sort | uniq -c&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Callaghan</title>
		<link>http://mituzas.lt/2009/02/15/poor-mans-contention-profiling/comment-page-1/#comment-188871</link>
		<dc:creator>Mark Callaghan</dc:creator>
		<pubDate>Sun, 15 Feb 2009 18:07:01 +0000</pubDate>
		<guid isPermaLink="false">http://dammit.lt/?p=378#comment-188871</guid>
		<description>Domas,
You need to share the 20 lines of Perl/Python/Awk.</description>
		<content:encoded><![CDATA[<p>Domas,<br />
You need to share the 20 lines of Perl/Python/Awk.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
